[wp-trac] [WordPress Trac] #34532: Responsive images: calculate the image baseurl from the original image `src`.

WordPress Trac noreply at wordpress.org
Sun Nov 1 00:35:46 UTC 2015


#34532: Responsive images: calculate the image baseurl from the original image
`src`.
--------------------------+--------------------
 Reporter:  azaozz        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.4
Component:  Media         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+--------------------

Comment (by azaozz):

 In 34532.patch:
 - Remove _wp_upload_dir_baseurl(), it was not compatible with multisite
 switch_to_blog().
 - Require the full image URL to be passed to wp_calculate_image_srcset().
 - Use that URL for all images in srcset.

 This patch tests if the image file name from the original URL matches the
 "base" (no extension) file name from image meta. This is a stricter test
 but wondering if it could fail in some cases (fail would mean no srcset).
 On the other hand that makes the check for edited file redundant.

 We can relax that to only look for the last `/` when calculating the
 image's URL, but a failure there will be more severe. It might output
 invalid URLs resulting in missing images.

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


More information about the wp-trac mailing list