WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#16106 new defect (bug)

Error reading EXIF data from uploaded image

Reported by: 4D4M Owned by:
Priority: normal Milestone: Awaiting Review
Component: Media Version: 3.0.4
Severity: normal Keywords: has-patch
Cc: wordpress@…

Description

When the user uploads an image file with EXIF data, that data is saved to the database. exif_read_data() reads the EXIF headers from a JPEG or TIFF image file. This way you can read meta data generated by digital cameras.

In this case the EXIF 'ISOSpeedRatings' key had an array for a value, but a string was expected. So the subsequent trim() call failed.

Patch attached.

Attachments (2)

image.diff (1.0 KB) - added by 4D4M 2 years ago.
Patch for Ticket #16106 - image.diff
16106.diff (856 bytes) - added by solarissmoke 2 years ago.
Accept EXIF isoSpeedRatings as either array or string

Download all attachments as: .zip

Change History (7)

4D4M2 years ago

Patch for Ticket #16106 - image.diff

comment:1 4D4M2 years ago

  • Cc wordpress@… added

comment:2 hakre2 years ago

Thanks for reporting the issue.

Version 0, edited 2 years ago by hakre (next)

comment:3 Otto422 years ago

Can we get an example image file that causes the problem?

comment:4 solarissmoke2 years ago

  • Keywords needs-patch added

Apparently some cameras do provide more than one ISO value (HI and LO). In any case I checked the ISO specification (http://www.exif.org/specifications.html) and multiple values are permitted for isoSpeedRatings:

ISOSpeedRatings
Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232. 
Tag  =      34855 (8827.H) 
Type  =      SHORT 
Count  =      Any **This means multiple values acceptable**
Default  =      none 

Think this could be done without defining a new function however.

solarissmoke2 years ago

Accept EXIF isoSpeedRatings as either array or string

comment:5 solarissmoke2 years ago

  • Keywords has-patch added; needs-patch removed
Note: See TracTickets for help on using tickets.