Opened 13 years ago
Closed 13 years ago
#5397 closed defect (bug) (fixed)
exif_read_data() called for non-jpeg/tiff image files, resulting in error
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.5 | Priority: | high |
Severity: | major | Version: | 2.5 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description
exif_read_data(), added in #5162, only accepts JPEG and TIFF files but is being called for GIF and PNG as well.
When uploading a GIF file (ex: the Google logo) via the Write Post upload form, I'm getting the following error message:
Warning: exif_read_data(logo.gif) [function.exif-read-data]: File not supported in /var/www/trunk/wp-admin/includes/image.php on line 291
Attachments (2)
Change History (11)
#3
@
13 years ago
Suppressing errors is never sexy.
If I was going to make a patch, I would explicitly check for either GIF and TIFF and run that through a filter.
However, since I'm not going to make a patch to counter yours, then I think yours is sexy... enough.
#4
@
13 years ago
I agree that error suppressing is never sexy, So i'll attach another patch without it.
#5
@
13 years ago
Your first patch covered two areas or functions. Your second, while sexier, only covers one of the areas/functions. Is this intentional?
Line 273 - iptcparse() (not covered) Line 291 - exif_read_data() (covered)
Confirmed with a .bmp on PHP5.2.4 + Apache/win32
Given that the filetypes that the exif functions accept might change between installs/versions (i'm honestly not sure), I think the best method might to suppress the errors, That works fine here and allows the upload to go ahead as usual.