GNOME Bugzilla – Bug 769380
Evince doesn't render images inside a particular PDF document
Last modified: 2016-08-02 10:01:57 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.
I changed idea. I extracted the first page only from the PDF and uploaded on my personal website: https://www.jdoe.net/linux.pdf
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.
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
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
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.
I built poppler-0.46.0-1 with and without --enable-libopenjpeg=auto, without any improvement.
Created attachment 332491 [details] screenshot of test document opened with evince
I noticed some text is hidden by evince/poppler besides images. I can show such text by selecting it with the left mouse button.
mmm. can you please compile poppler 0.41 and check? I am wondering whether this is a regression in poppler.
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.
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.
$ 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...
it is weird. I do see the correct output with poppler 0.41
I even tried switching video card, from Nouveau to Intel, to no avail.
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 <...>"
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.
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.
FWIW, if I use libjpeg62-dev, I cannot use libtiff5-dev :-/
libjpeg8-dev does the trick and let me install libtiff5-dev.
Filed a bug on freedesktop: https://bugs.freedesktop.org/show_bug.cgi?id=97183