Make WordPress Core

Opened 4 years ago

Last modified 2 months ago

#14979 new enhancement

custom background view shows cropped image and not original upload

Reported by: obvio Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0.1
Component: Customize Keywords: has-patch needs-testing close
Focuses: Cc:


trying to upload a very tall image to the custom background area (for example 100*1100px width*height) works but the image that is then shown in the view-pane is the cropped/thumbnail version of the upload and not the original image the user added.

it is possible a site would have a repeat-x on a really tall image.

Attachments (5)

custom-background.png (205.3 KB) - added by cdog 2 years ago.
14979.diff (10.9 KB) - added by cdog 2 years ago.
14979.png (151.7 KB) - added by cdog 2 years ago.
14979.1.diff (11.0 KB) - added by cdog 20 months ago.
14979.2.diff (628 bytes) - added by cdog 18 months ago.

Download all attachments as: .zip

Change History (17)

comment:1 @mbijon3 years ago

  • Cc mike@… added

comment:2 @DrewAPicture2 years ago

  • Component changed from UI to Appearance
  • Keywords needs-patch dev-feedback added
  • Milestone changed from Awaiting Review to 3.6

I can reproduce this on current trunk. For example, this is the preview pane of an image sized 150x1000: http://cl.ly/image/32051X0f020S

@cdog2 years ago

@cdog2 years ago

@cdog2 years ago

comment:3 @cdog2 years ago

  • Cc catalin.dogaru@… added
  • Keywords has-patch needs-testing added; needs-patch removed

Agreed. Even this is the intended behavior I found it confusing. It would be better to display the original image instead of its thumbnail.

Also found that saving a custom background from the theme customizer produces unexpected output on the Custom Background screen.

Steps to reproduce:

  1. Upload a custom background from Appearance > Background and save. Everything looks as expected (attachment:custom-background.png, top).
  2. Open the theme customizer (Appearance > Themes > Customize), edit anything and save.
  3. Return to Appearance > Background. Now the original image is displayed instead of its thumbnail and the preview pane is very tall (attachment:custom-background.png, bottom).

This is caused by the update() callback from WP_Customize_Background_Image_Settings class which removes background_image_thumb theme mod.

attachment:14979.diff uses the original image instead of its thumbnail and sets the height of the preview pane properly when a custom background is set. Also adds control over the background size as shown in attachment:14979.png.

Last edited 2 years ago by cdog (previous) (diff)

comment:6 @ocean9021 months ago

  • Keywords 3.7-early added
  • Milestone changed from 3.6 to Future Release

comment:7 @wonderboymusic20 months ago

  • Milestone changed from Future Release to 3.7

these are all marked 3.7-early

@cdog20 months ago

comment:8 @cdog20 months ago

attachment:14979.1.diff updates the previous patch against current trunk (revision 25008).

comment:9 follow-up: @nacin18 months ago

  • Milestone changed from 3.7 to Future Release
  • Type changed from defect (bug) to enhancement

14979.1.diff is a lot. I'm having trouble figuring out what exactly the bug fix is, because that appears to also be a major enhancement. We need to approach the bug fix separately from the enhancement. The background thumbnail is merely for previewing. If it's causing a problem, we should fix that. I'm not entirely sure where the new settings are coming from. If there's a legitimate explanation, that's fine, but this has been classified as a bug when in reality it needed the review as an enhancement.

This also appears to only be a previewing issue (please correct me if I'm wrong), so I'm feeling pretty good about reclassifying this as an enhancement because that seems to be the focus so far.

comment:10 in reply to: ↑ 9 @cdog18 months ago

Saving a custom background from the theme customizer produces unexpected output on the Custom Background screen (please see comment:3). You are right, let's discuss the enhancements later and focus on the bug first.

@cdog18 months ago

comment:11 @dreamwhisper18 months ago

  • Cc dreamwhisper added

comment:12 @celloexpressions2 months ago

  • Keywords close added; dev-feedback 3.7-early removed

Now that backgrounds are essentially only manageable in the Customizer, this probably isn't an issue anymore?

Note: See TracTickets for help on using tickets.