2.39: Error opening png file

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

Moderators: XnTriq, helmut, xnview

Post Reply
Stepa_ua
Posts: 2
Joined: Sat Nov 26, 2016 12:06 am

2.39: Error opening png file

Post by Stepa_ua »

I use Win7 x64. After the XnView updating to version 2.39 I have found out that it is impossible to open one of graphic files.

The error of reading is shown only on this file, other png files open without problems.
Attachments
SoftJig.png
SoftJig.png (13.25 KiB) Viewed 1120 times
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: 2.39: Error opening png file

Post by XnTriq »

Welcome to the forum, Stepa_ua.

I can confirm that XnView Classic v2.37 and v2.39 as well as MP v0.83 don't like SoftJig.png. I had no problem viewing it with v1.99 though, and TweakPNG gives it a clean bill of health.

Update:
Windows Picture and Fax Viewer
Windows Picture and Fax Viewer
p136095.png (19.37 KiB) Viewed 1109 times
User avatar
xnview
Author of XnView
Posts: 43442
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 2.39: Error opening png file

Post by xnview »

The error is 'IDAT: invalid distance too far back', from Libpng they recommand to use "contrib/tools/pngfix", "pngcrush" to fix such bad file.
Pierre.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: 2.39: Error opening png file

Post by XnTriq »

xnview wrote:The error is 'IDAT: invalid distance too far back', from Libpng they recommand to use "contrib/tools/pngfix", "pngcrush" to fix such bad file.
Thanks for the hint!

Code: Select all

pngcrush.exe X:\in\SoftJig.png X:\out\SoftJig.png

  Recompressing IDAT chunks in X:\in\SoftJig.png to X:\out\SoftJig.png
   Total length of data found in critical chunks            =     13573
While converting X:\in\SoftJig.png to X:\out\SoftJig.png:
  pngcrush caught libpng error:
   IDAT: invalid distance too far back

   Critical chunk length, method  12 (ws 15 fm 0 zl 0 zs 0) =        99

Code: Select all

pngcrush.exe -fix X:\in\SoftJig.png X:\out\SoftJig.png

  Recompressing IDAT chunks in X:\in\SoftJig.png to X:\out\SoftJig.png
   Total length of data found in critical chunks            =     13573
   Critical chunk length, method   1 (ws 15 fm 0 zl 4 zs 0) =     17795
   Critical chunk length, method   2 (ws 15 fm 1 zl 4 zs 0) >     17795
   Critical chunk length, method   3 (ws 15 fm 5 zl 4 zs 1) >     17795
   Critical chunk length, method   4 (ws 15 fm 0 zl 9 zs 1) =     13445
   Critical chunk length, method   7 (ws 15 fm 0 zl 9 zs 0) >     13445
   Best pngcrush method        =   4 (ws 15 fm 0 zl 9 zs 1) =     13445
     (0.94% critical chunk reduction)
     (0.94% filesize reduction)
Fixed version of SoftJig.png
Fixed version of SoftJig.png
p136130.png (13.13 KiB) Viewed 1077 times
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: 2.39: Error opening png file

Post by helmut »

xnview wrote:The error is 'IDAT: invalid distance too far back', from Libpng they recommand to use "contrib/tools/pngfix", "pngcrush" to fix such bad file.
Thank you for checking, Pierre. Perhaps XnView can display a more detailed error message which points to the problem.
Stepa_ua
Posts: 2
Joined: Sat Nov 26, 2016 12:06 am

Re: 2.39: Error opening png file

Post by Stepa_ua »

Thank you! This file is really easy to fix by using Pngcrush or OptiPNG.
Post Reply