Gossamer Forum
Home : Products : DBMan : Customization :

Automatic Thumnails

Quote Reply
Automatic Thumnails
Hi all,

I was wondering if any of you knew about a Perl script that could create individual thumbnails automatically. I've tried 2 of them, HTMLThumbnail, and PerlMagick (ImageMagick) but - HTMLThumbnail seems to create a whole sheet (and I just want individual, smaller images) and I have tried numberous times installing ImageMagick (which PerlMagick need) with no luck. Has anyone successfully installed this - or know of a better product? I just need something that can create a "standard sized" thumbnail for each image that is uploaded, and saves it to the server. Currently, I do all thumbnails manually, which is very time consuming. Perhaps we could make this a MOD to go with JPDeni's File Upload script. Thanks!

Quote Reply
Re: Automatic Thumnails In reply to
Hey... search for IMAGE GALLERY and you'll see ive had exactly the same probs!

Anyway, just (today) found something. It's called jpgtn and its a basic thumbnailing module http://ftp:/...u.net/graphics/jpeg/. You can install it locally or in the root, and its small. By passing the file name and some size params it will automatically pump out thumbnails HORRAY!SmileSmileSmile

At the moment I can't see a way to set a fixed image size, as it uses some clever stuff so you can set the LONGEST side length. I want to set height and width though, so I'll let you know...

If I get it working with DBMan I'll post the mod.

Cheers!
Ben
------------
http://www.travel-experiences.com
Quote Reply
Re: Automatic Thumnails In reply to
Yes, please do!


JPD
Quote Reply
Re: Automatic Thumnails In reply to
benseb:

HORRAY! is right! So many others have asked about something like this ... can't wait to see how you integrate it with DBMan.

I'm sure many people will appreciate it. Smile

Quote Reply
Re: Automatic Thumnails In reply to
Pardon me for asking a stupid question, but what's the purpose of automatically creating thumbnails that are not optimized. Is the file size even reduced, or are they only minimized by height/width constraints?

The only reason I can see to want such a thing is if you have a huge number of thumbnails to deal with, in which case it's all that much worse to not have them optimized.

What am I missing?

Dan

Quote Reply
Re: Automatic Thumnails In reply to
My understanding, Dan, is that the module Ben was talking about will create a thumbnail file that is much smaller than the original file. The script "HTML Thumbnail" that was mentioned in the first post says that the resulting file is about 2% of the size of the original.


JPD
Quote Reply
Re: Automatic Thumnails In reply to
That would certainly make it of more use. Still, having done quite a bit of image optimization, I would never trust an automated process to pick the best balance of file size and clarity. It just depends too much on the individual picture.

Dan

Quote Reply
Re: Automatic Thumnails In reply to
Fair enough,

but when I have people adding up to 20 photos each, and I need to FTP in, download the large images, thumbnail them, upload them to another directory, add the larger images to another, then delete the temp files, you can see why an automatic process might be good!



Cheers!
Ben
------------
http://www.travel-experiences.com
Quote Reply
Re: Automatic Thumnails In reply to
Hey!

Could you give me a hand!

I know that the thumbnail prog will work using the command line:

/home/travel/bin/bin/jpgtn -H $height -d $directory -p $prefix -q $quality $filenames

But i will need to pass the information to the command line. all the variables will not change (could be in db.cfg) except the filenames.

I think this needs to be something like:
$filenames = '/home/travel/public_html/db/big_pic_temp' . 'the ID from the validate form';

1) How can I get the Id from the validate sub
2) how do I run the script automatically once the image has been validated (on validate_success?)

Thanks!


Cheers!
Ben
------------
http://www.travel-experiences.com
Quote Reply
Re: Automatic Thumnails In reply to
Hi benseb,

What's the filename of the package you downloaded from that FTP site? There's around 8 different files there, and none of them seem to match "jpgtn" or something similar. Thanks:)

Quote Reply
Re: Automatic Thumnails In reply to
I would have to see the script to be able to tell you, but I'm having the same trouble as Mark. I don't see the file you're referring to.


JPD
Quote Reply
Re: Automatic Thumbnails In reply to
Try this

http://www.go.dlr.de/...gtn-1.04.tar.gz.html

Use the links at the top to download a .zip or .tar depending on your fancy!





Cheers!
Ben
------------
http://www.travel-experiences.com
Quote Reply
Re: Automatic Thumbnails In reply to
Thanks for the info, Ben. I'll have to do some studying to figure it out. This is new territory for me. Smile

JPD
Quote Reply
Re: Automatic Thumnails In reply to
I just installed and got jpgtn working, and it does exactly what I wanted. Now I just need what benseb is asking for, a way to call the program from the upload_success sub. Specifically, we need something like:

../jpgtn-1.04/jpgtn -s 130 -q 85 -p s ../../$SAVE_DIRECTORY/$rec{$db_key}.jpg

where 130 is the max pixel dimensions, 85 is the JPG quality, and "s" is the prefix for the output name. Any ideas? Thanks.

BTW, benseb, have you been able to get a thumbnail for an image outside of the directory running jpgtn? I have tried with several paths, and none have worked.