Created attachment 108176 [details] test png image Hi, I've got a png file that could be opened in gwenview, GIMP and ImageMagick. But can't be viewed in Okular. My app had the same problem so I dig into gwenview sourcecode to find the solution and now would like to share my findings. As gwenview my app uses Qt's QImage/QImageReader to load this png file. And Qt uses libpng1.6.28-1 that prints in std::cout "libpng error: Read Error" in both cases. But gwenview ignores this error and still able to show image. Bcs instead of `void QImage::load(...)` or `QImage QImageReader::read()` it invokes `bool QImageReader::read(QImage *)`. And it ignores its result value if returned QImage is valid. This allowed me to workaround problem in my app. Gwenviews code: The log error [here](https://github.com/KDE/gwenview/blob/1259680d9295bf4d36f481d9a2002639738ff00d/lib/document/loadingdocumentimpl.cpp#L317) but as loadImageData() is a void function and mImage still contains valid image the app displays it as usual. My assumption is that png has incomplete or incorrect set of flags in header so libpng reports error while still loads image data to RAM. A test png is attached. I was told that this was a tiff file (result of scanning) that was converted to png with acdsee v3.1 under Win.
Thanks for the bug and the investigation. Please feel free to submit a patch on http://phabricator.kde.org/!
The workaround is proposed on https://phabricator.kde.org/D8415
https://phabricator.kde.org/R223:4b2ba6a7af2581660f6b1201991664d749e79b42