Make WordPress Core

Opened 9 years ago

Closed 7 years ago

#31286 closed defect (bug) (invalid)

Unable to add or use new header images in themes in 4.1

Reported by: ahamelers's profile ahamelers Owned by:
Milestone: Priority: normal
Severity: major Version: 4.1
Component: Customize Keywords: needs-patch needs-testing reporter-feedback
Focuses: template Cc:

Description

Now that the header image menu has been moved to the customize screen, I am unable to add new header images to any of my sites.

After uploading an image through the Header menu, then pressing "Select and crop", there is no way to select or crop the image. If one clicks to go forward without cropping, it does not seem that the image information is set and retrievable through

get_theme_mod('header_image_data')

At least, the image is not appearing as the header in my theme. All images uploaded before the upgrade are showing up fine. I have tried this in several themes.

Here are the errors from my logs. They seem to be errors in WP Core:

My site information replaced with [...]

[Tue Feb 10 11:13:34 2015] [error] PHP Warning:  imagecreatetruecolor(): Invalid image dimensions in /home/www/html/library/wp-includes/media.php on line 2043, referer: [...]/wp-admin/customize.php?theme=[..]
[Tue Feb 10 11:13:34 2015] [error] PHP Warning:  imageantialias() expects parameter 1 to be resource, boolean given in /home/www/html/library/wp-includes/class-wp-image-editor-gd.php on line 283, referer: [...]/wp-admin/customize.php?theme=[...]
[Tue Feb 10 11:13:34 2015] [error] PHP Warning:  imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/www/html/library/wp-includes/class-wp-image-editor-gd.php on line 285, referer: [...]/wp-admin/customize.php?theme=[...]
[Tue Feb 10 11:20:28 2015] [error] PHP Warning:  imagecreatetruecolor(): Invalid image dimensions in /home/www/html/library/wp-includes/media.php on line 2043, referer: [...]/wp-admin/customize.php?theme=[...]
[Tue Feb 10 11:20:28 2015] [error] PHP Warning:  imageantialias() expects parameter 1 to be resource, boolean given in /home/www/html/library/wp-includes/class-wp-image-editor-gd.php on line 283, referer: [...]/wp-admin/customize.php?theme=[...]
[Tue Feb 10 11:20:28 2015] [error] PHP Warning:  imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/www/html/library/wp-includes/class-wp-image-editor-gd.php on line 285, referer: [...]/wp-admin/customize.php?theme=[...]
[Tue Feb 10 14:20:34 2015] [error] PHP Warning:  imagecreatetruecolor(): Invalid image dimensions in /home/www/html/library/wp-includes/media.php on line 2043, referer: [...]/wp-admin/customize.php?return=%2Fdisc%2Fwp-admin%2Fthemes.php&autofocus[control]=header_image
[Tue Feb 10 14:20:34 2015] [error] PHP Warning:  imageantialias() expects parameter 1 to be resource, boolean given in /home/www/html/library/wp-includes/class-wp-image-editor-gd.php on line 283, referer: [...]/wp-admin/customize.php?return=%2Fdisc%2Fwp-admin%2Fthemes.php&autofocus[control]=header_image
[Tue Feb 10 14:20:34 2015] [error] PHP Warning:  imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/www/html/library/wp-includes/class-wp-image-editor-gd.php on line 285, referer: [...]/wp-admin/customize.php?return=%2Fdisc%2Fwp-admin%2Fthemes.php&autofocus[control]=header_image
[Tue Feb 10 14:32:58 2015] [error] PHP Warning:  imagecreatetruecolor(): Invalid image dimensions in /home/www/html/library/wp-includes/media.php on line 2043, referer: [...]/wp-admin/customize.php?return=%2Fdisc%2Fwp-admin%2F&autofocus[control]=header_image
[Tue Feb 10 14:32:58 2015] [error] PHP Warning:  imageantialias() expects parameter 1 to be resource, boolean given in /home/www/html/library/wp-includes/class-wp-image-editor-gd.php on line 283, referer: [...]/wp-admin/customize.php?return=%2Fdisc%2Fwp-admin%2F&autofocus[control]=header_image
[Tue Feb 10 14:32:58 2015] [error] PHP Warning:  imagecopyresampled() expects parameter 1 to be resource, boolean given in [..]/wp-includes/class-wp-image-editor-gd.php on line 285, referer: [..]/wp-admin/customize.php?return=%2Fdisc%2Fwp-admin%2F&autofocus[control]=header_image

Change History (7)

#1 @DrewAPicture
9 years ago

  • Component changed from General to Customize
  • Focuses template added

#2 @ahamelers
9 years ago

  • Keywords needs-patch needs-testing added
  • Severity changed from normal to major

I found a workaround that works only if the theme allows header randomization:

  1. Upload a header image that is the exact height, width, or both as required by the theme, so no cropping is necessary.
  1. Set header to "Randomize Uploaded Headers".

This finally allows the header to appear (if it's the only image uploaded as a header, it will work as if it's set to be the single header image). If the theme header option is not set to "Randomize Uploaded Headers", images uploaded as header images after the upgrade will not appear as the header when selected, while images that were uploaded as header images before the upgrade will appear just fine.

#3 @michalzuber
9 years ago

Zero height is passed to imagecreatetruecolor() https://i.imgur.com/vpNgS4H.jpg
For me the cropping tool didn't appear.

#5 @celloexpressions
8 years ago

  • Keywords reporter-feedback added

Can anyone still reproduce this issue, or find anything that might point to the cause?

This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.


7 years ago

#7 @westonruter
7 years ago

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

Cannot reproduce. Lacking reporter feedback.

Note: See TracTickets for help on using tickets.