Closed
Bug 104906
Opened 23 years ago
Closed 17 years ago
imgRequest::SniffMimeType and nsUnknownDecoder::SniffForImageMimeType should be one function
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla1.1alpha
People
(Reporter: Biesinger, Unassigned)
References
Details
Attachments
(1 file, 2 obsolete files)
19.00 KB,
patch
|
Details | Diff | Splinter Review |
nsUnknownDecoder::SniffForImageMimeType and imgRequest::SniffMimeType contain the same code - there should be only one function to avoid code duplication.
Updated•23 years ago
|
Target Milestone: --- → Future
Comment 2•23 years ago
|
||
This patch adds some info to each decoder which is then pulled in and stored in imgLoader.. need to add accessors from there next.
Updated•23 years ago
|
Target Milestone: mozilla0.9.9 → mozilla1.1
Reporter | ||
Comment 3•22 years ago
|
||
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...
Reporter | ||
Comment 4•22 years ago
|
||
oh yeah, to clarify: supportImageWithContents would do what's currently done by imgRequest::SniffMimeType and nsUnknownDecoder::SniffForImageMimeType.
Comment 5•22 years ago
|
||
just add the stuff to imgILoader since it is already a service
Comment 6•22 years ago
|
||
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...
Reporter | ||
Comment 7•22 years ago
|
||
Oops, I forgot. Well, I'll just add |out nsAString contentType|, then.
Reporter | ||
Comment 8•22 years ago
|
||
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 9•22 years ago
|
||
Comment on attachment 74358 [details] [diff] [review] Patch for the interface I suggested r=pavlov
Attachment #74358 -
Flags: review+
Reporter | ||
Comment 10•22 years ago
|
||
according to smfr, no mac build changes are needed; so it would be great if you could super-review, tor.
Comment 11•22 years ago
|
||
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 12•22 years ago
|
||
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+
Comment 13•22 years ago
|
||
Has this landed yet?
Reporter | ||
Comment 14•22 years ago
|
||
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.
Reporter | ||
Comment 15•22 years ago
|
||
Attachment #74358 -
Attachment is obsolete: true
Comment 16•22 years ago
|
||
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+
Reporter | ||
Comment 17•22 years ago
|
||
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
Comment 18•22 years ago
|
||
This fix has caused regression 134106!!
Updated•17 years ago
|
Assignee: pavlov → nobody
Status: ASSIGNED → NEW
QA Contact: tpreston → imagelib
Reporter | ||
Comment 19•17 years ago
|
||
marking fixed, that functionality has been added in bug 391667
You need to log in
before you can comment on or make changes to this bug.
Description
•