wp-calypso icon indicating copy to clipboard operation
wp-calypso copied to clipboard

Customizer: Can't crop header images.

Open JessBoctor opened this issue 4 years ago • 59 comments

Steps to reproduce the behavior

  1. Activate a theme that uses a custom header image:
  2. Go to My Site > Appearance > Customize > Header Image
  3. Click on Add new Image
  4. Select and image and then click on Select and crop

What I expected to happen

To be able to crop the image to the correct header size and then save it to the header

What actually happened

When you get to the next screen, there is no cropping selection. Dragging across the image to create a selected section results in Drop image. Clicking on Crop results in the error {file name} There has been an error cropping your image. if there is a Skip Cropping option and you select it, it does not update the header image

There is a video of my test site here: https://d.pr/v/0kpjbn

Context

Customer reported this in #29153016-HC

Browser / OS version

Mac OS 10.15 / Chrome 89

Customer was using Windows 10 with Chrome 83

Is this specific to the applied theme? Which one?

First reported on Dynamic news, but I have also tested Dara and Intergalactic and had the same issues

Does this happen on simple or atomic sites or both?

Simple. The cropping function works as expected on AT sites

Is there any console output or error text?

No

Level of impact (Does it block purchases? Does it affect more than just one site?)

It affects more than one site, but doesn't seem to prevent other editing of the site

Reproducibility (Consistent, Intermittent) Leave empty for consistent.

Screenshot / Video: If applicable, add screenshots to help explain your problem.

JessBoctor avatar Apr 21 '21 22:04 JessBoctor

Possible cases here: https://wordpress.com/forums/topic/i-cant-change-my-header-image-2/

And here: 3930683-zd-woothemes

supernovia avatar Apr 22 '21 20:04 supernovia

Noting I'm seeing an intermittent issue related to this, even when using the same thing. Possibly related to image size or format?

https://cloudup.com/cvPrt7xG2eH

supernovia avatar Apr 22 '21 20:04 supernovia

Another case here: https://wordpress.com/forums/topic/cropper-tool-not-working-correctly/

This user was able to crop by making the original image smaller first.

supernovia avatar Apr 22 '21 21:04 supernovia

Another here: https://wordpress.com/forums/topic/unable-to-crop-header-image-2/

Staff was having trouble replicating the issue on the site and we thought it might have something to do with the image size. @aleone89 thought it was because the image was portrait oriented so we might test that some more as well!

supernovia avatar Apr 22 '21 21:04 supernovia

One more here: https://wordpress.com/forums/topic/crop-header-function-not-working-in-twenty-ten/

We thought it was a retired theme issue, but now that we're seeing this in other themes as well we should report it here.

supernovia avatar Apr 22 '21 21:04 supernovia

The error message seems to be There has been an error cropping your image Screen Shot on 2021-04-27 at 10:36:37

I tried adding really big images (5120 by 2880 pixels) and also adding Pexel images specifically but I could not reproduce it.

mrfoxtalbot avatar Apr 27 '21 08:04 mrfoxtalbot

I've got another case of this in 29265927-hc. It's a simple site using the Dyad 2 theme. I tried removing the header image and adding a new one. The crop screen loads, but no cropping tools show up. When I click Crop and Save the same error is displayed:

Screenshot on 2021-04-27 at 13-29-35

sstabrizi avatar Apr 27 '21 19:04 sstabrizi

Another one in 29303036-hc. They had to resize the image to a landscape size.

Robertght avatar Apr 29 '21 12:04 Robertght

I had another user report this in #28772653-HC. I advised them to crop the images before uploading to quickly change out the header images.

JessBoctor avatar May 11 '21 17:05 JessBoctor

Another report 4027529-zen

Choosing the "Skip Cropping" image worked in this case.

mrfoxtalbot avatar May 30 '21 10:05 mrfoxtalbot

Another report in 4022360-zen

khristiansnyder avatar Jun 03 '21 18:06 khristiansnyder

Another report in 4059688-ZD

MaxPhilip avatar Jun 11 '21 08:06 MaxPhilip

Another report in 30157043-hc.

jp-imagines avatar Jun 15 '21 18:06 jp-imagines

30159555-hc Baskerville 2.

sajmes avatar Jun 15 '21 22:06 sajmes

@DanielSmithMichigan @andres-blanco can you look into this in our next sprint please (starting July 12)? ❤️

kwight avatar Jun 29 '21 22:06 kwight

another report in 29806696-hc

aamills avatar Jul 08 '21 22:07 aamills

4131258-zd

ahmadbaig1 avatar Jul 18 '21 17:07 ahmadbaig1

another report but only for Safari, in Chrome it is working: 31027667-HC

daria2303 avatar Aug 16 '21 14:08 daria2303

This is happening to me too, on pciE2j-p2. I'm using Chrome. The image is 3400 by 3270.

Oddly, it worked when I uploaded the image, but then I chose not to crop it. When I go through the flow add image -> media library, then it fails to show the cropping controls. I've even tried deleting and re-uploading, and that doesn't work now either.

After resizing the image, the cropping flow works again.

Edit: This tip from @obenland worked for me:

Press and hold the Control key (if using Windows) or Command key (if using Mac OS) and then press the minus key on your keyboard once and then release both. This zooms out your browser window and then suddenly the crop selection tool will appear

cometgrrl avatar Oct 07 '21 20:10 cometgrrl

Another case 4368408-zd-woothemes. I shared the workaround from here: https://github.com/Automattic/wp-calypso/issues/50126#issuecomment-850577893

zdenys avatar Oct 12 '21 09:10 zdenys

@kwight is this something the team is still looking into? If not, can we flag it for Flow Patrol?

Robertght avatar Oct 12 '21 10:10 Robertght

@Robertght Sure, go for it – this was from the now-complete Design Selection pod.

kwight avatar Oct 12 '21 20:10 kwight

Thanks! @yansern I've flagged this one together with https://github.com/Automattic/wp-calypso/issues/50126 as they seem they are similar.

Robertght avatar Oct 13 '21 05:10 Robertght

Investigation Note:

  1. This is replicable when the browser is Zoomed In (not 100%) before opening the cropping tool.
  2. As for themes with custom header, you can use Dara theme (or use feature:custom-header when searching for themes).
  3. The repository is core wordpress-develop.
  4. The file is wp-admin/includes/class-custom-image-header.php.
  5. The underlying issue lies in imgAreaSelect. This plugin is no longer maintained.
  6. It is up to us to fix wp-includes/js/imgareaselect/jquery.imgareaselect.js to make sure they render the cropper when browser is zoomed in.

Suspected that it has something to do with the aspect ratio of the image as well (other than just Zoomed browser).

yansern avatar Oct 13 '21 10:10 yansern

Another report in 4381029-zd-woothemes

Have asked them to check zoom levels.

katiebethbrown avatar Oct 20 '21 02:10 katiebethbrown

Trac ticket and fix are ready

https://core.trac.wordpress.org/ticket/54308#ticket https://github.com/WordPress/wordpress-develop/pull/1774

alshakero avatar Oct 22 '21 13:10 alshakero

Thank you @alshakero !

Robertght avatar Oct 23 '21 09:10 Robertght

Hello, does it someone succeeded to fix this issue?

I tested patch from alshakero but in my case do not work.

Issue still exists.

Matrixverse avatar Nov 08 '21 18:11 Matrixverse

Another report in 31340801-hc.

I explained how to set browser zoom back to 100% and that allowed them to crop the image without error.

katiebethbrown avatar Nov 09 '21 20:11 katiebethbrown

Another report in 19941435-hc

Adjusting zoom allowed them to crop successfully.

katiebethbrown avatar Nov 10 '21 02:11 katiebethbrown