Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 11:20 am EST
Geeklog Forums
zClassifieds:auto create thumbnails
Status: offline
beewee
Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
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
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
13
15
Quote
Status: offline
Robin
Forum User
Full Member
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
15
18
Quote
Status: offline
beewee
Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
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
17
16
Quote
Status: offline
samstone
Forum User
Full Member
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
I will post the change when I get to my home computer.
Sam
19
14
Quote
Status: offline
beewee
Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
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
But: many thanks for your reply!!
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
19
14
Quote
Status: offline
samstone
Forum User
Full Member
Registered: 09/29/02
Posts: 820
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.
Text 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.
11
15
Quote
All times are EST. The time is now 11:20 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content