[okular] [Bug 385384] New: Some PNG files produced by acdsee can't be displayed

Alexander Trufanov bugzilla_noreply at kde.org
Thu Oct 5 06:10:18 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=385384

            Bug ID: 385384
           Summary: Some PNG files produced by acdsee can't be displayed
           Product: okular
           Version: 1.2.70
          Platform: Debian stable
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: okular-devel at kde.org
          Reporter: trufanovan at gmail.com
  Target Milestone: ---

Created attachment 108176
  --> https://bugs.kde.org/attachment.cgi?id=108176&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list