[wp-trac] [WordPress Trac] #21457: Applying changes in image editor loses meta data for any additional image sizes
WordPress Trac
wp-trac at lists.automattic.com
Tue Aug 7 15:54:15 UTC 2012
#21457: Applying changes in image editor loses meta data for any additional image
sizes
--------------------------+------------------------------
Reporter: prettyboymp | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+------------------------------
Comment (by prettyboymp):
Reproduction steps:
1. add add_image_size('test-300x300', 300, 300, true); to functions.php in
theme
1. upload an new image through the media library
1. check the meta values for the uploaded image
{{{
//current meta for media
meta_id: 3508
post_id: 42756
meta_key: _wp_attachment_metadata
meta_value:
a:6:{s:5:"width";i:3072;s:6:"height";i:2304;s:14:"hwstring_small";s:23:"height='96'
width='128'";s:4:"file";s:20:"2012/08/IMG_0969.jpg";s:5:"sizes";a:5:{s:9:"thumbnail";a:3:{s:4:"file";s:20:"IMG_0969-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}s:6:"medium";a:3:{s:4:"file";s:20:"IMG_0969-300x225.jpg";s:5:"width";i:300;s:6:"height";i:225;}s:5:"large";a:3:{s:4:"file";s:21:"IMG_0969-1024x768.jpg";s:5:"width";i:1024;s:6:"height";i:768;}s:12
:"test-
300x300";a:3:{s:4:"file";s:20:"IMG_0969-300x300.jpg";s:5:"width";i:300;s:6:"height";i:300;}s:14
:"post-
thumbnail";a:3:{s:4:"file";s:20:"IMG_0969-624x468.jpg";s:5:"width";i:624;s:6:"height";i:468;}}s:10:"image_meta";a:10:{s:8:"aperture";d:2.7999999999999998;s:6:"credit";s:0:"";s:6:"camera";s:21:"Canon
PowerShot
SD750";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1333862434;s:9:"copyright";s:0:"";s:12:"focal_length";d:5.7999999999999998;s:3:"iso";s:3:"200";s:13:"shutter_speed";d:0.016666666666666666;s:5:"title";s:0:"";}}
}}}
4. click edit image and apply a crop
1. check the meta values for the image, note that the meta for the 'test-
300x300' image is missing for the current '_wp_attachment_metadata'
metakey
{{{
//new meta values for the image:
meta_id: 3508
post_id: 42756
meta_key: _wp_attachment_metadata
meta_value:
a:6:{s:5:"width";i:952;s:6:"height";i:960;s:14:"hwstring_small";s:22:"height='96'
width='95'";s:4:"file";s:35:"2012/08/IMG_0969-e1344353338375.jpg";s:5:"sizes";a:2:{s:9:"thumbnail";a:3:{s:4:"file";s:35:"IMG_0969-e1344353338375-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}s:6:"medium";a:3:{s:4:"file";s:35:"IMG_0969-e1344353338375-297x300.jpg";s:5:"width";i:297;s:6:"height";i:300;}}s:10:"image_meta";a:10:{s:8:"aperture";d:2.7999999999999998;s:6:"credit";s:0:"";s:6:"camera";s:21:"Canon
PowerShot
SD750";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1333862434;s:9:"copyright";s:0:"";s:12:"focal_length";d:5.7999999999999998;s:3:"iso";s:3:"200";s:13:"shutter_speed";d:0.016666666666666666;s:5:"title";s:0:"";}}
*************************** 3. row ***************************
meta_id: 3509
post_id: 42756
meta_key: _wp_attachment_backup_sizes
meta_value: a:6:{s:9:"full-
orig";a:3:{s:5:"width";i:3072;s:6:"height";i:2304;s:4:"file";s:12:"IMG_0969.jpg";}s:14
:"thumbnail-
orig";a:3:{s:4:"file";s:20:"IMG_0969-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}s:11
:"medium-
orig";a:3:{s:4:"file";s:20:"IMG_0969-300x225.jpg";s:5:"width";i:300;s:6:"height";i:225;}s:10
:"large-
orig";a:3:{s:4:"file";s:21:"IMG_0969-1024x768.jpg";s:5:"width";i:1024;s:6:"height";i:768;}s:17
:"test-
300x300-orig";a:3:{s:4:"file";s:20:"IMG_0969-300x300.jpg";s:5:"width";i:300;s:6:"height";i:300;}s:19
:"post-thumbnail-
orig";a:3:{s:4:"file";s:20:"IMG_0969-624x468.jpg";s:5:"width";i:624;s:6:"height";i:468;}}
}}}
At this point the full size image gets pulled in anywhere that thumbnail
size is used.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21457#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list