Make WordPress Core

Opened 5 years ago

Last modified 3 years ago

#37311 reopened defect (bug)

Site icon thumbnails are lost if wp_generate_attachment_metadata called again later

Reported by: smerriman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.5
Component: Media Keywords: reporter-feedback
Focuses: Cc:


If image sizes are regenerated with the Regenerate Thumbnails plugin, the custom Site Icon sizes (and possibly other images in the customiser?) are lost.

The question is whether this is something that needs changing in the plugin, or whether the logic for how these sizes work should change in core. (Virtually all core documentation tells people to use this plugin when changing image sizes, so it should be fixed in one of the other).

I'm of the opinion it should be changed in core, where custom sizes like the ones created by Site Icons should be somehow marked as special sizes, with wp_generate_attachment_metadata checking for any existing custom sizes and including them in the output.

Change History (7)

#1 @Viper007Bond
5 years ago

OP also opened an issue on my side of things here: https://github.com/Viper007Bond/regenerate-thumbnails/issues/34

Probably on me to fix it, but it is an interesting situation.

#2 @ocean90
5 years ago

  • Version changed from trunk to 4.5

#3 @Viper007Bond
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I'll be handling this on my end by not regenerating any sizes being used for site icons. Going to close this here as wontfix as it's not really core's job to worry about this, rather the plugin that is calling wp_generate_attachment_metadata() should.

#4 @smerriman
3 years ago

Are you going to hard code in a special case for site icons, or will the logic be able to be applied to other sizes? For example, a theme I've built uses the same type of code to generate a special logo size; that also gets lost on regenerate. That's why I was thinking there needed to be some sort of flag stored with the image on core's side that the call to the function could ignore.

#5 follow-up: @joemcgill
3 years ago

  • Component changed from Customize to Media
  • Keywords reporter-feedback added
  • Resolution wontfix deleted
  • Status changed from closed to reopened

I'm not opposed to including a fix in Core for this, if one makes sense. Can we also confirm whether this behavior is reproducible when doing thumbnail regeneration via WP-CLI?

#6 in reply to: ↑ 5 @mikeschroder
3 years ago

Replying to joemcgill:

I'm not opposed to including a fix in Core for this, if one makes sense.


#7 @SergeyBiryukov
3 years ago

  • Milestone set to Awaiting Review
Note: See TracTickets for help on using tickets.