Closed
Bug 160975
Opened 22 years ago
Closed 22 years ago
Mozilla not decoding 31x39 .ICO file correctly
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
People
(Reporter: foss, Assigned: foss)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
Biesinger
:
review+
tor
:
superreview+
|
Details | Diff | Splinter Review |
The icon file attached to bug 160840 does not display correctly - there is a 1px
skew per line (it is displayed correctly in IE6 and MS Windows Explorer if you
want a proper look at it).
*** Note that viewing it will crash the browser until the fix for patch 151154
is checked in or added to your tree ***
Assignee | ||
Comment 1•22 years ago
|
||
Seeking review.
This patch works on the .ico file previously mentioned, and seems to be OK for
other sites (but I've only browsed a few). Is there a set of test .ico files
to try? It seems like there isn't a test set in the source tree.
Updated•22 years ago
|
Assignee | ||
Comment 2•22 years ago
|
||
Requesting review (cbiesinger@web.de, I believe you can r= ?)
Assignee: pavlov → arunan_bala
Comment 3•22 years ago
|
||
hm, does SetAlphaData require the same fix?
Assignee | ||
Comment 4•22 years ago
|
||
I don't know if it requires it in this particular case, but it could be needed
generally as the bug was in assuming the decoder and frame used the same buffer
size. I think the safest assumption is that both provide a buffer of at least
the minimum required size.
I've knocked up a second go at the patch, but for some reason it doesn't seem to
be linking (I'm getting no compile warnings but the debugger is stepping the old
code on the original lines).
I'll attach what I have as something has come up and I'm going to be away for a
few days. Sorry, this happened after I asked for review - I would have waited
if I'd known. At least you can see the approach I'm taking.
Assignee | ||
Comment 5•22 years ago
|
||
Original skew correction + factors out calculation of alpha buffer row size to
allow different alpha buffer sizes in decoder and frame.
Assignee | ||
Comment 6•22 years ago
|
||
Are there any test cases for this? I don't know where to get/make .ico files
with funky alpha data. Any idea which programs under W2K or Linux I could use?
Comment 7•22 years ago
|
||
*** Bug 166179 has been marked as a duplicate of this bug. ***
Comment 8•22 years ago
|
||
Comment on attachment 97445 [details] [diff] [review]
Patch v2
ok... I had another look at this now...
You should probably use bpr as the second argument in SetImageData. (and
SetAlphaData. that's what the BMP Decoder does as well).
Now, I don't think this is any different for the Alpha Data. So don't need the
rowCopyLen variable there and can use bpr as well.
And maybe you should not use an offset and add it to the pointer every time,
but instead get a pointer and increase that in every iteration.
Assignee | ||
Comment 9•22 years ago
|
||
I think SetImageData should not use bpr since that refers to the row size in the
frame buffer - using decodedLineLen means you are always copying exactly one row
of data, nothing more and nothing less. If bpr != decodedLineLen then you will
copy image data from following rows.
I will put back the alpha data part if you like, but it seems that the decoder
is then making the assumption that the frame implementation allocates data as
the decoder does. Since they don't share that code, even if that assumption is
true now (which I think it is, I have not checked) it may not be in the future.
The bit I wrote would survive such a change.
I'll agree about the pointer though :)
I still have no .ico files with alpha data to test this patch though.
Comment 10•22 years ago
|
||
hmmm. you are right that data from other rows will be copied. however, that data
would be ignored anyway.
thinking about it, using bpr would cause an ABR at the last line (if
bpr>decodedLineLen).
so your patch is probably fine, if you address the pointer issue.
Assignee | ||
Comment 11•22 years ago
|
||
Attachment #94466 -
Attachment is obsolete: true
Attachment #97445 -
Attachment is obsolete: true
Assignee | ||
Comment 12•22 years ago
|
||
I am very confused. Patch v3 seems to build and new objects/dlls get created,
but when I step the code I am seeing the symbols from v2? I have tried make
from the top level and from lower directories, but nothing seems to help.
Comment 13•22 years ago
|
||
Comment on attachment 98467 [details] [diff] [review]
Patch v3
+inline PRUint32 nsICODecoder::CalcAlphaRowSize()
that won't work, actually. you need to put that into the .h file. I would
actually put that into the class definition. I'm really sorry for not noticing
that earlier...
if you do that, you get r=biesi, provided you get sr=tor
Assignee | ||
Comment 14•22 years ago
|
||
> that won't work, actually. you need to put that into the .h file. I would
> actually put that into the class definition.
At the bottom of patch v3, the .h file has:
+ PRUint32 CalcAlphaRowSize();
Do you mean that it should be declared inline in the .h file? The other
inine functions such as SetAlphaData are declared as inline in the .cpp file
and without inline in the .h file.
Comment 15•22 years ago
|
||
> Do you mean that it should be declared inline in the .h file?
yes.
>The other
>inine functions such as SetAlphaData are declared as inline in the .cpp file
>and without inline in the .h file.
really? that should probably be fixed as well, though not for this bug (unless
you want to do that here)
Assignee | ||
Comment 16•22 years ago
|
||
Attachment #98467 -
Attachment is obsolete: true
Assignee | ||
Comment 17•22 years ago
|
||
Thanks for the reviews. I've determined that something in my build environment
is definitely odd, as the img*.dll files from the component subdirectory are not
being rebuilt (they were before patch so I see the symbols from v2). The
compile does fail if I add nonsense to the source file, so it's valid source at
least. Therefore, I have not been able to even see the effect of later patches.
Could somebody compile this in and check it for me please, as I can't do so
myself :(
Comment 18•22 years ago
|
||
patch compiles & works for me.
Comment 19•22 years ago
|
||
ok sorry but that was not what I meant :) I meant that the functions themselves
should also be moved into the .h file rather than the .cpp.
Assignee | ||
Comment 20•22 years ago
|
||
Guess who's got his "C" head on still. I did tell myself I wouldn't commit
sillies when contributing. So much for that :) This still compiles, still not
producing dlls for me.
Attachment #98602 -
Attachment is obsolete: true
Comment 21•22 years ago
|
||
Comment on attachment 98618 [details] [diff] [review]
Try again
we're getting there :)
you still need the "inline" in the class definition
and there's no need to remove this comment:
-// ----------------------------------------
-// Actual Data Processing
-// ----------------------------------------
but, you have r=biesi now and need not attach a new patch for these changes.
now you just need to get tor to sr :)
Attachment #98618 -
Flags: review+
Assignee | ||
Comment 22•22 years ago
|
||
That comment seemed to apply to the helper functions more, and it looked odd
sitting on top of the constructor.
Why does the declaration in the class need to have "inline"? My Stroustrup (3rd
ed) has something similar in section 10.2.9 (In-Class Function Definitions)
which I referenced in a vain attempt to get version 5 right. That has a
prototype "day" declared without it, and the definition following the class with
it. There appears to be nothing in the Mozilla portability guide about it.
I'm not asking to be smart, just so that I get it right on the first go next time.
Comment 23•22 years ago
|
||
>Why does the declaration in the class need to have "inline"?
ok... I talked to scc now on irc who knows this stuff better than I :) and he
said that you don't need the inline in the class declaration (if you do use the
inline when implementing the function).
however... I would still prefer it if the inline was there in the class
declaration. it makes it clearer that the functions are inline.
Assignee | ||
Comment 24•22 years ago
|
||
OK, that makes sense.
Do you still want the comment put back?
And thanks for your patience :)
Comment 25•22 years ago
|
||
yes I still want it back :)
but as I said, no need to attach a new patch.
Comment 26•22 years ago
|
||
hm actually some of the function could and should be shared between the bmp and
ico decoder. I'll do that in a separate, yet to be filed, bug.
Comment 27•22 years ago
|
||
Comment on attachment 98618 [details] [diff] [review]
Try again
Leave the SetPixel* functions in the .h, but move the others back to the .cpp
file (they're not called enough to make a difference).
Comment 28•22 years ago
|
||
(when moving them back, remove the "inline " part)
Assignee | ||
Comment 29•22 years ago
|
||
Attachment #98618 -
Attachment is obsolete: true
Comment 30•22 years ago
|
||
Comment on attachment 98933 [details] [diff] [review]
Patch v6
looks great
r=biesi
Attachment #98933 -
Flags: review+
Comment 31•22 years ago
|
||
Comment on attachment 98933 [details] [diff] [review]
Patch v6
sr=tor
Attachment #98933 -
Flags: superreview+
Comment 32•22 years ago
|
||
ok, now you should just ask pavlov@netscape.com if the patch is ok with him
(he's module owner and asked to be shown patches which will be checked in)
(don't ask him via bugmail)
Assignee | ||
Comment 33•22 years ago
|
||
Just noting that I sent pavlov an email a few hours after the last comment was
posted.
Comment 34•22 years ago
|
||
Comment on attachment 98933 [details] [diff] [review]
Patch v6
r=pavlov
Comment 35•22 years ago
|
||
arunan: (btw, in case you'll create more bmp/ico/mng patches, stuart just said
that mailing him for them is not necessary)
do you have CVS access? if not, I can check this in in the next days.
Assignee | ||
Comment 36•22 years ago
|
||
I have no CVS access so please go ahead and check-in, increasing my total of
accepted moz patches to:
2
Assignee | ||
Comment 37•22 years ago
|
||
And to cap off all my retardedness in this bug, it appears I should not have
opened it as it seems to be a DUPE of bug 116778 :)
I mean well.
Comment 38•22 years ago
|
||
*** Bug 116778 has been marked as a duplicate of this bug. ***
Comment 39•22 years ago
|
||
ah well, such things happen :)
I'll check this in tomorrow, as the tree is closed right now.
Keywords: review
Comment 40•22 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•