[wp-trac] [WordPress Trac] #23398: Media Gallery - Clicking "Restore Original Image" in "Scale Image" pane loses 'Thumbnail Settings' pane.

WordPress Trac noreply at wordpress.org
Sat Mar 2 17:51:59 UTC 2013


#23398: Media Gallery - Clicking "Restore Original Image" in "Scale Image" pane
loses 'Thumbnail Settings' pane.
------------------------------------------------+------------------
 Reporter:  gr33nman                            |       Owner:
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  3.6
Component:  Media                               |     Version:  3.4
 Severity:  normal                              |  Resolution:
 Keywords:  has-patch 2nd-opinion dev-feedback  |
------------------------------------------------+------------------
Changes (by mboynes):

 * cc: mboynes (added)
 * keywords:  needs-patch => has-patch 2nd-opinion dev-feedback


Comment:

 I added a patch that resolves this, however I'm uncertain of any potential
 repercussions.

 The issue here is that wp_restore_image is only setting meta for image
 sizes that ''have been edited'' (and thus have an entry in the
 `_wp_attachment_backup_sizes` postmeta for the image). For instance, if
 you crop the image and apply to all image sizes, then go through the steps
 to reproduce this error, you won't replicate it. If you only scale the
 image, the only image size you edit is the original, therefore the only
 ''backup'' meta data is for the original and `wp_restore_image` unsets the
 other sizes in `_wp_attachment_metadata`.

 As far as I can tell, unsetting the non-edited sizes is unnecessary. I
 cannot think of a use-case scenario where this would need to be done.

 This patch will only fix this issue for images that are scaled after
 applying the patch. Images scaled prior to applying the patch will need to
 have their other image sizes regenerated via a plugin like
 [http://wordpress.org/extend/plugins/regenerate-thumbnails/ Regenerate
 Thumbnails].

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23398#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list