[wp-trac] [WordPress Trac] #43540: srcset not added when the original image size doesn't exist in the database after regeneration

WordPress Trac noreply at wordpress.org
Wed Mar 14 02:54:12 UTC 2018


#43540: srcset not added when the original image size doesn't exist in the database
after regeneration
--------------------------+-----------------------------
 Reporter:  smerriman     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Suppose you have a post where you've inserted a 'large' image size. Any
 other image sizes of the same proportion are added to the srcset on the
 front end.

 Now, change the 'large' image size to something else, and regenerate
 thumbnails (using the plugin, CLI, etc).

 The image in the post continues to work (since plugins / CLI tend not to
 delete non-existing sizes from the file system precisely because they may
 be embedded in posts).

 However, it no longer receives any srcset - because the src_matched
 variable never gets set to true in `wp_calculate_image_srcset`.

 Can the src_matched logic be adjusted to cover this case?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43540>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list