Closed Bug 134106 Opened 22 years ago Closed 22 years ago

Uppercase (IMAGE) Content-Type causes Netscape to fail decoding an image attachment

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: trix, Assigned: Biesinger)

References

Details

(Keywords: dataloss, regression)

Attachments

(3 files, 2 obsolete files)

Description:
Netscape6.x does not decode an image attachment if the Content-Type is
uppercase, ie., "IMAGE/gif"

REPRODUCIBLE: 
Always

STEPS:
1. Send a message containing a GIF image attachment to yourself.
2. Save that message to your desktop and name it "message.eml"
3. With a text editor. open MESSAGE.EML and change the Content-Type from
"image/gif" to "IMAGE/gif".
4. Save the new message as "message_new.eml"
5. Compose a new message to yourself and attach MESSAGE_NEW.EML and send it.
6. Now select that message from your Inbox.

RESULTS:
The GIF attachment is no longer displayed inline or as an image in the
attachment box.(FYI: if you attach the original message MESSAGE.EML and send to
yourself, you'll see that the image is displayed in the attachment window and
inline as well).

NOTES:
Email clients like PINE capitalize most encoding descriptions like Content-Type.
Thus Netscape fails to decode image attachments sent from clients that encode
attachments using an uppercase description. 

This problem seems to be isolated to the IMAGE Content-type only.  Verified that
application/ or text/ when capitalized are still able to be decoded properly.
Also, the file extension "GIF" or "gif" does not cause the problem either.

ATTACHED:
Attached to this bug are 2 email messages, MESSAGE.EML was the original email
message which shows the problem, and MESSAGE_NEW.EML is the same message but the
IMAGE Content-Type has been changed to lowercase. 

If you attach the original MESSAGE.EML to a message and send to yourself, you'll
notice that 2 image files are not decoded and displayed.  If you attach the
revised email MESSAGE_NEW.EML to a message and send, you'll notice that the 2
image files are now displayed and properly decoded.
Attached file wrong file don't use (obsolete) —
Attached file wrong file don't use (obsolete) —
nominating to nsbeta1
Keywords: nsbeta1
Attachment #76682 - Attachment is obsolete: true
Attachment #76683 - Attachment is obsolete: true
Attachment #76682 - Attachment mime type: text/plain → application/octet-stream
Attachment #76682 - Attachment description: Original message with "IMAGE" Content-Type in uppercase → wrong file don't use
Attachment #76683 - Attachment description: Revised email with "IMAGE" Content-Type in lowercase → wrong file don't use
Attachment #76683 - Attachment mime type: text/plain → application/octet-stream
I checked the mime code and it's not dependent on the capitalization of the
content-type. But mime ask the imageLoader if it support the content-type. My
guess is that the image loader expect a lowercase content-type!
Status: NEW → ASSIGNED
Keywords: dataloss
*** Bug 133941 has been marked as a duplicate of this bug. ***
this is a recent regression caused by fix for bug 104906. Christian, Pav, can we
make SupportImageWithMimeType not case sensitive whit the content type?
Keywords: regression
nsCAutoString 
  decoderId(NS_LITERAL_CSTRING("@mozilla.org/image/decoder;2?type=") +
            nsDependentCString(aMimeType));

is going to need to change into

nsCAutoString mimeType(aMimeType);
ToLowerCase(mimeType);
nsCAutoString 
  decoderId(NS_LITERAL_CSTRING("@mozilla.org/image/decoder;2?type=") +
            mimeType);

or something along those lines....
Attachment #76696 - Attachment mime type: text/plain → message/rfc822
Attachment #76693 - Attachment mime type: text/plain → message/rfc822
Attached patch patchSplinter Review
sorry, I forgot that I had to lowercase the name...
eh, of course, s/name/mimetype

pavlov, can you review this patch?
it fixes a regression
reassign to cbiesinger@web.de
Assignee: ducarroz → cbiesinger
Status: ASSIGNED → NEW
taking, and changing component to browser/imagelib where it belongs
Status: NEW → ASSIGNED
Component: Attachments → ImageLib
Priority: -- → P1
Product: MailNews → Browser
Target Milestone: --- → mozilla1.0
Comment on attachment 76736 [details] [diff] [review]
patch

r=pavlov
Attachment #76736 - Flags: review+
Comment on attachment 76736 [details] [diff] [review]
patch

sr=tor
Attachment #76736 - Flags: superreview+
Could it be related to bug #131618 ?
not related to bug 131618. the image type there is already lowercase.
furthermore it didn't work in NS 4.x either.
Comment on attachment 76736 [details] [diff] [review]
patch

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #76736 - Flags: approval+
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
verified on trunk build 2002042512-trunk & branch build 2002042508-1.0.0
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: