Closed Bug 414975 Opened 18 years ago Closed 1 year ago

black horizontal lines in JPEG image

Categories

(Core Graveyard :: GFX, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: Dolske, Unassigned)

References

()

Details

(Whiteboard: [fixed?])

Attachments

(2 files, 1 obsolete file)

If you click on the image in the URL, you'll get a 5.1MB 12756x3487 JPEG which takes quite a few seconds to load. Look at the result there are subtle black horizontal black lines throughout the image. In the attached screenshot, they're most visible in the lower 25% of the image, with one particularly strong line ~16 pixels from the bottom. But if you look carefully, there are such lines throughout the image. It's as if there are black lines in the unscaled image which become difficult to see due to the large scaling factor. But I think the JPEG itself is being successfully decoded, because these lines disappear after switching tabs, or even just dragging another app window over Firefox. Maybe a bug with the way images are painted with scaling, during a slow incremental load? I think I noticed this on some other image a week or so ago, but thought it might have been bug 413989. That's fixed in this build, so it's something else. I'm running a current nightly on OS X 10.5
Flags: blocking1.9?
Attached image Screenshot of problem
Hmm, bugzilla ate the attachment I added during filing.
Attachment #300509 - Attachment is patch: false
Attachment #300509 - Attachment mime type: text/plain → image/png
Don't see this on Vista on today's trunk - mac specific bug?
Assignee: nobody → vladimir
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Yep, mac specific. Has to do with image scaling/filtering. While the image is loading, we only invalidate the newly-loaded region of pixels -- and if the image is scaled, there seems to be a rounding bug where we don't invalidate the previous line's worth of pixels (probably something is doing round() instead of floor(), or maybe it needs to do floor()-1). Should be an easy fix.
Hrm, I was able to reproduce this earlier, but no longer -- dolske, do you still see this? It may have been inadvertently fixed with my CGImage stuff.
I don't see this now, either.
Attached patch fix, I think (obsolete) — Splinter Review
I believe this would be an acceptable fix -- make sure that we only render to integer rectangles while we have a partially decoded image. Note that I'm unable to reproduce the original problem, but with this the decoding always has a crisp bottom edge. roc, does this look acceptable? This munges things only while the image is still loading.
Attachment #302725 - Flags: review?(roc)
Wouldn't the real problem be with the rect we're invalidating, in this case?
Hm, I'll have to go back and look at the code.. if we do invalidate based on image completeness (and not just the entire image), then yeah, we should be rounding those rects. I'll check.
vlad says this should be fixed
Flags: tracking1.9+ → blocking1.9-
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Whiteboard: [fixed?]
Attachment #302725 - Attachment is obsolete: true
Attachment #302725 - Flags: review?(roc)
Product: Core → Core Graveyard
I'm seeing similar behaviour to this on Firefox 5 on OS X. The image seems to redraw correctly as soon as I mouse over the image or scroll the page.
Attached image Screenshot of problem
I'm having trouble reproducing it reliably. Slow internet and scaled images seem to work best, but it seems unreliable. Screenshot is of http://imgur.com/IrBOv
I can reliably reproduce with http://mcpherrin.ca/code/mozilla/jpeglines/bug.html on my 10.6.8 Mac. The image is scaled to about 20% of it's original size, and served via a deliberately slow CGI scrip. A screenshot: http://mcpherrin.ca/code/mozilla/jpeglines/bug.png
Repro'd on latest nightly.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Status: REOPENED → RESOLVED
Closed: 17 years ago1 year ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: