Posted on: 02/13/05 05:40pm
By: beewee
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.
zClassifieds:auto create thumbnails
Posted on: 02/16/05 05:44am
By: Robin
[QUOTE BY= beewee] Did anyone find a hack to let zClasifieds create the thumbnails?[/QUOTE]
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.[/QUOTE]
You're probably right.
Currently I'm working on an update. Will be looking for some testers soon.
zClassifieds:auto create thumbnails
Posted on: 02/16/05 06:05am
By: beewee
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...
zClassifieds:auto create thumbnails
Posted on: 02/16/05 03:29pm
By: samstone
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
zClassifieds:auto create thumbnails
Posted on: 02/16/05 03:51pm
By: beewee
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!!
zClassifieds:auto create thumbnails
Posted on: 02/16/05 04:10pm
By: samstone
This is the change I made on the last section of the function.inc
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.
zClassifieds:auto create thumbnails
Posted on: 02/16/05 10:40pm
By: ronack
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.