corrupted images when only width tag set

VERIFIED FIXED

Status

()

Core
ImageLib
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: R.K.Aa., Assigned: Stuart Parmenter)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [imglib], URL)

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
linux
been seeing this since the new imglib was checked in:

go to http://www.digitoday.no/dtno.nsf/wframe/allesaker
All images to the right in middle column are distorted.
Width-tag is set to 80. They have no heigth tag but with NC 4.* and old imglib
they could rely on the browser to calculate that proportionally.

What happens when the original image is wider than 80 is that the bottom of the
images become garbled. New imagelib seems to initially want to render the full
original heigth of the images, yet half-way realize it shouldnt. So the image
renders OK but with rubbish "ad quantum satis" - till "something" has been
painted below it till full height is achieved.

On a reload this in addition can cause the garbled bottom of one pic being
filled in with a ghost-image of what is really the top of the *next* image on page.

This bug may be related to bug 69454, but that one only gave a 1 pixel
distortion, while the new distortion can get pretty huge, depending on how tall
the image really is.
(Reporter)

Comment 1

17 years ago
actually.. this seems to work both ways, affecting images with width smaller
than 80 as well. In these cases the bottom of timage is cut instead.

Updated

17 years ago
Whiteboard: [imglib]
(Reporter)

Comment 2

17 years ago
Created attachment 29735 [details]
screenshot comparing Moz/NC4.76 [41k]
(Reporter)

Comment 3

17 years ago
umm.. looking at the comparision.. Almost looks like moz confuse width for
heigth when rendering starts. I guess this must be a dup of something.

Comment 4

17 years ago
Fix checked in (1.82 of nsImageGTK.cpp).  For the record:

Index: nsImageGTK.cpp
===================================================================
RCS file: /cvsroot/mozilla/gfx/src/gtk/nsImageGTK.cpp,v
retrieving revision 1.81
diff -u -r1.81 nsImageGTK.cpp
--- nsImageGTK.cpp      2001/03/31 00:50:30     1.81
+++ nsImageGTK.cpp      2001/04/05 02:35:59
@@ -434,7 +434,7 @@
   gdk_pixbuf_scale(tmpPb, newPb, 0, 0, aDWidth, aDHeight,
                    0, 0,
                    (double)aDWidth / (double)aSWidth,
-                   (double)aDWidth / (double)aSHeight,
+                   (double)aDHeight / (double)aSHeight,
                    GDK_INTERP_NEAREST);
 
   gdk_pixbuf_render_to_drawable(newPb,
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Reporter)

Comment 5

17 years ago
That was quick - and did the trick :)
Verified fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.