4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Warz on November 26, 2008, 04:23:07 PM
-
Hello,
I am using autothumb with ImageMagick, but I have one problem, a thumbnail (153x103 px) takes 40 kb!
It doesn't help to change quality, just a little... I have searched a bit and found out it's possible to have smaller size (5kb, like i get with programs on my computer), you can see i find a code here:
http://www.perlmonks.org/?node_id=495333
but I don't know how to insert the code. Maybe someone can give advice?
Thanks a lot :)
PS: I have already done this: http://www.4homepages.de/forum/index.php?topic=3509.msg14482#msg14482 (to make image look better)
-
haha nevermind me, google is my friend:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=5&t=10121
What I did was only to add -strip
From:
$command = $convert_options['convert_path']." -quality ".$quality." -antialias -geometry $width"."x"."$height \"$src\" \"$dest\"";
to:
$command = $convert_options['convert_path']." -strip -quality ".$quality." -antialias -geometry $width"."x"."$height \"$src\" \"$dest\"";
Now this is exciting, from 40kb to 7kb :D
-
Thank you for sharing this.
By default ImageMagick preserves EXIF/IPTC info (apparently)
Your solution will remove EXIF/IPTC on thumbnails and resized images, this solution might not be desired if EXIF is important ;)
To remove EXIF/IPTC only from thumbnails use this instead:
$command = $convert_options['convert_path'].(strstr($dest, THUMB_PATH) ? " -strip" : "")." -quality ".$quality." -antialias -geometry $width"."x"."$height \"$src\" \"$dest\"";
-
HI,
I have not noticed this file size.. :) I am using GD Bibliothek for thumbnail creation .. Is this creates the thumbnails in less size ?? :roll:
-
GD doesn't save any EXIF/IPTC, that's why you didn't notice it ;)
And yes, GD creates images with smaller filesize, but quality is a little worse then with IM (not as sharp).
-
Thanks, I tried that other command line and it worked very well too :)
But I have another problem, how can I make thumbnail fixed size, so called "stretch to fit"? It doesn't matter what the original picture looks like, I want to always have a picture with width: 154 and height: 104. Is this possible?
-
Thanks, I tried that other command line and it worked very well too :)
But I have another problem, how can I make thumbnail fixed size, so called "stretch to fit"? It doesn't matter what the original picture looks like, I want to always have a picture with width: 154 and height: 104. Is this possible?
Anyone?
-
In includes/functions.php find two times:
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
Insert below:
$width_height = (!empty($image_info[3])) ? " width=\"154\" height=\"104\"" : "";
-
In includes/functions.php find two times:
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
Insert below:
$width_height = (!empty($image_info[3])) ? " width=\"154\" height=\"104\"" : "";
Hey,
are you sure? It didn't work for me?
I tried to:
- Add the line once under the last one
- Add the line under both
- Add the line twice and remove the other lines