[wp-trac] [WordPress Trac] #50543: Media: wp_image_src_get_dimensions() may throw warning or return wrong values

WordPress Trac noreply at wordpress.org
Sun Jul 5 23:30:50 UTC 2020


#50543: Media: wp_image_src_get_dimensions() may throw warning or return wrong
values
-------------------------------------+---------------------
 Reporter:  azaozz                   |       Owner:  azaozz
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  5.5
Component:  Media                    |     Version:  trunk
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------
Changes (by azaozz):

 * owner:  (none) => azaozz
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"48329" 48329]:
 {{{
 #!CommitTicketReference repository="" revision="48329"
 Media:
 - Introduce `wp_image_file_matches_image_meta()` utility function to check
 whether the image meta (retrieved by attachment ID) matches an image path
 or URI. A mismatch may happen in some cases, for example after the posts
 have been exported from one website and imported in another.
 - Add unit tests for the new function.
 - Improve `wp_image_src_get_dimensions()` a bit and use the new function
 to prevent these edge cases.

 Fixes #50543.
 }}}

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


More information about the wp-trac mailing list