2.12 XnView: PNG resize

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, helmut, xnview

unkhum
Posts: 11
Joined: Tue Nov 26, 2013 6:54 pm

Re: 2.12 XnView: PNG resize

Post by unkhum »

xnview wrote:and you click on OK?
Of course :)
User avatar
xnview
Author of XnView
Posts: 43441
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 2.12 XnView: PNG resize

Post by xnview »

If you don't resize it, same problem?
Pierre.
unkhum
Posts: 11
Joined: Tue Nov 26, 2013 6:54 pm

Re: 2.12 XnView: PNG resize

Post by unkhum »

xnview wrote:If you don't resize it, same problem?
Yes, same problem :(
User avatar
CreativeWorld
Posts: 139
Joined: Fri Dec 30, 2011 7:08 pm

Re: 2.12 XnView: PNG resize

Post by CreativeWorld »

XnView versions after 2.05 are unable to (re)save some (?) PNGs, just creates an empty output file and exits without any messages (silently crashes?).
Sample file: http://i58.fastpic.ru/big/2013/1206/fe/ ... 40fffe.png
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: 2.12 XnView: PNG resize

Post by XnTriq »

What the two files have in common is the embedded ICC profile. Perhaps that's the problem.
TweakPNG ([url=http://5.firepic.org/5/images/2013-11/28/m96yxdgsf6j8.png]m96yxdgsf6j8.png[/url]) wrote:

Code: Select all

Chunk | Length | CRC      | Attributes                | Contents
------+--------+----------+---------------------------+-------------------------------------------------------------------------
IHDR  |     13 | 931ad457 | critical                  | PNG image header: 451×700, 8 bits/sample, truecolor+alpha, noninterlaced
iCCP  |   2627 | 80392511 | ancillary, unsafe to copy | embedded ICC profile: [ICC profile]
tEXt  |     25 | 71c9653c | ancillary, safe to copy   | text, key=“Software”: “Adobe ImageReady”
iTXt  |    803 | 4cb53fb2 | ancillary, safe to copy   | text (international), key=“XML:com.adobe.xmp” (nonstandard): “<?xpacket ”

IDAT  | 252130 | 586bdf78 | critical                  | PNG image data
IEND  |      0 | ae426082 | critical                  | end-of-image marker
TweakPNG ([url=http://i58.fastpic.ru/big/2013/1206/fe/0689d9200169fe5b9a4332ede940fffe.png]0689d9200169fe5b9a4332ede940fffe.png[/url]) wrote:

Code: Select all

Chunk | Length | CRC      | Attributes                | Contents
------+--------+----------+---------------------------+------------------------------------------------------------------
IHDR  |     13 | cfae3238 | critical                  | PNG image header: 780×1133, 8 bits/pixel, paletted, noninterlaced
iCCP  |   2607 | 9419497d | ancillary, unsafe to copy | embedded ICC profile: [ICC profile]
PLTE  |    768 | f0a1c2a8 | critical                  | palette, 256 entries
pHYs  |      9 | 63e68ec3 | ancillary, safe to copy   | pixel size = 5039×5039 pixels per meter (128.0×128.0 dpi)
IDAT  |   8192 | 0c179dee | critical                  | PNG image data
IDAT  |   8192 | 13dafafa | critical                  | PNG image data
IDAT  |   5572 | 34f493fc | critical                  | PNG image data
IEND  |      0 | ae426082 | critical                  | end-of-image marker
User avatar
xnview
Author of XnView
Posts: 43441
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 2.12 XnView: PNG resize

Post by xnview »

CreativeWorld wrote:XnView versions after 2.05 are unable to (re)save some (?) PNGs, just creates an empty output file and exits without any messages (silently crashes?).
Sample file: http://i58.fastpic.ru/big/2013/1206/fe/ ... 40fffe.png
Ok, i confirm here, a crash :(
New libpng seems to not like this color profile...
Pierre.
unkhum
Posts: 11
Joined: Tue Nov 26, 2013 6:54 pm

Re: 2.12 XnView: PNG resize

Post by unkhum »

XnTriq wrote:Both files have an embedded ICC profile. Perhaps that's the problem.
It was no problem in early versions :?
User avatar
xnview
Author of XnView
Posts: 43441
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 2.12 XnView: PNG resize

Post by xnview »

unkhum wrote:
XnTriq wrote:Both files have an embedded ICC profile. Perhaps that's the problem.
It was no problem in early versions :?
I've changed the libpng version, this color profile is no more supported, so to save this png, uncheck 'keep icc profile'
Pierre.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: 2.12 XnView: PNG resize

Post by XnTriq »

Just in case someone's interested:
RagnarZero/CanvasMMO ([url=https://github.com/RagnarZero/CanvasMMO/issues/6#issuecomment-19207448]gm segfault with char.png[/url]) wrote:While importing into gimp, the following warnings are shown:

Code: Select all

libpng warning: iCCP: known incorrect sRGB profile
lcms: skipping conversion because profiles seem to be equal:
 sRGB IEC61966-2.1
 sRGB built-in
libpng error: known incorrect sRGB profile
and it's not possible to export the image again.

identify char.png shows the same error

Code: Select all

char.png PNG 24x24 24x24+0+0 8-bit sRGB 3.42KB 0.000u 0:00.019
identify: iCCP: known incorrect sRGB profile `char.png' @ warning/png.c/MagickPNGWarningHandler/1830.
Sounds like the image has a some problems with its color-profile?
PyMOL Molecular Graphics System ([url=http://www.sourceforge.net/p/pymol/bugs/136/]data/pymol/splash.png has known incorrect sRGB profile[/url]) wrote:If pymol svn is built against libpng 1.6.3, the following warning is emitted to stderr when pymol is run...

OpenGL quad-buffer stereo 3D detected and enabled.
libpng warning: iCCP: known incorrect sRGB profile

This issue is due to data/pymol/splash.png having a sRGB profile of...

sRGB IEC61966-2.1
sRGB IEC61966-2.1

Copyright (c) 1998 Hewlett-Packard Company

WhitePoint : D65 (daylight)

as seen in the Color Profile tab of the Image Properties dialog in gimp 2.6. This issue can be fixed by selecting the "Assign Color Profile..." menu item from the Mode submenu in the Image menu in gimp and assigning the RGB workspace (sRGB built-in) color profile followed by saving the file. With this profile, the warnings from libpng 1.6.3 disappear.
Enlightenment window manager ([url=http://git.enlightenment.org/core/enlightenment.git/commit/?id=f6527c70d63844850e442da0b44689fcaf52d128]fix png's with icc profile oddness[/url]) wrote:I'm sure some of you have seen the warnings generated by libpng 1.6: "known incorrect sRGB profile". Now, this is no big deal, it's just a warning, but I still wanted to look into it further. By my count, there are 800 png files in Enlightenment, of which only 6 have embedded iCC profiles, all from HP. The rest are sRGB colorspace, but do not include a profile. There are some good arguments for this (http://imageoptim.com/color-profiles.html http://www.gballard.net/psd/save_for_we ... ofile.html) and since this seems to be the default, I've attached the 6 files with the profiles stripped out. As you can see, it doesn't change the image or the colorspace, it just leaves the calibration up to the end user's system.

I haven't been able to find just what's wrong with the HP iCC profile being used that the authors of libpng don't like, but it makes sense to standardize the way profiles are handled anyway. And it has the nice side effect of silencing warnings, even if the Debian/Ubuntu users aren't likely to see them for a couple of years.

I can just change the iCC profile instead if you would prefer. I've seen multiple people recommend the Argyll sRGB profile, which is still "sRGB IEC61966-2.1" and is public domain.
Hewlett-Packard's sRGB IEC61966-2.1 is the color profile libpng v1.6 doesn't like:
TweakPNG wrote:

Code: Select all

― Header ―
Profile size: 3144
Preferred CMM type: “Lino”
Profile version: 2.1.0
Profile/device class: “mntr”
Data color space: “RGB ”
Profile connection space: “XYZ ”
Profile creation time: 1998-02-09 06:49:00 UTC
Profile file signature: “acsp”
Primary platform: “MSFT”
Embedded profile flag: 0
Dependent profile flag: 0
Device manufacturer: “IEC ”
Device model: “sRGB”
Attributes: Reflective, Glossy, Positive, Color
Rendering intent: 0 (Perceptual) /  1 (Media-Relative Colorimetric)
Illuminant: X=0.96420, Y=1.00000, Z=0.82491
Profile creator: “HP  ”
Profile ID: 00000000000000000000000000000000

― Tags ―
Number of tags: 17
Tag #1 signature=“cprt” offset=336 size=51 type=“text”
	“Copyright (c) 1998 Hewlett-Packard Company”
Tag #2 signature=“desc” offset=388 size=108 type=“desc”
	“sRGB IEC61966-2.1”
Tag #3 signature=“wtpt” offset=496 size=20 type=“XYZ ”
	X=0.95045, Y=1.00000, Z=1.08905
Tag #4 signature=“bkpt” offset=516 size=20 type=“XYZ ”
	X=0.00000, Y=0.00000, Z=0.00000
Tag #5 signature=“rXYZ” offset=536 size=20 type=“XYZ ”
	X=0.43607, Y=0.22249, Z=0.01392
Tag #6 signature=“gXYZ” offset=556 size=20 type=“XYZ ”
	X=0.38515, Y=0.71687, Z=0.09708
Tag #7 signature=“bXYZ” offset=576 size=20 type=“XYZ ”
	X=0.14307, Y=0.06061, Z=0.71410
Tag #8 signature=“dmnd” offset=596 size=112 type=“desc”
	“IEC http://www.iec.ch”
Tag #9 signature=“dmdd” offset=708 size=136 type=“desc”
	“IEC 61966-2.1 Default RGB colour space - sRGB”
Tag #10 signature=“vued” offset=844 size=134 type=“desc”
	“Reference Viewing Condition in IEC61966-2.1”
Tag #11 signature=“view” offset=980 size=36 type=“view”
	illuminant: X=19.64450, Y=20.37180, Z=16.80890
	surround: X=3.92889, Y=4.07439, Z=3.36179
	illuminant type: 1 (D50)
Tag #12 signature=“lumi” offset=1016 size=20 type=“XYZ ”
	X=76.03647, Y=80.00000, Z=87.12462
Tag #13 signature=“meas” offset=1036 size=36 type=“meas”
	standard observer: 1 (1931 2 degree observer)
	measurement backing: X=0.00000, Y=0.00000, Z=0.00000
	measurement geometry: 0 (unknown)
	measurement flare: 65536 (1.0 (or 100%))
	illuminant type: 2 (D65)
Tag #14 signature=“tech” offset=1072 size=12 type=“sig ”
	43525420
Tag #15 signature=“rTRC” offset=1084 size=2060 type=“curv”
Tag #16 signature=“gTRC” offset=1084 size=2060 type=“curv”
Tag #17 signature=“bTRC” offset=1084 size=2060 type=“curv”
mozilla-central/media/libpng/png.c wrote:

Code: Select all

png_sRGB_checks[] =
{
   /* This data comes from contrib/tools/checksum-icc run on downloads of
    * all four ICC sRGB profiles from www.color.org.
    */
   /* adler32, crc32, MD5[4], intent, date, length, file-name */
   PNG_ICC_CHECKSUM(0x0a3fd9f6, 0x3b8772b9,
      PNG_MD5(0x29f83dde, 0xaff255ae, 0x7842fae4, 0xca83390d), 0, 0,
      "2009/03/27 21:36:31", 3048, "sRGB_IEC61966-2-1_black_scaled.icc")

   /* ICC sRGB v2 perceptual no black-compensation: */
   PNG_ICC_CHECKSUM(0x4909e5e1, 0x427ebb21,
      PNG_MD5(0xc95bd637, 0xe95d8a3b, 0x0df38f99, 0xc1320389), 1, 0,
      "2009/03/27 21:37:45", 3052, "sRGB_IEC61966-2-1_no_black_scaling.icc")

   PNG_ICC_CHECKSUM(0xfd2144a1, 0x306fd8ae,
      PNG_MD5(0xfc663378, 0x37e2886b, 0xfd72e983, 0x8228f1b8), 0, 0,
      "2009/08/10 17:28:01", 60988, "sRGB_v4_ICC_preference_displayclass.icc")

   /* ICC sRGB v4 perceptual */
   PNG_ICC_CHECKSUM(0x209c35d2, 0xbbef7812,
      PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0, 0,
      "2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc")

   /* The following profiles have no known MD5 checksum. If there is a match
    * on the (empty) MD5 the other fields are used to attempt a match and
    * a warning is produced.  The first two of these profiles have a 'cprt' tag
    * which suggests that they were also made by Hewlett Packard.
    */
   PNG_ICC_CHECKSUM(0xa054d762, 0x5d5129ce,
      PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 0,
      "2004/07/21 18:57:42", 3024, "sRGB_IEC61966-2-1_noBPC.icc")

   /* This is a 'mntr' (display) profile with a mediaWhitePointTag that does not
    * match the D50 PCS illuminant in the header (it is in fact the D65 values,
    * so the white point is recorded as the un-adapted value.)  The profiles
    * below only differ in one byte - the intent - and are basically the same as
    * the previous profile except for the mediaWhitePointTag error and a missing
    * chromaticAdaptationTag.
    */
   PNG_ICC_CHECKSUM(0xf784f3fb, 0x182ea552,
      PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 0, 1/*broken*/,
      "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 perceptual")

   PNG_ICC_CHECKSUM(0x0398f3fc, 0xf29e526d,
      PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 1/*broken*/,
      "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 media-relative")
};
Post Reply