Closed Bug 104906 Opened 24 years ago Closed 19 years ago

imgRequest::SniffMimeType and nsUnknownDecoder::SniffForImageMimeType should be one function

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.1alpha

People

(Reporter: Biesinger, Unassigned)

References

Details

Attachments

(1 file, 2 obsolete files)

nsUnknownDecoder::SniffForImageMimeType and imgRequest::SniffMimeType contain the same code - there should be only one function to avoid code duplication.
Target Milestone: --- → Future
accepting
Status: NEW → ASSIGNED
Target Milestone: Future → mozilla0.9.9
Attached patch Part 1Splinter Review
This patch adds some info to each decoder which is then pulled in and stored in imgLoader.. need to add accessors from there next.
Target Milestone: mozilla0.9.9 → mozilla1.1
Blocks: 97324
OK, I think we need to do this in addition to pavlov's patch: We need a new interface, say imgIDecoderManager, and a class to implement it, say with a contractid of @mozilla.org/image/decodermanager. It has two methods, namely: bool supportImageWithMimeType(in string mimeType); /* this would would be used by the places I patched in bug 41333 */ bool supportImageWithContents(in string contents /* or whatever is appropriate for char* */, integer length); Do we need more functions there? I don't think an enumerator is necessary...
oh yeah, to clarify: supportImageWithContents would do what's currently done by imgRequest::SniffMimeType and nsUnknownDecoder::SniffForImageMimeType.
just add the stuff to imgILoader since it is already a service
supportImageWithContents has one drawback -- it doesn't return the type. The uknown decoder doesn't care whether we can handle the image, it needs to know what the type is so it can set that type on the channel so that things further downstream will pick up the right type...
Oops, I forgot. Well, I'll just add |out nsAString contentType|, then.
My last comment wasn't quite correct. I changed the return type to string, so that the mime type is now returned. pavlov, please review.
Comment on attachment 74358 [details] [diff] [review] Patch for the interface I suggested r=pavlov
Attachment #74358 - Flags: review+
according to smfr, no mac build changes are needed; so it would be great if you could super-review, tor.
Comment on attachment 74358 [details] [diff] [review] Patch for the interface I suggested Remove image/x-bitmap check from imgLoader::SupportImageWithContents() (since we don't support it). That minor change and sr=tor.
Attachment #74358 - Flags: superreview+
Comment on attachment 74358 [details] [diff] [review] Patch for the interface I suggested a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #74358 - Flags: approval+
Has this landed yet?
arg, this patch no longer builds due to darin's checkin for bug 128508. I'll change the type of imgRequest::mContentType to nsXPIDLCString (+obvious changes in imgRequest::SniffMimeType) to fix this.
Attached patch un-bitrotted patch (obsolete) — Splinter Review
Attachment #74358 - Attachment is obsolete: true
Comment on attachment 75748 [details] [diff] [review] un-bitrotted patch Trivial changes from previous patch - copying over r/sr/a.
Attachment #75748 - Flags: superreview+
Attachment #75748 - Flags: review+
Attachment #75748 - Flags: approval+
Comment on attachment 75748 [details] [diff] [review] un-bitrotted patch checked in but leaving bug open for doing the content check in each decoder, like what pavlov's patch aims at.
Attachment #75748 - Attachment is obsolete: true
No longer blocks: 131230
This fix has caused regression 134106!!
No longer blocks: 97324
Assignee: pavlov → nobody
Status: ASSIGNED → NEW
QA Contact: tpreston → imagelib
marking fixed, that functionality has been added in bug 391667
Status: NEW → RESOLVED
Closed: 19 years ago
Depends on: 391667
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: