[wp-trac] [WordPress Trac] #28077: Use exif_imagetype instead of getimagesize in file_is_displayable_image

WordPress Trac noreply at wordpress.org
Wed Apr 30 19:48:53 UTC 2014


#28077: Use exif_imagetype instead of getimagesize in file_is_displayable_image
-------------------------+------------------------------
 Reporter:  joehoyle     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  3.9
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by jdgrimes):

 Also, I don't think we need the `@` when calling `exif_imagetype()`.
 `getimagesize()` can emit a warning on error, which is why it is being
 suppressed. But `exif_imagetype()` appears to only emit a notice, which
 will be silenced by WordPress unless `WP_DEBUG` is enabled, in which case
 it may prove useful to let it give a notice on failure. Thoughts?

 (I believe there are some places in core where error suppression is used
 only if `WP_DEBUG` is false, so maybe `getimagesize()` should be
 suppressed only conditionally here as well. ?)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28077#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list