After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769380 - Evince doesn't render images inside a particular PDF document
Evince doesn't render images inside a particular PDF document
Status: RESOLVED NOTGNOME
Product: evince
Classification: Core
Component: PDF
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-01 13:40 UTC by John Doe
Modified: 2016-08-02 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of test document opened with evince (58.83 KB, image/png)
2016-08-01 19:13 UTC, John Doe
Details

Description John Doe 2016-08-01 13:40:22 UTC
I'm running evince-3.20.1-1 on a Parabola GNU/Linux-libre system.

I found a PDF document that Evince can't render correctly. Text can be read without problems, but embedded images aren't shown. Unfortunately I can't share this PDF document in public for copyright reasons, but I can send it via e-mail to any Evince developer that wants it.

I also tried to open this PDF with another program (Mupdf) and it was able to display it correctly. So such PDF is not corrupt as far as I know.
Comment 1 John Doe 2016-08-01 13:45:53 UTC
I changed idea. I extracted the first page only from the PDF and uploaded on my personal website: https://www.jdoe.net/linux.pdf
Comment 2 José Aliste 2016-08-01 17:43:27 UTC
I don't think this is Evince's fault. Which version of poppler are you using. Also do you know which flags were given to poppler when compiled? Poppler depends on several libraries to decode images (jpeg, png, etc) and it can be compiled with different versions of these libraries... but to have a complete experience you need to compile with all the dependencies. I am guessing your problem is related to that. In Fedora 23 works for me.
Comment 3 John Doe 2016-08-01 18:27:08 UTC
I have poppler-0.42.0-1. According to https://git.archlinux.org/svntogit/packages.git/tree/poppler/repos/extra-x86_64/PKGBUILD poppler has been compiled with the following flags:

./configure --prefix=/usr --sysconfdir=/etc \
    --localstatedir=/var --disable-static \
    --enable-cairo-output \
    --enable-xpdf-headers \
    --enable-libjpeg --enable-zlib \
    --enable-poppler-qt4 \
    --enable-poppler-qt5 \
    --enable-poppler-glib
Comment 4 José Aliste 2016-08-01 18:40:14 UTC
can you make sure that you have libopenjpeg support in popler? It looks like you don't have this. If you do have this support, then try updating to a newer version of poppler
Comment 5 John Doe 2016-08-01 19:05:42 UTC
I rebuild poppler-0.42.0-1 with --enable-libopenjpeg=auto, but Evince still doesn't show images. I'm going to build poppler-0.46.
Comment 6 John Doe 2016-08-01 19:12:14 UTC
I built poppler-0.46.0-1 with and without --enable-libopenjpeg=auto, without any improvement.
Comment 7 John Doe 2016-08-01 19:13:26 UTC
Created attachment 332491 [details]
screenshot of test document opened with evince
Comment 8 John Doe 2016-08-01 19:14:21 UTC
I noticed some text is hidden by evince/poppler besides images. I can show such text by selecting it with the left mouse button.
Comment 9 José Aliste 2016-08-01 19:33:31 UTC
mmm. can you please compile poppler 0.41 and check? I am wondering whether this is a regression in poppler.
Comment 10 John Doe 2016-08-01 20:25:44 UTC
I built poppler-0.41.0-1 with and without libopenjpeg, to no avail. Just to be sure: do I need to rebuild evince after having rebuilt poppler? Until now I only built and reinstalled poppler alone.
Comment 11 José Aliste 2016-08-01 20:31:27 UTC
you could use the tools of poppler pdftocairo to convert the page to png or something and then open the resulting png image... That will ensure you are using the correct poppler version to test. But yes... you should recompile evince each time. Thus, it's easier to try with tools from poppler.
Comment 12 John Doe 2016-08-01 20:56:14 UTC
$ pdftocairo -png linux.pdf -singlefile
Syntax Error: Failed to decode jp2 structure<0a>
Syntax Warning: Did not succeed opening JPX Stream as JP2, trying as J2K.
Syntax Error: 00000000: expected a marker instead of 0<0a>
Syntax Warning: Did not succeed opening JPX Stream as J2K, trying as JPT.
Syntax Error: Forbidden value encounter in message header !!<0a>
Syntax Error: [JPT-stream] : Expecting Main header first [class_Id 0] !<0a>
Syntax Error: Did not succeed opening JPX Stream.

The PNG file looks wrong, exactly as the PDF file. I guess I should file a Poppler bug report on freedesktop.org...
Comment 13 José Aliste 2016-08-01 21:06:23 UTC
it is weird. I do see the correct output with poppler 0.41
Comment 14 John Doe 2016-08-01 21:10:48 UTC
I even tried switching video card, from Nouveau to Intel, to no avail.
Comment 15 Alban Browaeys 2016-08-01 23:02:57 UTC
you might want to build with --enable-libopenjpeg=openjpeg2 or any hardcoded value instead of =auto, as to get an error if anything is missing.


Also if run from the build directory could you verify you run with absolute or relative path to the built binary
" ./pdftocairo <...>"
that is you are not ending up with the binary in the system path.

NB: you could check the libraries with:
"LD_DEBUG=libs pdftocairo <...>"
Comment 16 Germán Poo-Caamaño 2016-08-02 01:04:21 UTC
I can reproduce the issue with poppler master. It may be a regression because the thumbnail I see in nautilus shows the PDF correctly.

I have not try to bisect it nor to check where the error is.
Comment 17 Germán Poo-Caamaño 2016-08-02 02:03:34 UTC
Installing the "proper" JPEG development library solves the issue.

In my Ubuntu machine (16.04.1, I installed libjpeg62-dev and I removed any other JPEG development library (which were several ones).

It seems poppler tries to use any JPEG library available. Once I rebuilt poppler with libjpeg62-dev the issue is gone.

Closing this bug as NOTGNOME.
Comment 18 Germán Poo-Caamaño 2016-08-02 02:05:19 UTC
FWIW, if I use libjpeg62-dev, I cannot use libtiff5-dev :-/
Comment 19 Germán Poo-Caamaño 2016-08-02 02:26:19 UTC
libjpeg8-dev does the trick and let me install libtiff5-dev.
Comment 20 John Doe 2016-08-02 10:01:57 UTC
Filed a bug on freedesktop: https://bugs.freedesktop.org/show_bug.cgi?id=97183