Make WordPress Core

Opened 13 years ago

Closed 10 years ago

#27757 closed defect (bug) (duplicate)

Headers in Customizer - different thumbnail size

Reported by: pavelevap Owned by:
Priority: low Milestone:
Component: Customize Version: 3.9
Severity: normal Keywords:
Cc: Focuses:

Description

Please see attached screenshot.

After changing header image in Customizer, height 69px is applied.

But when you come back to Customizer (reload), Current header thumbnail has height only 40px.

Attachments (1)

Headers_Customizer_different_size.jpg​ (13.6 KB ) - added by pavelevap 13 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
13 years ago

  • Component General → Appearance

#2 @nofearinc
13 years ago

  • Keywords 2nd-opinion added

I was unable to reproduce the issue, the 40px height is set every time. Which theme are you testing against and are there any active plugins?

#3 @pavelevap
13 years ago

Twenty Eleven, no plugins, Chrome.

Steps to reproduce:
1) Go to Customizer, select any of default header images from 2011.
2) Save and publish changes. Everything is OK, selected header image has height 69px.
3) Go away, for example to Dashboard.
4) Go to Customizer and you will see that Current header image is crippled and has only 40px height.

#4 @ocean90
13 years ago

  • Keywords 2nd-opinion removed
  • Priority normal → low

Confirmed with the steps from pavelevap. 40px is applied via style="height: 40px;" to .container. Thumbnail has the same size, the container allows only 40px.

The issue is getHeight(): trunk/src/wp-includes/js/customize-views.js#L33

setPlaceholder() is called 3 times:
When called for the first time in getHeight() the result of this.$el.find('img') is empty and falls back to 40px, this value is stored as a model attribute in savedHeight.
The second call is the same as the first one. (No idea why.)
On the third call this.$el.find('img') has found the image, but image.height() returns 0 and so it falls back to the savedHeight attribute, which is 40px.

Last edited 13 years ago by ocean90 (previous) (diff)

#5 @kuliraj
12 years ago

I did managed to reproduce with the steps given above ( v4.2.2 ). It's "working" with img.addEventListener('load', loadHandler), although it is not a good workaround.

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


10 years ago

#7 @westonruter
10 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Duplicate of #38559.

Note: See TracTickets for help on using tickets.