WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 4 months ago

#14979 new defect (bug)

custom background view shows cropped image and not original upload

Reported by: obvio Owned by:
Priority: normal Milestone: 3.6
Component: Appearance Version: 3.0.1
Severity: normal Keywords: dev-feedback has-patch needs-testing
Cc: mike@…, catalin.dogaru@…

Description

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 (3)

custom-background.png (205.3 KB) - added by cdog 4 months ago.
14979.diff (10.9 KB) - added by cdog 4 months ago.
14979.png (151.7 KB) - added by cdog 4 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 mbijon15 months ago

  • Cc mike@… added

comment:2 DrewAPicture5 months 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

cdog4 months ago

cdog4 months ago

cdog4 months ago

comment:3 cdog4 months 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 4 months ago by cdog (previous) (diff)
Note: See TracTickets for help on using tickets.