Page 1 of 1
2.39: Error opening png file
Posted: Sat Nov 26, 2016 12:32 am
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.
Re: 2.39: Error opening png file
Posted: Sat Nov 26, 2016 3:45 am
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
- p136095.png (19.37 KiB) Viewed 1255 times
Re: 2.39: Error opening png file
Posted: Sun Nov 27, 2016 10:40 am
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.
Re: 2.39: Error opening png file
Posted: Sun Nov 27, 2016 12:00 pm
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
- p136130.png (13.13 KiB) Viewed 1223 times
Re: 2.39: Error opening png file
Posted: Sun Nov 27, 2016 1:36 pm
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.
Re: 2.39: Error opening png file
Posted: Sun Nov 27, 2016 8:39 pm
by Stepa_ua
Thank you! This file is really easy to fix by using Pngcrush or OptiPNG.