Closed Bug 415273 Opened 18 years ago Closed 17 years ago

moz-icon failing to display correct icon with contentType parameter specified

Categories

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

x86
Windows Vista
defect

Tracking

()

RESOLVED FIXED
mozilla1.9

People

(Reporter: jimm, Assigned: jimm)

References

()

Details

Attachments

(3 files, 1 obsolete file)

Recently moz-icon urls that specify contentType as a parameter fail to display the correct icon for certain application file types. The icon displayed is the generic "white paper" icon instead. To reproduce, type - "moz-icon://somefile.zip?size=32&contentType=application/zip" in the address bar. Result: you should see the generic icon. Display is correct if you remove the contentType parameter - "moz-icon://somefile.zip?size=32" A found at least one other app that failed as well - moz-icon://somefile.ipa?size=32&contentType=application/x-itunes-ipa vs. moz-icon://somefile.ipa?size=32 which worked. This shows up most notably in the content handler dialog and in the app picker dialog when users click on a link to a zip file. A little debugging - the icon file is opened successfully in both cases within nsIconCahnnel - http://lxr.mozilla.org/mozilla/source/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp#273
Attached image example shot
Attached image working shot
Component: OS Integration → ImageLib
Product: Firefox → Core
QA Contact: os.integration → imagelib
Flags: blocking1.9?
This should be a pretty easy fix.
Flags: blocking1.9? → blocking1.9+
Priority: -- → P3
Flags: wanted-next+
Flags: tracking1.9+
Flags: blocking1.9-
Jim: If you can put a patch together for this request approval
working it now...
Assignee: nobody → jmathies
Status: NEW → ASSIGNED
Attachment #310534 - Flags: review?(pavlov)
Comment on attachment 310534 [details] [diff] [review] nsIconChannel patch v.1 Nice. As a bonus, this will make it easier to convert the code to Unicode APIs. >+ mimeService->GetPrimaryExtension(contentType, fileExt, defFileExt); I wonder whether we're allowed to reuse the in string as the out string?
Attachment #310534 - Flags: review?(pavlov) → review+
Attachment #310534 - Flags: approval1.9?
> I wonder whether we're allowed to reuse the in string as the out string? Didn't seem to cause any problems when I was testing it.
Attachment #310534 - Flags: approval1.9b5?
Comment on attachment 310534 [details] [diff] [review] nsIconChannel patch v.1 Tests?
Attachment #310534 - Flags: approval1.9b5? → approval1.9b5-
(In reply to comment #7) > >+ mimeService->GetPrimaryExtension(contentType, fileExt, defFileExt); > I wonder whether we're allowed to reuse the in string as the out string? it's an implementation detail that it works - in this case, it will. relying on that is probably a bad idea, though, unless you're calling from within the implementation itself.
Jim - thoughts on comment 10?
I'll go ahead and roll together a new patch to address this. I've also been looking for ways to add tests as well but haven't come up with anything. The bug is related to application associations which obviously change from machine to machine. I was looking for a way to create an icon compare test but haven't found anything i'd consider reliable.
Attachment #310534 - Flags: approval1.9?
Attached patch nsIconChannel patch v.2 (obsolete) — Splinter Review
updated to force a string copy in GetPrimaryExtension.
Attachment #310534 - Attachment is obsolete: true
Attachment #312771 - Flags: review?(dwitte)
(In reply to comment #13) > updated to force a string copy in GetPrimaryExtension. Why?
Did I somehow misinterpret the concern that was raised? I thought the issue was with the in/out behavior of the extension string.
nsMIMEInfoBase::GetPrimaryExtension has no inout parameter... do you mean nsExternalHelperAppService::GetPrimaryExtension? (but I think that should be fixed in the caller)
Attachment #312771 - Flags: review?(dwitte)
(In reply to comment #15) > Did I somehow misinterpret the concern that was raised? I thought the issue was > with the in/out behavior of the extension string. I'm sorry if I confused you; I was wondering why you had used two different strings, and dwitte replied confirming that your patch v.1 was correct.
Ok, I guess I should have had a little more faith. The extension string passes into GetPrimaryExtension as fileExt, and then back out as defFileExt. It's shared so it's just the same string. I didn't see any problems with that but strings in mozilla are still a little hazy for me so I assumed I had screwed up due somehow. If everybody is cool with the first patch, I'll mark it as checkin-needed.
Attachment #312771 - Attachment is obsolete: true
Comment on attachment 310534 [details] [diff] [review] nsIconChannel patch v.1 actually... one more to go.
Attachment #310534 - Attachment is obsolete: false
Attachment #310534 - Flags: approval1.9?
Comment on attachment 310534 [details] [diff] [review] nsIconChannel patch v.1 a1.9=beltzner
Attachment #310534 - Flags: approval1.9? → approval1.9+
Keywords: qawantedcheckin-needed
Checking in modules/libpr0n/decoders/icon/win/nsIconChannel.cpp; /cvsroot/mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp,v <-- nsIconChannel.cpp new revision: 1.46; previous revision: 1.45 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9
cause bug 427978 ?
Depends on: 427978
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: