Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Tuesday, May 21 2013 @ 01:59 PM EDT


 Forum Index > Support > Plugin Support New Topic Post Reply
 zClassifieds:auto create thumbnails
   
beewee
 02/13/05 05:40PM (Read 2684 times)  
+++++
Full Member

Status: offline


Registered: 08/05/03
Posts: 969
If you place an add in zClassifieds you have to upload the thumbnails yourself. Did anyone find a hack to let zClasifieds create the thumbnails?

I'm afraid that the double upload (and resize) action is to much trouble for most users.

Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 
Profile Email Website
 Quote
Robin
 02/16/05 05:44AM  
+++++
Full Member

Status: offline


Registered: 02/15/02
Posts: 725
Quote by beewee: Did anyone find a hack to let zClasifieds create the thumbnails?

Not that I'm aware of. That would require use of some graphic library. Currently it's beyond my php skills.
Quote by beewee:I'm afraid that the double upload (and resize) action is to much trouble for most users.

You're probably right.
Currently I'm working on an update. Will be looking for some testers soon.

Geeklog Polish Support Team
 
Profile Email Website
 Quote
beewee
 02/16/05 06:05AM  
+++++
Full Member

Status: offline


Registered: 08/05/03
Posts: 969
Currently I'm working on an update. Will be looking for some testers soon.


Great, I just changed all the PHP files because of the known errors.

But I would like to test it if you like. Perhaps I'll let my programmer make the scripting for the thumbnails. Or I'll only allow smaller images (200x 200px) and forget the thumbnails, that will save me 150 Euro programming and a few weeks waiting...

Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 
Profile Email Website
 Quote
samstone
 02/16/05 03:29PM  
+++++
Full Member

Status: offline


Registered: 09/29/02
Posts: 820
Where did you get your version of zClassified? Mine comes with the auto thumbnail using GD. I just changed it to generate full color thumbnail rather than its original 16 color thumbs. I also change it to limit only the width not the height because, if you limit both, you get a distorted thumbnail.

I will post the change when I get to my home computer.

Sam

 
Profile Email
 Quote
beewee
 02/16/05 03:51PM  
+++++
Full Member

Status: offline


Registered: 08/05/03
Posts: 969
Got it from the GL site, or Squatty, can't remember exactly. I'll download it again in a few days, don't have time now.

But: many thanks for your reply!!

Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 
Profile Email Website
 Quote
samstone
 02/16/05 04:10PM  
+++++
Full Member

Status: offline


Registered: 09/29/02
Posts: 820
This is the change I made on the last section of the function.inc

PHP Formatted Code

if ($_CONF_ADVT['$autothumbnail'] == 1 )
{
function makeThumb( $scrFile, $dstFile, $dstW=120, $dstH=100 )
        {
                global $_CONF;
                $im = ImageCreateFromJPEG( $scrFile );
                $srcW = ImageSX( $im );
                $srcH = ImageSY( $im );
                $ratio = ($srcW / $srcH);
                $newW = $dstW; 
                $newH= round(($dstW / $ratio));
                $ni = ImageCreateTrueColor( $newW, $newH );
                ImageCopyResized( $ni, $im, 0, 0, 0, 0, $newW, $newH, $srcW, $srcH );
                ImageJPEG( $ni, $dstFile );
        }
}





 


You would notice that I didn't use the $dstH in the calculation even though I left it in there in case I want to limit the height in the future.

The New Width ($newW) is taken from the set width ($dstW=120, you can change it to any number you want). The New Height is calculated by dividing the $dstW by the $ratio that was obtained from the origional photo ($srcW / $srcH), to prevent distortion.

 
Profile Email
 Quote
ronack
 02/16/05 10:40PM  
+++++
Full Member

Status: offline


Registered: 05/27/03
Posts: 602
There is also a setting in config.php to specify autocreate thumbnails or not. You can also specify how many images you want to allow.

 
Profile Email
 Quote
Content generated in: 0.87 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content