Closed Bug 17076 Opened 25 years ago Closed 25 years ago

misnamed local image file causes load to fail

Categories

(Core :: Graphics: ImageLib, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: kipp, Assigned: pnunn)

References

Details

Attachments

(2 files)

If you take a jpeg file, and name it "foo.gif" and try to load it using an image
tag from a file: document, the load doesn't work and the throbber spins forever.

I've attached two files: a testcase, and a test image. Make sure you leave the
name of the image wrong to see what I saw.
Great minds think alike; see bug #17064.
Status: NEW → ASSIGNED
Target Milestone: M12
yep. I just changed the code so that the decoder is
associated with the mimetype with is associated with
the file extension. If the file extension is unknown and
we don't have a decoder for it, we check the data stream
to see if we can recognize it from our short, fixed list.

But if the person who named the image gives it the wrong
extension, and that decoder can't make sense of it, we give up.

This design will allow users to add their own decoders very easily.
When I get a breather I can look at adding some smarts to each decoder
to verify the data stream and give it up if it can't make sense of it.
And then the data stream would go to the mime sniffing function.
-pn
*** Bug 17064 has been marked as a duplicate of this bug. ***
I reworked the mime sniffer code and I have a fix for this.
Will check in as soon as I test all platforms, and get code review.
-pn
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
fix checked in.
Instead of checking the data stream for a mime type after
failing to load a component, the imglib now does it before
the component loading. If there is a discrepancy between the
user supplied mime type and A Recognized Mime type (gif, jpg, jfif, jpeg,
png) we believe the data stream.

-pn
Blocks: 17907
OS: Linux → All
Hardware: PC → All
Changing Platform to 'All'.
Verified fixed on:
	- Mac OS (1999110913)
	- Win32 (1999110911)

Will formally mark as verified after checking Linux.
Status: RESOLVED → VERIFIED
Checked Linux (1999110808). Verified fixed.
No longer blocks: 17907
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: