Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 387125

Summary: app-text/epdfview-0.1.8 switches blue and red colors
Product: Gentoo Linux Reporter: Vladimir <v_2e>
Component: Current packagesAssignee: Daniel Pielmeier <billie>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, hppa, ppc64, ppc, printing, sparc
Priority: Normal Keywords: PMASKED
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: RGB PDF test file
CMYK PDF test file

Description Vladimir 2011-10-14 13:27:32 UTC
Hello!
After the yesterday's recompilation of app-text/epdfview-0.1.8 I found that it switches the "blue" and "red" color channels on all graphics inside the PDF files.
So, if I previously had a red line, now I see it in blue and vice versa. The same happens with all the JPEG photos incorporated into the document - these channels are switched places.

Other programs (like importing in Inkscape, preview in TeXMaker) show the correct colors.

For information: yesterday I also upgraded the app-text/poppler to the version 0.18.0


Reproducible: Always
Comment 1 Fab 2011-10-14 13:50:45 UTC
You must apply this patch [1] from epdfview's upstream to fix the issue.

> When using Poppler 0.17.0, I needed to swap the blue and red channels,
> otherwise the colors (other than black and white) looked wierd.

[1] http://trac.emma-soft.com/epdfview/changeset/367
Comment 2 Rafał Mużyło 2011-10-14 14:06:20 UTC
(In reply to comment #1)
> You must apply this patch [1] from epdfview's upstream to fix the issue.
> 
> 
> [1] http://trac.emma-soft.com/epdfview/changeset/367

epdfview upstream strikes again - I don't know if any of the supported by the ebuild arches is bigendian, but I'm almost certain, that if it is, this patch will break them instead.
Comment 3 Jean-Francis Roy 2011-12-14 21:49:03 UTC
I confirm this bug and that the patch from comment #1 resolves the problem.
Comment 4 Joaquim Uchoa 2011-12-15 02:33:03 UTC
(In reply to comment #3)
> I confirm this bug and that the patch from comment #1 resolves the problem.

I can confirm this bug too. Don't tried yet the patch.
Comment 5 R!tman 2012-01-27 14:07:10 UTC
This bug is already out there for a while and the patch seems to be working. I strongly suggest to push this to the official portage tree.
Comment 6 Daniel Pielmeier gentoo-dev 2012-01-28 13:33:15 UTC
+*epdfview-0.1.8-r1 (28 Jan 2012)
+
+  28 Jan 2012; Daniel Pielmeier <billie@gentoo.org> +epdfview-0.1.8-r1.ebuild,
+  +files/epdfview-0.1.8-swap-blue-red-channels.patch:
+  Add patch from upstream to fix bug #387125. Thanks to Vladimir for the report
+  and Fab for the link to the upstream patch. Possible endian issues still have
+  to be sorted out.

I have added the patch for 0.18-r1. Regarding endianness. If I am correct x86 and am64 are little endian so there should be no problem there. ppc(64) and sparc are bi-endian so there might be problems. For hppa I am not sure [1] says bi-endian and [2] says big-endian. All in all a patch working everywhere would be appreciated.

CC-ing affected arch teams for advice.
@ ppc, ppc64, sparc, hppa: Can you please test if the patch causes any issues on your architecture?

[1] https://en.wikipedia.org/wiki/Endianness
[2] https://en.wikipedia.org/wiki/PA-RISC
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2012-02-01 16:49:49 UTC
(In reply to comment #6)
> I have added the patch for 0.18-r1. Regarding endianness. If I am correct x86
> and am64 are little endian so there should be no problem there. ppc(64) and
> sparc are bi-endian so there might be problems. For hppa I am not sure [1] says

Linux/HPPA is big-endian. I didn't test with a coloured PDF for the -r0 stabilisation - checking again.
Comment 8 Rafał Mużyło 2012-02-03 17:38:20 UTC
Not that it really matters to me, but it's like this:
- gdk-pixbuf is machine independent RGBA
- cairo surface (24/32 bit type) is machine endian ARGB (that is it's BGRA on little endian)

as such that 'swap(data[0], data[2])' fix is correct for little endian, but no real help for big endian
Comment 9 Stephen Lewis 2012-02-21 23:22:47 UTC
I have tested 'epdfview-0.1.8-r1' on 'ppc', 'ppc64', 'amd64' and 'alpha'
with two PDF test files and obtain the following results:

                X86     PPC     AMD64   PPC64   ALPHA
sl_rgb.pdf      ?       PASS    PASS    FAIL-2  PASS
sl_cmyk.pdf     ?       PASS    FAIL-1  FAIL-2  FAIL-1

FAIL-1    Red and Blue swapped
FAIL-2    All colors including Black get munged in non-obvious way

I do not have access to X86 but have attached the test files for reference.
The test files render correctly using 'xpdf' on all above platforms.
So the problem seems related to using CMYK colorspace in the PDF.

Stephen Lewis
Comment 10 Stephen Lewis 2012-02-21 23:25:25 UTC
Created attachment 302755 [details]
RGB PDF test file

see Comment 9
Comment 11 Stephen Lewis 2012-02-21 23:26:32 UTC
Created attachment 302757 [details]
CMYK PDF test file

see Comment 9
Comment 12 Felix Schuster 2012-03-03 03:36:24 UTC
For me both test files are working:
Linux flora 3.2.1-gentoo-r2 #1 SMP Mon Jan 30 23:12:58 CET 2012 x86_64 Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz GenuineIntel GNU/Linux

amd64 environment with epdfview-0.1.8-r1 running (currently amd64 keyworded)
Comment 13 Daniel Pielmeier gentoo-dev 2012-04-08 10:32:42 UTC
So we really need a fix which endian independent. I already contacted upstream about this issue but got no response until now.
Comment 14 Andreas K. Hüttel archtester gentoo-dev 2012-08-06 23:01:58 UTC
Masked for removal.
Comment 15 Vladimir 2012-08-07 09:06:23 UTC
  Hello!
(In reply to comment #14)
> Masked for removal.

It's a pity epdfview is "dead" as  today's emerge message says. I also says that

" Unfortunately the best lightweight replacement I can
# recommend is app-text/apvlv, otherwise you can go for app-text/acroread
# (huge, closed source), kde-base/okular (KDE), or app-text/evince (Gnome)."
But what about app-text/qpdfview? It looks stable even in its current state, but it is also being developed actively. At least, the developer responds very fast to any bugreports and feature requests. He tries to keep this application lightweight as well.
  To my mind, qpdfview is a nice alternative to epdfview in the nearest future. It also has a "tabbed" interface which is not widely implemented in PDF viewers.

Regards,
  Vladimir
Comment 16 Samuli Suominen (RETIRED) gentoo-dev 2012-08-07 09:37:05 UTC
(In reply to comment #15)

You forgot zathura which has evolved to near evince completeness.
Comment 17 ncahill_alt 2012-08-07 12:24:42 UTC
Another viewer to look at is mupdf, very quick with vi-like shortcuts, has text search and goto page, pretty basic but very good performance.
Comment 18 Andreas K. Hüttel archtester gentoo-dev 2012-09-05 22:44:07 UTC
Not in the tree anymore.