Coppermine not reading EXIF from Sony or Sanyo Cameras Coppermine not reading EXIF from Sony or Sanyo Cameras
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Coppermine not reading EXIF from Sony or Sanyo Cameras

Started by EstebanDime, May 28, 2013, 11:58:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

EstebanDime

Hi,  I noticed that EXIF data is not being read from either Sony or Sanyo digital cameras.  EXIF data is being read by Ipad2 jpgs' however.  Is this a bug?

Αndré

Please attach some example pictures so we can test it ourselves.

EstebanDime

It appears that when Coppermine resizes down larger images to the max allowed size then the EXIF data is removed from the resized file.  If you upload a resolution smaller than the max allowed then the EXIF remains in tact.

I have verified that EXIF reading is enabled in PHP.  Also have tried some pictures from an Ipad2 and those EXIF data are read.

Is there a way to keep the EXIF data for large pictures when they are resized???

Αndré

I'm not sure if this also applies to ImageMagick, but if you process (resize, rotate, etc.) images with GD2, any meta data is lost. However, as we already read IPTC data before we process images, that should also be possible with EXIF data. In this case, the data is still removed from the image, but it has been already stored in the database at this point. We plan to save the EXIF data before we process images and then write it back afterwards, but there's no progress yet, it's currently just an idea.

EstebanDime

Hi Andre,

Thank you for the feedback.  Yes, it appears that the only way to keep EXIF data is to set the max width/length resolution in Coppermine config to a larger value than the pictures you are uploading.

I originally set the value to 2048 to conserve disk space, however pictures larger than 2048 are resized and the EXIF is lost.  It has not been my experience that the EXIF data is ever written to the database before the image is resized upon uploading.

It would be fantastic to keep the original EXIF data on the resized pictures.  I have a windows program "BatchPhoto" that allows you to resize images and retain the original EXIF data.  It is just an extra step that I would prefer not to go through.

Most registered users are just uploading the pictures directly from their cameras and those are often very high resolutions.  2048 seems to be more than enough to look at the picture on a monitor though.

Αndré

You could try to use ImageMagick instead of GD2 as resizing method in Coppermine. As I said, I currently don't know if it will work with ImageMagick, but it's maybe the easiest solution without any coding effort nor extra steps before the upload.

phill104

Imagemagik does apparently keep the Exif data but I have not tested it to be sure.

Other packages do sort of get around this by reading the Exif data then write the important merged data to the IPTC-marker. This way most products including Adobe can still read the data.

http://php.net/manual/en/function.iptcembed.php
http://php.net/manual/en/function.iptcparse.php

It is a mistake to think you can solve any major problems just with potatoes.

EstebanDime

I had my host company install imagemagick on the server and will report back if this retains the EXIF data on resize.  Unfortunately, they won't reboot the server until this weekend for me to try it.

EstebanDime

Hi Guys,

Got Imagemagick installed on the shared server, however have been running into issues.

I have verified all the settings are correct from the FAQ, ie permissions set correctly and absolute path to Imagemagick correctly entered.

This is the specific error when running the debug mode upon uploading a file:

Critical error
The file 'albums/userpics/10001/SANY0282.JPG' can't be inserted in the album

Error executing ImageMagick - Return value: -1

Cmd line :
"C:/ImageMagick/convert" -quality 80 -geometry 2048x1536 "E:/CustomerData/webspaces/webspace_00101714/webapps/Coppermine-1440/htdocs/albums/userpics/10001/SANY0282.JPG" "E:/CustomerData/webspaces/webspace_00101714/webapps/Coppermine-1440/htdocs/albums/userpics/10001/SANY0282.JPG"

The convert program said:

File: E:\CustomerData\webspaces\webspace_00101714\webapps\Coppermine-1440\htdocs\db_input.php - Line: 699


I came across some obscure threads that related to Imagemagick having problems with virtual cores on shared servers.  They recommended using a line of code:

putenv("MAGICK_THREAD_LIMIT=1")

Where would I place this line of code???


Αndré

Quote from: EstebanDime on June 10, 2013, 03:15:55 PM
Where would I place this line of code???

Try to add it above
$output = array();
in include/picmgmt.inc.php.