Closed Bug 74733 Opened 23 years ago Closed 23 years ago

corrupted images when only width tag set

Categories

(Core :: Graphics: ImageLib, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: spam, Assigned: pavlov)

References

()

Details

(Whiteboard: [imglib])

Attachments

(1 file)

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.
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.
Whiteboard: [imglib]
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.
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
Closed: 23 years ago
Resolution: --- → FIXED
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.

Attachment

General

Creator:
Created:
Updated:
Size: