I have a PNG image with an embedded ICC profile produced by GhostScript from a PDF page. If you try to (re)save it, it will just get truncated with "Error writing the file" message.
I'm using latest 2.25, 2.22 had the same issue.
certain PNGs cannot be saved
Moderators: XnTriq, helmut, xnview
-
- Posts: 141
- Joined: Fri Dec 30, 2011 7:08 pm
certain PNGs cannot be saved
You do not have the required permissions to view the files attached to this post.
-
- Author of XnView
- Posts: 44451
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Moderator & Librarian
- Posts: 6366
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: certain PNGs cannot be saved
Steps to reproduce (v2.25):
EDIT: Works fine in v1.99.6
- Download the attached sample.png.
- Open it in XnView.
- Press Ctrl+S.
- Confirm the first message with Yes (“The file <X:\Test\sample.png> already exists ! Do you want to overwrite it ?”).
- Confirm the second message with OK (“Be careful, saving in this format will lose existing metadata!”).
- Confirm the third message with OK (“Warning: Error writing the file <X:\Test\sample.png>”).
EDIT: Works fine in v1.99.6
-
- Author of XnView
- Posts: 44451
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Moderator & Librarian
- Posts: 6366
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: certain PNGs cannot be saved
Here's the xnview.ini I use for my tests:xnview wrote:i can't reproduce
Code: Select all
[Cache]
IsActive=0
SavingMode=1
[Start]
ParamsSavingMode=1
SavingMode=1
TweakPNG ([color=green]default_rgb.icc[/color]) wrote:Code: Select all
Compressed size: 2341 Uncompressed size: 2576 ― Header ― Profile size: 2576 Preferred CMM type: “” Profile version: 2.1.0 Profile/device class: “mntr” Data color space: “RGB ” Profile connection space: “XYZ ” Profile creation time: 0-00-00 00:00:00 UTC Profile file signature: “acsp” Primary platform: “APPL” Embedded profile flag: 0 Dependent profile flag: 0 Device manufacturer: “” Device model: “” Attributes: Reflective, Glossy, Positive, Color Rendering intent: 0 (Perceptual) Illuminant: X=0.96419, Y=1.00000, Z=0.82489 Profile creator: “” Profile ID: 00000000000000000000000000000000 ― Tags ― Number of tags: 10 Tag #1 signature=“desc” offset=252 size=124 type=“desc” “Artifex Software sRGB ICC Profile” Tag #2 signature=“cprt” offset=376 size=40 type=“text” “Copyright Artifex Software 2011” Tag #3 signature=“wtpt” offset=416 size=20 type=“XYZ ” X=0.95045, Y=1.00000, Z=1.08905 Tag #4 signature=“bkpt” offset=436 size=20 type=“XYZ ” X=0.00000, Y=0.00000, Z=0.00000 Tag #5 signature=“rXYZ” offset=456 size=20 type=“XYZ ” X=0.43607, Y=0.22249, Z=0.01392 Tag #6 signature=“gXYZ” offset=476 size=20 type=“XYZ ” X=0.38515, Y=0.71687, Z=0.09708 Tag #7 signature=“bXYZ” offset=496 size=20 type=“XYZ ” X=0.14307, Y=0.06061, Z=0.71410 Tag #8 signature=“rTRC” offset=516 size=2060 type=“curv” Tag #9 signature=“gTRC” offset=516 size=2060 type=“curv” Tag #10 signature=“bTRC” offset=516 size=2060 type=“curv”
<--// EDIT //CreativeWorld ([url=http://newsgroup.xnview.com/viewtopic.php?p=115823#p115823]2.12 XnView: PNG resize[/url]) 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
XnView will resave sample.png without error, if Use ICC Embedded Profile (JPEG/TIFF) - Very slow (Tools » Options... » General » ICC) is activated.
// EDIT //-->
-
- Author of XnView
- Posts: 44451
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: certain PNGs cannot be saved
Right there is a problem with embedded icc profile of this png
Pierre.
-
- Posts: 127
- Joined: Thu Feb 10, 2011 1:52 pm
- Location: Hamburg
Re: certain PNGs cannot be saved
Brilliant tool, I planned to add this to the "other software" forum as a thank you for lots of interesting links (today I read something about JPEG ELA forensics), but obviously you know TweakPNG already. I could post two scripts for the TweakPNG "tools" feature, combining PNGwolf+TruePNG (if anybody uses that, maybe Dos386.)XnTriq wrote:TweakPNG
Good to know, as it happens I have that, together with an "sRGB intent saturation" default. Kudos.XnTriq wrote:XnView will resave sample.png without error, if Use ICC Embedded Profile (JPEG/TIFF) - Very slow (Tools » Options... » General » ICC) is activated.
-
- Moderator & Librarian
- Posts: 6366
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: certain PNGs cannot be saved
I'm glad to hear that you find the links useful, omniplex! (I assume you're referring to JohnFredC's topic about image quality.)omniplex wrote:Brilliant tool, I planned to add this to the "other software" forum as a thank you for lots of interesting links (today I read something about JPEG ELA forensics), but obviously you know TweakPNG already. I could post two scripts for the TweakPNG "tools" feature, combining PNGwolf+TruePNG (if anybody uses that, maybe Dos386.)XnTriq wrote:TweakPNG
TweakPNG has proven indispensable when it comes to solving PNG mysteries. There's lots of other cool stuff to explore on Jason Summers's site!
BTW: PngOptimizer discards the iCCP, pHYs as well as the tEXt chunks and combines all IDATs.omniplex wrote:Good to know, as it happens I have that, together with an "sRGB intent saturation" default. Kudos.XnTriq wrote:XnView will resave sample.png without error, if Use ICC Embedded Profile (JPEG/TIFF) - Very slow (Tools » Options... » General » ICC) is activated.
-
- Moderator & Librarian
- Posts: 6366
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: certain PNGs cannot be saved
Update: XnView v2.33 can resave sample.png. Trying to do so with m96yxdgsf6j8.png and 0689d9200169fe5b9a4332ede940fffe.png still results in an “error writing the file”.
See also: Error saving PNG
See also: Error saving PNG
-
- Posts: 127
- Joined: Thu Feb 10, 2011 1:52 pm
- Location: Hamburg
Re: certain PNGs cannot be saved
[...]XnTriq wrote:Trying to do so with m96yxdgsf6j8.png
2.35 can save this. The text chunks are gone (as promised), some 72 dpi pHYs chunk appears out of thin air, and the colour profile isn't identical (original: 2627 bytes, saved: 2520). Maybe libpng "upgrades" known colour profiles on the fly.still results in an “error writing the file”.
Unrelated, tweakpng is still at version 1.4.6, and I think its "import colour profile" feature is broken. But it can import complete colour profile chunks (exported from another PNG). Truepng.exe is at version 0.6.1.8, but I haven't tested yet if that fixes a truepng bug with odd PNG formats (IIRC 16bits grayscale didn't work for me with truepng 0.5.1.4.)