[wp-trac] [WordPress Trac] #20657: Custom Header Image Cropping deletes header images

WordPress Trac wp-trac at lists.automattic.com
Fri May 11 10:12:53 UTC 2012


#20657: Custom Header Image Cropping deletes header images
--------------------------+-------------------------
 Reporter:  westi         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  high          |  Milestone:  3.4
Component:  General       |    Version:  3.4
 Severity:  blocker       |   Keywords:  needs-patch
--------------------------+-------------------------
 Step to reproduce the issue.
 1. Go to Appearance → Header when using Twenty Eleven
 2. Upload an image where one of the dimensions matches the suggested
 dimensions ( Mine was 1000 width x 649 height)
 3. Enlarge the cropping marker to cover the whole image (Because I don't
 want to crop it)
 4. Hit "Crop and Publish" button
 5. The header image appears in the Custom Header admin page as expected.
 6. The header image appears on the front-end also as expected BUT…. wait
 for a few minutes.
 7. Open an incognito window to check the front-end.
 8. Header image is missing :( It's missing in the media library also :(

 Looking at the file system I see the file uploaded fine - {{{header.jpg}}}
 and then it vanishes and I only have {{{header-462x300.jpg}}} and friends
 - no cropped-header.jpg and no original.

 The cause for this is the code in {{{Custom_Image_Header::step_3()}}} it
 doesn't check the return value from {{{wp_crop_image()}}} and just assumes
 that the image will be cropped.

 Later in the function we delete the original files and so we have no
 longer got the file that the "cropped" file attachment would have pointed
 at.

 Relates to the changes for #19840

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20657>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list