[wp-trac] [WordPress Trac] #22680: Check data.height and data.width before displaying dimensions
WordPress Trac
noreply at wordpress.org
Sun Dec 2 16:26:19 UTC 2012
#22680: Check data.height and data.width before displaying dimensions
-------------------+--------------------------
Reporter: nacin | Type: defect (bug)
Status: new | Priority: normal
Milestone: 3.5 | Component: Media
Version: trunk | Severity: normal
Keywords: |
-------------------+--------------------------
A .ico file has either `image/vnd.microsoft.icon` or `image/x-icon` as its
mime type. (Likely the latter due to wp_get_mime_types(), even though the
former is canonical.)
This means it thinks it is an image. But, it doesn't have stored
dimensions because in PHP we don't process icon files. That ends up with
an awkward, lonely '×' where the dimensions sit, and it looks like a
removal button if anything.
There might need to be other checks for icons, but I'm not really
concerned about those edge cases. Even wp_attachment_is_image() simply
let's `^/image/` pass, despite also checking the extension.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22680>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list