Closed
Bug 682677
Opened 14 years ago
Closed 13 years ago
--with-system-png with libpng-1.5 is broken after Bug 600556 fixed
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: ojab, Assigned: glennrp+bmo)
References
Details
Attachments
(1 file, 8 obsolete files)
2.58 KB,
patch
|
joe
:
review+
|
Details | Diff | Splinter Review |
linux x86_64, gcc-4.6.1, libpng-1.5.4 (w/ apng patch).
In file included from /sources/mozilla-central/modules/libpr0n/src/RasterImage.cpp:61:0:
/sources/mozilla-central/modules/libpr0n/decoders/nsPNGDecoder.h: In member function ‘bool mozilla::imagelib::nsPNGDecoder::HasValidInfo() const’:
/sources/mozilla-central/modules/libpr0n/decoders/nsPNGDecoder.h:78:26: error: invalid use of incomplete type ‘png_info {aka struct png_info_def}’
/usr/include/libpng15/png.h:696:16: error: forward declaration of ‘png_info {aka struct png_info_def}’
/sources/mozilla-central/modules/libpr0n/decoders/nsPNGDecoder.h: In member function ‘PRInt32 mozilla::imagelib::nsPNGDecoder::GetPixelDepth() const’:
/sources/mozilla-central/modules/libpr0n/decoders/nsPNGDecoder.h:87:17: error: invalid use of incomplete type ‘png_info {aka struct png_info_def}’
/usr/include/libpng15/png.h:696:16: error: forward declaration of ‘png_info {aka struct png_info_def}’
make[7]: *** [RasterImage.o] Error 1
make[7]: Leaving directory `/home/ojab/opt/xulrunner/modules/libpr0n/src'
make[6]: *** [src_libs] Error 2
make[6]: Leaving directory `/home/ojab/opt/xulrunner/modules/libpr0n'
Don't know who should be reviewer for this.
Attachment #556537 -
Flags: review?
Updated•14 years ago
|
Attachment #556537 -
Flags: review? → review?(joe)
Updated•14 years ago
|
Assignee: nobody → ojab
Updated•14 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•14 years ago
|
||
Comment on attachment 556537 [details] [diff] [review]
Use png_get_* instead of direct access to png_info
Review of attachment 556537 [details] [diff] [review]:
-----------------------------------------------------------------
::: modules/libpr0n/decoders/nsPNGDecoder.h
@@ +72,4 @@
>
> void EndImageFrame();
>
> + // Check if PNG is valid ICO (32bpp RGBA)
Update this to say something more along the lines of "Check if this PNG can be used in an ICO (is 32 bpp RGBA)" and r=me.
Attachment #556537 -
Flags: review?(joe) → review+
Added link to MSDN blogs, just like in http://hg.mozilla.org/mozilla-central/rev/1f86f6af9434#l3.307 (should it be comments in both places?)
Also there is a function returning bool in original code, but PRBool in my patch. Which should be used?
Attachment #556537 -
Attachment is obsolete: true
Attachment #556742 -
Flags: review?(joe)
Comment 4•14 years ago
|
||
Comment on attachment 556742 [details] [diff] [review]
Updated patch
Review of attachment 556742 [details] [diff] [review]:
-----------------------------------------------------------------
::: modules/libpr0n/decoders/nsPNGDecoder.h
@@ +73,5 @@
> void EndImageFrame();
>
> + // Check if PNG is valid ICO (32bpp RGBA)
> + // http://blogs.msdn.com/b/oldnewthing/archive/2010/10/22/10079192.aspx
> + PRBool IsValidICO() const
bool's better.
Attachment #556742 -
Flags: review?(joe) → review+
Attachment #556742 -
Attachment is obsolete: true
Keywords: checkin-needed
Comment 6•14 years ago
|
||
In my queue :-)
Comment 7•14 years ago
|
||
Meant to say - to save time for future patches, could you set your hgrc to include the author automatically & also add a commit message, along the lines of:
http://blog.bonardo.net/2010/06/22/so-youre-about-to-use-checkin-needed
Thanks :-)
Comment 8•14 years ago
|
||
Failed try on multiple platforms:
http://tbpl.allizom.org/?tree=Try&usebuildbot=1&rev=1aa55d709d0d
{
In file included from /builds/slave/try-osx-dbg/build/modules/libpr0n/decoders/nsPNGDecoder.cpp:44:
/builds/slave/try-osx-dbg/build/modules/libpr0n/decoders/nsPNGDecoder.h: In member function 'bool mozilla::imagelib::nsPNGDecoder::IsValidICO() const':
/builds/slave/try-osx-dbg/build/modules/libpr0n/decoders/nsPNGDecoder.h:79: error: 'MOZ_PNG_get_color_type' was not declared in this scope
/builds/slave/try-osx-dbg/build/modules/libpr0n/decoders/nsPNGDecoder.h:80: error: 'MOZ_PNG_get_bit_depth' was not declared in this scope
/builds/slave/try-osx-dbg/build/modules/libpr0n/src/Decoder.h: In constructor 'mozilla::imagelib::Decoder::Decoder()':
/builds/slave/try-osx-dbg/build/modules/libpr0n/src/Decoder.h:217: warning: 'mozilla::imagelib::Decoder::mInFrame' will be initialized after
/builds/slave/try-osx-dbg/build/modules/libpr0n/src/Decoder.h:205: warning: 'bool mozilla::imagelib::Decoder::mDecodeDone'
/builds/slave/try-osx-dbg/build/modules/libpr0n/src/Decoder.cpp:47: warning: when initialized here
make[6]: *** [nsPNGDecoder.o] Error 1
}
After fixing, can you build locally/send to try (or ask me to) to confirm & adjust your hgrc (comment 7) before asking for checkin-needed. Thanks :-)
HG MQ just don't want to write my username in patch, `hg export` output with username in the attached file (now tested with both bundled & external libpng).
In this patch I've removed PNG_NO_EASY_ACCESS define from mozpngconf.h, (it was there from Bug 208607), should I request review again?
Attachment #557204 -
Attachment is obsolete: true
Comment 10•14 years ago
|
||
(In reply to ojab from comment #9)
> should I request review again?
Might be worth doing so, just in case :-)
Attachment #558454 -
Flags: review?(joe)
Assignee | ||
Comment 11•14 years ago
|
||
Undefining PNG_NO_EASY_ACCESS brings in about 400 lines of code in pngget.c.
It might be more efficient to use png_get_IHDR() to retrieve the bit-depth
and color-type.
Assignee | ||
Comment 12•14 years ago
|
||
Someone please run this through Try
Attachment #558454 -
Attachment is obsolete: true
Attachment #558454 -
Flags: review?(joe)
Comment 13•14 years ago
|
||
Was going to push to try but get parse error on qimport.
Perhaps check out the hgrc suggestions here?
http://blog.bonardo.net/2010/06/22/so-youre-about-to-use-checkin-needed
Comment 14•14 years ago
|
||
Joe, does this need review?
Assignee | ||
Comment 15•14 years ago
|
||
Parse error is because of a missing right parenthesis on the png_get_IHDR() call.
Assignee | ||
Comment 16•14 years ago
|
||
Attachment #558585 -
Attachment is obsolete: true
Comment 17•14 years ago
|
||
That's not the reason (the patch would have imported, it just would have failed try - so good that's found too :-) , you need to use mercurial diff instead.
Errors while parsing patch:
unknown patch content: "diff -u8p -r -N -x '.mozconfig*' -x configure src-central/modules/libpr0n/decoders/nsICODecoder.cpp src/modules/libpr0n/decoders/nsICODecoder.cpp\n"
ie: Instead of:
diff -u8p -r -N -x '.mozconfig*' -x configure src-central/modules/libpr0n/decoders/nsICODecoder.cpp src/modules/libpr0n/decoders/nsICODecoder.cpp
--- src-central/modules/libpr0n/decoders/nsICODecoder.cpp 2011-09-05 09:00:54.000000000 -0500
+++ src/modules/libpr0n/decoders/nsICODecoder.cpp 2011-09-06 13:08:58.000000000 -0500
the output should look like:
diff --git a/modules/libpr0n/decoders/nsICODecoder.cpp b/modules/libpr0n/decoders/nsICODecoder.cpp
--- a/modules/libpr0n/decoders/nsICODecoder.cpp
+++ b/modules/libpr0n/decoders/nsICODecoder.cpp
![]() |
||
Comment 18•14 years ago
|
||
I pushed this to Try https://tbpl.mozilla.org/?tree=Try&rev=9e3046874f19
Reporter | ||
Comment 20•13 years ago
|
||
ping?
Assignee | ||
Comment 21•13 years ago
|
||
The try report has a few red and orange entries but I don't know what they mean.
Comment 22•13 years ago
|
||
You can ignore those reds/oranges -- edmorley starred them all as known intermittent issues. (so, the patch here wasn't responsible for them)
Assignee | ||
Comment 23•13 years ago
|
||
Thanks. I have to redo the patch, though, because it doesn't conform to the
latest (mercurial) patch format and also decoders/nsICODecoder.cpp has been recently
relocated to the image directory.
Assignee | ||
Updated•13 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Assignee | ||
Comment 24•13 years ago
|
||
This should be run through "try" again.
Attachment #558683 -
Attachment is obsolete: true
Comment 25•13 years ago
|
||
Comment on attachment 568764 [details] [diff] [review]
v04: correct location (image/decoders)
Triggered a full Try run for this:
https://tbpl.mozilla.org/?tree=Try&rev=71a3c4b8649c
Also, RE the commit message:
>Bug 682677 - --with-system-png with libpng-1.5 is broken
Generally, m-c commit messages are supposed to summarize the change, rather than summarizing what was broken. Could you update that before this lands?
Assignee | ||
Comment 26•13 years ago
|
||
Attachment #568764 -
Attachment is obsolete: true
Assignee | ||
Comment 27•13 years ago
|
||
Comment on attachment 568838 [details] [diff] [review]
v05: Revised checkin message
Tryserver again shows a few failures that seem to be unrelated to this patch.
Attachment #568838 -
Flags: review?(joe)
Comment 28•13 years ago
|
||
Comment on attachment 568838 [details] [diff] [review]
v05: Revised checkin message
Review of attachment 568838 [details] [diff] [review]:
-----------------------------------------------------------------
Also make sure your checkin comment is on one line, even if it's way more than 80 characters.
::: image/decoders/nsPNGDecoder.h
@@ +84,5 @@
> + int png_bit_depth,
> + png_color_type;
> +
> + if (png_get_IHDR(mPNG, mInfo, &png_width, &png_height, &png_bit_depth,
> + &png_color_type, NULL, NULL, NULL))
Please indent this correctly. And, for good measure, can you add braces around the if and else bodies?
@@ +87,5 @@
> + if (png_get_IHDR(mPNG, mInfo, &png_width, &png_height, &png_bit_depth,
> + &png_color_type, NULL, NULL, NULL))
> +
> + return (png_color_type == PNG_COLOR_TYPE_RGB_ALPHA &&
> + png_bit_depth == 8);
Same here.
@@ +90,5 @@
> + return (png_color_type == PNG_COLOR_TYPE_RGB_ALPHA &&
> + png_bit_depth == 8);
> +
> + else
> + return PR_FALSE;
should be false now; we finally switched!
Attachment #568838 -
Flags: review?(joe) → review+
Assignee | ||
Comment 29•13 years ago
|
||
Assignee | ||
Comment 30•13 years ago
|
||
@joe, please transfer your review+ from v05 to v06 if it looks OK to you now.
Updated•13 years ago
|
Attachment #571851 -
Flags: review+
Updated•13 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•13 years ago
|
Attachment #568838 -
Attachment is obsolete: true
Comment 31•13 years ago
|
||
Keywords: checkin-needed
Target Milestone: --- → mozilla10
Comment 32•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•