forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: jenma on July 16, 2004, 06:08:10 am

Title: EXIF and large Thumbnail Size
Post by: jenma on July 16, 2004, 06:08:10 am
I'm using Coppermine 1.3 and Imagemagick and I'm facing the following problem.

When I first upload photos (1024 X 768, 96dpi, 220k) resized by Photoshop (regular save as jpeg), I get thumbnails that are over 30k.  This is a problem for me because I host my server at home and I need thumbnail sizes to be under 10k.

Then I tried to use the save to web function with Photoshop, after uploading the resized photos (1024 X 768, 96dpi, 200k), the thumbnail sizes did dropped dramatically to under 10k. 

I figured the major difference beteen the two is that I loose all the EXIF information when I "Save to Web".  As a result, I get smaller original resized photos and thumbnails.

The problem is I would like to have EXIF info.  So what I did was to add EXIF information to the original resized photos and upload again, which actually solves my problem.  But I thought it's a stupid way I have to do all that to achieve what I want: thumbnail sizes under 10k and displaying EXIF info.

Now my questions are: am I doing anything wrong in the process?  Does EXIF info really takes up that much space?  Does Imagemagick look into the EXIF when converting? 

Thanks in advance.
Title: Re: EXIF and Thumbnail Size
Post by: Joachim Müller on July 16, 2004, 07:59:28 am
I don't get the point: why do you create thumbnails at all - that's something coppermine should be used for (and does it great). Did I get this wrong? There's no need for the exif info to reside in the thumbnails anyway, it will be enough if the exif info is being stored in the full-size pic and/or the intermediate. Included in your exif info there's as well an auto-generated thumbnail within the exif info that usually makes your file size larger (greatly depends on camera brand). I had a similar issue with pics from a Minolta Dimage, the thumbnail inside the exif info was just too huge, whereas my Canon Ixus produces nice, small exif thumbnails.

GauGau
Title: Re: EXIF and Thumbnail Size
Post by: jenma on July 16, 2004, 03:01:53 pm
Sorry, I must not have explained myself clearly.  I did use Coppermine/Imagemagick to create the thumbnails.  The thing is, thumbnail sizes created by imagemagick depends on the original file I put in. 

When I upload an original file with EXIF data, the thumbnails, created by Coppermine/Imagemagick, are bigger (30k); whereas if I upload an original file without EXIF data, the thumbs are under 10k. 

My problem is I do want to have the EXIF data in the origianl file so Coppermine can display them. 
Title: Re: EXIF and Thumbnail Size
Post by: Tarique Sani on July 16, 2004, 03:14:14 pm
Try and get one of the larger thumbnails and see if that also has inherited the EXIF data....
Title: Re: EXIF and Thumbnail Size
Post by: jenma on July 16, 2004, 03:50:29 pm
Yeah, there is EXIF info in the larger thumbs.  I think that's why there're larger in size.  But Imagemagick won't discard that info in the thumbs, right?
Title: Re: EXIF and Thumbnail Size
Post by: jenma on July 16, 2004, 05:49:03 pm
To add to my problem, re-uploading images containing EXIF data would only work when the page containing th photo hasn't been viewed/displayed before.  Once the page has been viewed and the original photos without EXIF is loaded, then even when I re-upload original photo with EXIF, the EXIF info won't show up.  I tried to force the page to "read EXIF info again" under edit description and it's still doesn't do the trick...
Title: Re: EXIF and Thumbnail Size
Post by: Casper on July 16, 2004, 09:06:11 pm
Try using the admin tools, to rebuild the intermediate only.  I seem to remember reading that would do it.
Title: Re: EXIF and Thumbnail Size
Post by: jenma on July 16, 2004, 09:42:00 pm
Thanks.  Actually I solved the problem by erasing the EXIF table with phpmyadmin.  But my original problem still exist...
Title: Re: EXIF and Thumbnail Size
Post by: Tarique Sani on July 17, 2004, 04:43:50 am
Yeah, there is EXIF info in the larger thumbs.  I think that's why there're larger in size.  But Imagemagick won't discard that info in the thumbs, right?
Hmmm.... there must be something which can be passed to imagemagic to make it discard the EXIF info, you will have to read up on that
Title: Re: EXIF and Thumbnail Size
Post by: jenma on July 17, 2004, 07:54:31 am
YES!!!  You're wonderful.  Turns out I only needed to add -strip to the command line and I get small thumbnails.  Thanks!!!
Title: Re: EXIF and Thumbnail Size
Post by: Tarique Sani on July 17, 2004, 08:35:40 am
@all Devs - I recommend that -strip be added as a default option along with -antialias
Title: Re: EXIF and Thumbnail Size
Post by: Joachim Müller on July 17, 2004, 09:20:29 am
I agree, please commit.

GauGau
Title: Re: EXIF and Thumbnail Size
Post by: Tarique Sani on July 17, 2004, 09:36:56 am
Put it in basic.sql but decided against update.sql as it might overwrite if someone has already changed it
Title: Re: EXIF and Thumbnail Size
Post by: Carsten on July 17, 2004, 08:14:34 pm
Hi.

I also wondered why my thumbnails now are twice as big as they used to be .. ;)

But, to add "-strip" resulted in error messages. "-strip" doesn't seem to be a legal option of ImageMagick/convert.

Did I misunderstood something?

Edt:
Ok, "-strip" is a legal option of ImageMagick:
http://www.imagemagick.net/www/ImageMagick.html#details-strip
But I guess it's a new one. So there will be lots of failures if it will be added as a default option.

Edit #2:
The date it was added is 2003-06-06. See http://studio.imagemagick.org/www/Changelog.html.
To new for most webhosters I guess.

Edti #3:
Continuation of my monologue:
Use +profile '*' instead of -strip. Pay attention: use a "plus" and single quotes!
Works fine. Size of thumbnail 3.5 kB instead of 9.8 kB  ;D
Title: Re: EXIF and Thumbnail Size
Post by: Tarique Sani on July 18, 2004, 04:07:29 am
In the light of above I think -strip should be removed and this topic be made a sticky
Title: Re: EXIF and large Thumbnail Size
Post by: Joachim Müller on July 18, 2004, 08:26:42 am
What exactly happens if a non-existing option is used for ImageMagick? Will it ignore, fail or do "funny" things?

GauGau
Title: Re: EXIF and large Thumbnail Size
Post by: Carsten on July 18, 2004, 01:06:52 pm
When I tried to update the thumbs it failed: ERROR creating:$thumb
(I used Coppermine 1.21)
Title: Re: EXIF and large Thumbnail Size
Post by: jenma on July 19, 2004, 09:11:48 am
I tried +profile '*' before, but I get the ERROR creating:$thumb message.  I'm using Coppermine 1.3.0 and Imagemagick 6.0.3 right now.  I guess they updated the command in the newer versions...
Title: Re: EXIF and large Thumbnail Size
Post by: Carsten on July 19, 2004, 10:40:38 am
ImageMagick 5.5.7 09/23/03 in front of me doesn't contain the -strip option. Should be integrated since 5.5.8.

As far as I know -strip is just an alias for +profile '*', as the quotes could cause errors.
Perhaps you could try +profile \'*\'. That also works here (CPG 1.2.1, IM 5.4.4 04/05/02)
Title: Re: EXIF and large Thumbnail Size
Post by: jenma on July 19, 2004, 01:22:06 pm
O, -strip worked for me alright.  I'm just posting in cause the developers have decided to add that to the default, it might cause problems depending on the different versions.

Thanks for your kind suggestion though.
Title: Re: EXIF and large Thumbnail Size
Post by: Tarique Sani on July 19, 2004, 01:27:25 pm
I had added -strip as default BUT have removed it till the time I don't figure out a foolproof way to get the IM version
Title: Re: EXIF and large Thumbnail Size
Post by: Carsten on July 19, 2004, 01:44:04 pm
O, -strip worked for me alright.
Yes, I know that -strip works with your new version. (and +profile '*' does not).

Here, with my old version of IM, it's the other way round.

So it would be nice to find another option, which works with all versions to implement it as default.
My proposal is +profile \'*\', which works with IM 5.4.4. Perhaps could somebody with a new version of IM try out?
Title: Re: EXIF and large Thumbnail Size
Post by: jenma on July 19, 2004, 08:10:11 pm
I just tried +profile \'*\' and it didn't work (IM 6.0.3).  It didn't generate any error message but the thumbnails it generated contain EXIF info and are above 30k.
Title: Re: EXIF and large Thumbnail Size
Post by: Joachim Müller on July 19, 2004, 10:28:37 pm
so, after all profile doesn't create errors on newer versions, that's something...

GauGau
Title: Re: EXIF and large Thumbnail Size
Post by: OmegaGOD on November 20, 2004, 11:02:34 pm
Maybe I can be of assistence. Directly from Imagemagick's website... the correct Syntax is +profile "*" with DOUBLE quotes instead of single quotes. Also, if you supply an option to Imagemagick that it does not understand, it barfs. So it halts instead of ignoring the bad argument.

--OmegaGOD
Title: Re: EXIF and large Thumbnail Size
Post by: TerryG on April 10, 2005, 01:47:28 am

I had added -strip to my IM options, but for some reason it wasn't working reliably.  Some photos, when uploaded, would NOT have the EXIF data stripped from the thumbnails, although if I used the admin utils to recreate the thumbs, then the EXIF data went away.

There is an option to convert called -thumbnail which is an alias for "-geometry -strip"   It seems to work better than specifying them individually.  At least, so far it seems to work. 

To determine your Image Magick version you can run this tiny php script (save it to a file, upload it, then browse to it)

Code: [Select]
  <?php
  $cmd 
"/usr/local/bin/convert -version";

  
$output "";
  
$retval "";

  
exec ($cmd$output$retval);

  
$count=count($output);
 
//counts number of rows $in results array
 
for($i=0;$i<$count;$i++)
 {
   print 
"$output[$i]<br>";
 }
  
?>


I'm not sure exactly when -thumbnail was added, but I'm on versio 6.1 and it is there.  To use it, modify picmgmt.inc.php in the following manner:

1.  find the line that includes
Code: [Select]
                    $cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} $src_file $im_dest_file";
 
and change the "-geometry" to "-thumbnail"

Terry
Title: Re: EXIF and large Thumbnail Size
Post by: TerryG on April 10, 2005, 05:52:51 pm

just a little follow up... -thumbnail still seems to be working much better than -strip or -profile "*"