Opened 10 years ago
Closed 6 years ago
#30138 closed defect (bug) (invalid)
Problem of getting the size (width and height) for .ico file
Reported by: | solidcolour | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.0 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
Trying to use wp_get_attachment_metadata() or wp_get_attachment_image_src() functions to get .ico image size, but it always returns wrong values.
wp_get_attachment_metadata() returns 0, 0 (width, height)
wp_get_attachment_image_src() returns 1, 1 (width, height)
And the Twenty Fourteen theme gets an error, when viewing the file (click View via Media Library).
Warning: Illegal string offset...
Notice: Uninitialized string offset...
Change History (3)
This ticket was mentioned in Slack in #core by jorbin. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
Thanks for the report solidcolour. The issue is that the underlying php function
getimagesize
only supports ico files in php 5.3.0.I think what core should do in this situation is:
1) check if IMAGETYPE_ICO is not defined
2) return false if it is not and we are presented with an ico file
3) add some documentation around this (and use it as further encouragement to get off 5.2)