Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 05:37 pm EDT

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
 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
 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
 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
 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
 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

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.
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
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.
 Quote

All times are EDT. The time is now 05:37 pm.

  • 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