Closed Bug 1882925 Opened 2 months ago Closed 1 month ago

Random black vertical lines in screenshots copied from screenshot tool

Categories

(Firefox :: Screenshots, defect, P2)

Unspecified
All
defect

Tracking

()

VERIFIED FIXED
125 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox123 --- disabled
firefox124 --- disabled
firefox125 --- verified

People

(Reporter: cpeterson, Assigned: niklas)

References

(Regression)

Details

(Keywords: regression)

Attachments

(4 files)

Attached image screenshot.png

Steps to reproduce

  1. Set pref screenshots.browser.component.enabled = true and restart Firefox.
  2. Load https://www.example.com/
  3. Use Ctrl+Shift+S to take a screenshot of the page.
  4. Click the "Copy" screenshot button, NOT the "Download" button.
  5. Paste the copied screenshot somewhere, like a Google Doc or a Slack message.

Expected result

No extra lines in the screenshot.

Actual result

Intermittently, one or more random black vertical lines appears in the middle or right half of the image. See the attached screenshot.

I can reproduce in Firefox 123 and 125.0a1 on Windows 11. I wasn't able to reproduce in ESR 115.

This only seems to happen when copying the screenshot. Using the "Download" screenshot button will save a PNG file that does NOT have a random black line.

Setting pref screenshots.browser.component.enabled = false makes the lines go away.

(In reply to Chris Peterson [:cpeterson] from comment #0)

I can reproduce in Firefox 123 and 125.0a1 on Windows 11. I wasn't able to reproduce in ESR 115.

Niklas, I bisected this screenshot regression to the following pushlog, which points to your fix for bug 1854953:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=c09a0d19d99b488a292e3583cd0bb488afc74173&tochange=a5369079cd89dd91a42689da9aad1fc607ef9146

Flags: needinfo?(baumga91)
Keywords: regression
Regressed by: 1854953

Thanks for filing this bug!

How are you selecting a region to screenshot? Are you using the "save visible"/"save full page" buttons or are you drawing the region?
If the save visible/full page buttons, are you able to see the black lines in the preview image?
Or are you able to reproduce via both save visible/full page and via the region selector?

What operating system are you using? Also, what is your device pixel ratio?
I'm on Windows 11 and have taken about 10 screenshots trying to reproduce unsuccessfully.

If you took 10 screenshots, about how many would have the black lines?

Assignee: nobody → nbaumgardner
Severity: -- → S3
Status: NEW → ASSIGNED
Flags: needinfo?(baumga91) → needinfo?(cpeterson)
Priority: -- → P2

(In reply to Niklas Baumgardner [:niklas] from comment #2)

How are you selecting a region to screenshot? Are you using the "save visible"/"save full page" buttons or are you drawing the region?

I can reproduce with "save visible", "save full page", or drawing a region.

If the save visible/full page buttons, are you able to see the black lines in the preview image?

No. I don't see the black lines in the preview, only in the copied image.

Or are you able to reproduce via both save visible/full page and via the region selector?

What operating system are you using? Also, what is your device pixel ratio?

Windows 11

How do I determine my device pixel ratio? In my Windows Display settings, my external monitor's "Scale" is set to "150% (Recommended)" and my laptop's internal display is set to "250% (Recommended)".

I'm on Windows 11 and have taken about 10 screenshots trying to reproduce unsuccessfully.

If you took 10 screenshots, about how many would have the black lines?

10 out of 10. I thought the bug was intermittent before, but I think the bug happens reliably if the screenshot is wide enough, regardless of its height. For example, I was unable to reproduce on my laptop's internal display with scale "150% (Recommended)", but I was able to reproduce after when I changed scale to "250%".

Flags: needinfo?(cpeterson)

How do I determine my device pixel ratio? In my Windows Display settings, my external monitor's "Scale" is set to "150% (Recommended)" and my laptop's internal display is set to "250% (Recommended)".

With a Firefox window in the display to check, open the browser console and type/paste in window.devicePixelRatio. That will give the current displays device pixel ratio.

Thanks for all the information!

I can reproduce on my MacBook Air, but only if I increase the display scaling from "Default" (1470x956) to "More Space" (1710x1112). My MacBook Air's window.devicePixelRatio is 2.608695652173913, regardless of the display scaling mode.

I'll check my Windows laptop's displays' device pixel ratio tomorrow.

OS: Unspecified → All

I'm also experiencing a similar issue. I'm not sure if it has the same cause, as I can't reproduce it using the steps from the Description or from Comment 5.

The steps I follow are:

  1. Zoom out until reaching 30%.
  2. Enable Screenshots and click on 'Save visible' or 'Save full page'.
  3. Copy or Download.
    Actual results: Grid lines, as shown in the attachment, are present in the preview and in the resulting screenshots.

(In reply to Chris Peterson [:cpeterson] from comment #5)

I can reproduce on my MacBook Air, but only if I increase the display scaling from "Default" (1470x956) to "More Space" (1710x1112). My MacBook Air's window.devicePixelRatio is 2.608695652173913, regardless of the display scaling mode.

I'll check my Windows laptop's displays' device pixel ratio tomorrow.

My Windows laptop's external monitor's window.devicePixelRatio is 2.2222222222222223.

My Windows laptop's display's window.devicePixelRatio is 2.727272727272727 (but that is when its display scaling is "150% (Recommended)" and the lines are not visibly apparent).

Attachment #9389701 - Attachment description: Bug 1882925 - Overlap snapshots to prevent lines from showing in screenshots. r=mconley → Bug 1882925 - Floor coordinates before drawing to canvas in screenshots. r=mconley
Pushed by nbaumgardner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/549c1a139afc
Floor coordinates before drawing to canvas in screenshots. r=mconley
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch

The patch landed in nightly and beta is affected.
:niklas, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox124 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(nbaumgardner)

Hello! I can confirm that this issue is fixed with firefox 125.0a1(2024-03-08) on Windows 11, Ubuntu 22.04 and MacOS 12.6. I will update the flags and leave the status of this issue as it is until an answer to the previous comment is provided.

Have a nice day!

Flags: needinfo?(nbaumgardner)

Hello! As per the last comment I will change the status of this issue to VERIFIED -> FIXED

Status: RESOLVED → VERIFIED
Regressions: 1884936
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: