Jump to content
Ecc

Error: "Incorrect APP1 Exif Identifier Code" on upload (Wordpress, GD-Library)

Recommended Posts

If I upload an exported JPEG image created with Affinity Photo (1.5.2.69) to a WordPress site, it generates an error log entry.

 

The error message is: "Incorrect APP1 Exif Identifier Code"

 

I attached the image (image-crated-with-affinity-photo.jpg) to this post. I also added screen shots of my export settings.

 

It looks like the GD-Library (PHP) has problems with the Exif data in the exported images. I worked with Photoshop Elements and never had this kind of problem.

 

Here is WordPress' debug.log entry:

[30-Sep-2017 10:19:50 UTC] Array
(
    [type] => 2
    [message] => exif_read_data(image-crated-with-affinity-photo.jpg): Incorrect APP1 Exif Identifier Code
    [file] => \wp-admin\includes\image.php
    [line] => 430
)

 

image-crated-with-affinity-photo.jpg

export-settings-part1.jpg

export-settings-part2jpg.jpg

Share this post


Link to post
Share on other sites

Hi Ecc,

I've just tried this myself by installing Wampserver, setting up a database and user and then finally installing Wordpress 4.8.2. I then added a log viewer plugin. Once that was done, I tried adding both your image and another with lots of EXIF data into WordPress and didn't get any errors displaying in the log.

 

Have you tried exporting without the 'Embed metadata' option ticked?

Share this post


Link to post
Share on other sites

Hi Sean.

 

I still get the error on both DEV-Enviroment and LIVE-Enviroment servers.

 

Please add this to your wp-config.php

define( 'WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Wordpress now writes all logs entries to /wp-content/debug.log

 

My Server-Configurations:

 

DEV-Enviroment:
PHP: 7.0.9
GD Version: bundled (2.1.0 compatible)

Wordpress: 4.8.2

 

LIVE-Enviroment:
PHP: 7.0.23
GD Version: bundled (2.1.0 compatible)

Wordpress: 4.8.2

 

I just tested it again.

 

Looks the error is generated by this line: (/wp-admin/includes/image.php - Line 430)

 

$exif = @exif_read_data( $file );

 

The error output is:

 

[03-Oct-2017 11:20:09 UTC] Array
(
    [type] => 2
    [message] => exif_read_data(Untitled-1.jpg): Incorrect APP1 Exif Identifier Code
    [file] => /wp-admin/includes/image.php
    [line] => 430
)


 

Share this post


Link to post
Share on other sites

Thanks for the files,

I've switched to PHP 7.0.23 and am also running the same GD Version and Wordpress version and still unable to reproduce. I did have logging enabled as you mentioned in wp-config.php. But I'm not getting any output in that file (or when I use https://wordpress.org/plugins/log-viewer/ ).

Are you just using Media > Add new from the Main Dashboard or are you adding it from a different area within Wordpress? Have you tried it the default theme to see if that shows the error? Lastly have you tried exporting a completely clean file from Photoshop Elements and importing that, as well as opening the Affinity Export and re-exporting that?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×