Opened 11 years ago
Closed 9 years ago
#31286 closed defect (bug) (invalid)
Unable to add or use new header images in themes in 4.1
| Reported by: |
|
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)
#3
@
11 years ago
Zero height is passed to imagecreatetruecolor() https://i.imgur.com/vpNgS4H.jpg
For me the cropping tool didn't appear.
#5
@
10 years ago
- Keywords reporter-feedback added
Can anyone still reproduce this issue, or find anything that might point to the cause?
I found a workaround that works only if the theme allows header randomization:
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.