screenshots icon indicating copy to clipboard operation
screenshots copied to clipboard

"Whoa! Firefox Screenshots went haywire..." error is displayed if the "Copy", "Download" or "Save" button is clicked for a screenshot selection that exceeds 32800 pixels

Open Softvision-CristinaBadescu opened this issue 7 years ago • 9 comments

[Affected versions]:

  • Nightly 59.0a1
  • Screenshots 25.0.0

[Affected Platforms]:

  • All Windows
  • All Mac
  • All Linux

[Steps to reproduce]:

  1. Open the browser with the profile from prerequisites and navigate to a very long page (eg. https://imgur.com)
  2. Perform a very long shot, that exceeds 32.800 pixels.
  3. Click on the "Copy", "Download" or "Save" button.

[Expected result]:

  • A friendly-user message is displayed to inform the user that the selection has a pixels limit. or
  • The selection is successfully copied, downloaded or saved.

[Actual result]:

  • "Whoa! Firefox Screenshots went haywire...?" system error notification is displayed.

[Notes]:

  • Here is a screenshot with the browser console error: browser console

  • Here is a screen recording of the issue: error 32800 pixels

The max size of a canvas is 32767 pixels on a side, so we could either show a warning (easy) or stitch multiple canvases together (hard, but could fix other bugs, like parallax background issues).

jaredhirsch avatar Nov 28 '17 23:11 jaredhirsch

Did we ever reach a decision on what to do here? We could, in addition to a warning, prevent a selection with a side greater than 32767 pixels. @johngruen ?

chenba avatar Mar 23 '18 21:03 chenba

Throwing this back into triage to discuss

jaredhirsch avatar May 08 '18 19:05 jaredhirsch

Let's prevent the selection box from being dragged past the limit

ghost avatar May 10 '18 15:05 ghost

There is an area limit of 472,907,776 pixels. That should be taken into account as well. And devicePixelRatio need to be factored into the calculations for HiDPI.

chenba avatar May 10 '18 15:05 chenba

This problem [also] occurs when selecting the entire page - so there's no dragging involved!

Also why is there a haywire error when I cancel a download?

djh42 avatar Sep 01 '18 01:09 djh42

@djh42 The issue with download cancellations will be fixed in the next Firefox release.

chenba avatar Sep 04 '18 14:09 chenba

Hi!

Any new about this bugfix or some solution in client side? (like set some value in about:config)

I try to take a full page screenshot on this page and get the same error: https://www.codemag.com/Article/1001061/S.O.L.I.D.-Software-Development-One-Step-at-a-Time

crash5 avatar Oct 28 '18 18:10 crash5

DISCLAIMER: Workaround only - not sure if this is without potential side effects, it works for me, I am not taking responsibility if it blows your microwave oven or kills your cat...

  1. Unzip firefox/browser/features/[email protected]
  2. Edit webextension/build/buildSettings.js:

You see:

pngToJpegCutoff: parseInt("" || 2500000, 10),
maxImageHeight: parseInt("" || 10000, 10),
maxImageWidth: parseInt("" || 10000, 10)

I changed to

pngToJpegCutoff: parseInt("" || 2500000, 10),
maxImageHeight: parseInt("" || 10000, 10),
maxImageWidth: parseInt("" || 10000, 10)
  1. If needed, alter the filename format under webextension/build/shot.js:get filename(), because the current settings sucks (especially because of getMonth)
  2. zip again (in the same directory as install.rdf, type:

zip -r ../[email protected] .

or an equivalent in your favorite OS.

replace the extension under firefox/browser/features/[email protected]

@mozilla-services: Please fix this properly by creating an UI. This is a great function, but the defaults are not optimal.

xmstspider avatar May 16 '19 13:05 xmstspider