Print Topic - Archive

E-Blah Community  /  Mod Requests and Support  /  Imagemagick's file size
Posted by: nahual, June 13, 2007, 7:16pm
Hi, I have installed in my forum Upload resize mod. It is working fine but different than its default behavior:
I made a test upload to my forum of one photo and ended with an image of 142k:
http://www.fororeptiles.org/cgi-bin/forum/Blah.pl?m-1181782722/

then I uploaded the same photo to my test forum at another server and the final image is 52K!!!
http://www.bajapesca.net/cgi-bin/forum/Blah.pl?m-1181782114/

I'm using 600 x 600 as the mod settings in both forums. Does anybody have an idea why I'm getting different sizes at these two servers?

Could be this imagemagick's version related? I already checked at my host and the the one with the forum with bigger file size is running the latest imagemagick version (6.x), my test forum, the one with the smaller size file is using 5.x imagemagick version.

As you can see quality is about the same..

Thanks for your time..
Posted by: Craig, June 13, 2007, 11:20pm; Reply: 1
It could be the version, but it could also be the quality setting for uploaded images.  I'm not familar with that mod, so I don't know if it has quality settings, but that would be my guess.

-Craig.
Posted by: 1850 (Guest), June 14, 2007, 6:38am; Reply: 2
This has to be sever setup, the 2 servers have different versions or have different defaults within imagemagick.
Posted by: nahual, June 16, 2007, 10:59am; Reply: 3
Thanks for your replies, It seems that is was something version related. Anyway I made a little research and was able to end with a good quality and low file size conversions:
I change:
Code
if ($fnchk eq "jpg" || $fnchk eq "gif"  || $fnchk eq "png") {
$exit_code = system("convert -sample 400x400\\> $savedfile $savedfile");


for:
Code
if ($fnchk eq "jpg" || $fnchk eq "gif"  || $fnchk eq "png" || $fnchk eq "bmp") {
$exit_code = system("convert -quality 90 -thumbnail 600x600\\> $savedfile $savedfile");


Also enabled the eblah built in thumbnail funtion, this way users can click on an tumbnail (GD) image of a few bytes to gain access to good quality and small file size 600 x 600 image(IM)!

-sample was replaced for -thumbnail in IM code as this one makes a much better work with edges..
Althought this does not resize bmps it does cut some file size, maybe just the photo profiles...

Thanks again...
Posted by: nahual, June 16, 2007, 1:07pm; Reply: 4
Quoted from nahual
Thanks for your replies, It seems that is was something version related. Anyway I made a little research and was able to end with a good quality and low file size conversions:
I change:
Code
if ($fnchk eq "jpg" || $fnchk eq "gif"  || $fnchk eq "png") {
$exit_code = system("convert -sample 400x400\\> $savedfile $savedfile");


for:
Code
if ($fnchk eq "jpg" || $fnchk eq "gif"  || $fnchk eq "png" || $fnchk eq "bmp") {
$exit_code = system("convert -quality 90 -thumbnail 600x600\\> $savedfile $savedfile");


Also enabled the eblah built in thumbnail funtion, this way users can click on an tumbnail (GD) image of a few bytes to gain access to good quality and small file size 600 x 600 image(IM)!

-sample was replaced for -thumbnail in IM code as this one makes a much better work with edges..
Althought this does not resize bmps it does cut some file size, maybe just the photo profiles...

Thanks again...


take a look: Original uploaded image 4.56MG, after IM conversion 134K, GD thumbnail 31K!!
http://www.fororeptiles.org/cgi-bin/forum/Blah.pl?b-gtortugas/m-1182020433
NOTE: click on the 31k thumbnail to see the 134k IM converted image..
Posted by: nahual, June 16, 2007, 7:39pm; Reply: 5
sorry wrong link, this is the one:
http://www.fororeptiles.org/cgi-bin/forum/Blah.pl?m-1182044306/
Print page generated: May 24, 2013, 9:34pm