I just got this error when trying to upload an imagefield

warning: exif_read_data(3.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in sites/all/modules/getid3/getid3/module.graphic.jpg.php on line 59.

Comments

DL Dunning’s picture

I also just got this exact error today when uploading an imagefield. I have not used this function for a month or more, so I can't be sure when it first appeared, but it did not used to happen, and I have not made any changes to my getID3() 1.7.9-20090308 code installation. I presume there must therefore be a conflict with an update in perhaps Imagefield or Imagecache?

snorkers’s picture

I see this error too. Despite the error, the image uploads and is rendered correctly.

ikarusweb’s picture

* warning: exif_read_data(R6992.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in /home/www-tol/ansishin/public/dada-after.com/site/sites/all/modules/getid3/getid3/module.graphic.jpg.php on line 59.
* warning: exif_read_data(B6704_0.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in /home/www-tol/ansishin/public/dada-after.com/site/sites/all/modules/getid3/getid3/module.graphic.jpg.php on line 59.
* warning: exif_read_data(R6858_0.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in /home/www-tol/ansishin/public/dada-after.com/site/sites/all/modules/getid3/getid3/module.graphic.jpg.php on line 59.
* warning: exif_read_data(_DAD6710_0.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in /home/www-tol/ansishin/public/dada-after.com/site/sites/all/modules/getid3/getid3/module.graphic.jpg.php on line 59.

me too if some1 can fix that plz ^^

drewish’s picture

anyone have an image we can test it out on? you also might try upgrading the getid3 library to the new 1.7.9 release.

ahimsauzi’s picture

Same error and I am on version 1.7.9

nsyll’s picture

subscribe

cheeop’s picture

Having issue, I guess I will disable FileField and Getid3 until this is resolved.
warning: exif_read_data(SaraHaze_20100121_0003_0.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in /home/-----/public_html/modules/getid3/getid3/module.graphic.jpg.php on line 59.

azinck’s picture

subscribe

hustler6911’s picture

subscribe

klonos’s picture

Title: Error » warning: exif_read_data... [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in module.graphic.jpg.php, line 59

I am not having this issue, but the title was too generic to be of any help. Now it is easier to search for it as well ;)

Alphabool’s picture

I have this error with 6.x-1.3. Download a sample image at http://graphics8.nytimes.com/images/2010/04/17/opinion/18bono2_art/18bon... .

avanmosel’s picture

It looks like the "getid3.module" has an issue.
(Located in: sites\all\modules\getid3)

I solved the problem by editing the "getid3.module" file:
Comment out the following (line 69 > 76):

/**
 * Analyze file and return its media information.
 */
/*
 function &getid3_analyze($path) {
  $info = array();
  if($id3 = &getid3_instance()) {
    $info = $id3->analyze($path);
    unset($id3);
  }
  return $info;
}
*/

And add this instead:

/**
* Analyze file and return its media information.
*/
function &getid3_analyze($path) {
  $info = array();
  if($id3 = &getid3_instance()) {
    try {
        $info = $id3-> analyze($path);
    } catch (getid3_exception $e) {
        // you could do something here with the error, maybe saved in drupal's error log
    }
    unset($id3);
  }
  return $info;
}

I don't know if this will work for you, but it sure did the trick for me.

Arno

Alphabool’s picture

Catching the error looks like a solution. Could we get this committed?

mattwmc’s picture

I just had the same error when uploading an image through wysiwyg imageupload mod.
*Used a different image, didn't have the problem.

krorick’s picture

I found the same error when attempting to process JPEG files created in Photoshop with XMP data in the APP1 tag. The fix I came up with was to verify the APP1 tag contained Exif data before attempting to parse it.

The change is in the sites/all/libraries/getid3/module.graphic.jpg.php line 57:

was: if (function_exists('exif_read_data') {

fix: if (function_exists('exif_read_data')
&& strpos ($imageinfo['APP1'], 'Exif') === 0) {

yan’s picture

Version: 6.x-1.2 » 6.x-1.3

I'm getting the same error message but neither #12 nor #15 solved it for me.

mandclu’s picture

I got this same error using JPGs from Photoshop. Re-saving without metadata allowed the file to upload without problems. Having done some research on the error message, it seems this is a problem with the getid3 library with files from recent versions of Photoshop.

yngens’s picture

same problem here

harcher’s picture

Had same warning and simply turned off error messages on the function exif_read_data(), so

change line 59, in file "/sites/all/libraries/getid3/getid3/module.graphic.jpg.php", from:
$ThisFileInfo['jpg']['exif'] = exif_read_data($ThisFileInfo['filenamepath'], '', true, false);

to:
$ThisFileInfo['jpg']['exif'] = @exif_read_data($ThisFileInfo['filenamepath'], '', true, false);

jrockowitz’s picture

Figured it is worth noting that the same issue has been brought up in the getID3() support forums.

The posted solution, Fix for Exif errors on non-Exif JPEGs, is to...


Add a check on line 57:
current: if (function_exists('exif_read_data')) {
fix: if (function_exists('exif_read_data') && strpos ($imageinfo['APP1'], 'Exif') === 0) {

This might work better then suppressing all errors.

cato’s picture

#19 with the #20 applied fixed it for me.
The getId3 library really needs a rewrite.

michael.k’s picture

#19 worked for me, too, for getID3() 1.7.9-20090308. Thanks!

joachim’s picture

StatusFileSize
new543 bytes

I can't get the fix in #12 (on the module file itself) to work.

Here's the fix from #20 as a patch on the getid3 library folder.

AntiNSA’s picture

[function.exif-read-data]: Incorrect APP1 Exif Identifier Code in /home/cyberfan/htdocs/sites/all/libraries/getid3/getid3/module.graphic.jpg.php on line 59.
warning: exif_read_data(4454707446_db0268b367_m.jpg) [function.exif-read-data]: Incorrect APP1 Exif Identifier Code in /home/cyberfan/htdocs/sites/all/libraries/getid3/getid3/module.graphic.jpg.php on line 59

So what is the right way? # 23 or #20??????

joachim’s picture

As I wrote, my patch in #23 is simply the change in #20 but as a patch, so it's easier to work with.

AntiNSA’s picture

got it, thanks

hadsie’s picture

StatusFileSize
new456 bytes

I think the solution from #12 is the right way to handle this. While #20 fixes the issue it's a bit of a problem as we're patching code for an upstream library. Also, there are other exceptions that can be raised in getid3 that won't be solved by #20. The attached patch implements @avanmosel's suggestion in #12 and also adds a watchdog message for this. I don't believe that exceptions raised from the getid3 library should necessarily lead to Drupal failing, but reporting the errors is important.

PixelClever’s picture

I applied the patch on #27 and the error is still there.

hjmichael’s picture

I applied the patch in #27 and the error is still there, fresh install, same code on other sites and they are not having an issue. edit
Change the image from a gif to jpg and the problem went away. Not sure what that means, but with the patch applied and using a jpg I am no longer getting errors. edit
Then added another product and an getting errors with either file format, so back to no clue.

ayalsule’s picture

subscribe

robbertbroersma’s picture

Suppressing errors, isn't that bad practice? I think the checking (exif_imagetype($ThisFileInfo['filenamepath']) !== false) is the correct way to prevent errors.

mmmahran’s picture

Hello,

I had the same error, I upload another pic and there is no error so I believe it is related but some image, so my advice is: "do not play with the code" just pick another photo.

cato’s picture

Why is this issue still unassigned?
Is this issue resolved in 6.x-1.4?
Should it be moved to 6.x-1.4 queue instead?

klonos’s picture

Version: 6.x-1.3 » 6.x-1.x-dev

...issues are fixed in latest dev versions - then a stable version is released including the fix(es).

ahimsauzi’s picture

Status: Closed (won't fix) » Active

It seems that this error comes up when the getid3 library is outdated.

Upgrading to the most current version of getid3 library (not the module) solve this issue for me.

Update: getid3 library used was 1.9.1 With getID3() module version 6.x-1.5

drewish’s picture

Status: Active » Closed (won't fix)

Based on #35 I'm closing this.

willow315’s picture

Status: Active » Closed (won't fix)

Well, I have just updated all modules, so my getid3 is NOT outdated, and I am having more of these errors than ever! So, I'd hate to see this closed, since it has never really been resolved. Please, this should not be closed!

lelizondo’s picture

Please post your versions and re-open if you think it's necessary .

azinck’s picture

@willow315: be sure you're updating the getID3 library, not the getID3 module.