[wp-trac] [WordPress Trac] #30211: WP_Image_Editor_Imagick::supports_mime_type return incorrect result for image/tiff
WordPress Trac
noreply at wordpress.org
Fri Oct 31 10:36:56 UTC 2014
#30211: WP_Image_Editor_Imagick::supports_mime_type return incorrect result for
image/tiff
--------------------------+-----------------------------
Reporter: mmems | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.0
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
I've got the case with TIFF files:
`wp_get_mime_types()` by default give for `image/tiff` these extensions:
`tif|tiff`
In `WP_Image_Editor::get_extension()` return only the first one: `tif`.
But in `WP_Image_Editor_Imagick::supports_mime_type()` the test fail
because ImageMacick support `TIFF` format (note the `FF`).
Solutions are:
- in `WP_Image_Editor_Imagick::supports_mime_type()` add `if( $mime_type
== 'image/tiff' ) $imagick_extension = 'TIFF';`
- in `WP_Image_Editor_Imagick::supports_mime_type()` add `if(
$imagick_extension == 'TIF' ) $imagick_extension = 'TIFF';`
- in `wp_get_mime_types()` change `'tif|tiff'` to `'tiff|tif'`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30211>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list