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 509920 - Black/White tiff images appear blue in PowerPC
Black/White tiff images appear blue in PowerPC
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: backends
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-01-16 15:46 UTC by Benjamin Berg
Modified: 2009-04-09 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.15 KB, patch)
2009-04-08 19:25 UTC, Benjamin Berg
committed Details | Review

Description Benjamin Berg 2008-01-16 15:46:00 UTC
Open a black/white tiff images results in a blue/white image.
Comment 1 Carlos Garcia Campos 2008-01-16 16:16:57 UTC
Thanks for taking the time to report this bug.
This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade.


*** This bug has been marked as a duplicate of 497279 ***
Comment 2 Benjamin Berg 2009-04-08 18:28:02 UTC
I just realized that this is not a duplicate of bug #497279, and the bug is still present.
This bug is about big endian machines that are still broken.

I'll attach a patch a new patch that actually fixes the issue on all machines. Also it looks to me like libtiff outputs non-premultiplied data, while cairo expects everything to be premultiplied.
Comment 3 Benjamin Berg 2009-04-08 18:28:30 UTC
Forgot to reopen the bug.
Comment 4 Benjamin Berg 2009-04-08 19:25:31 UTC
Created attachment 132360 [details] [review]
patch

This patch should be completely platform independent. It contains one other small change, that is to check whether cairo is returning a rowstride of 4*width. If it is not, then the code will currently fall over.
Comment 5 Benjamin Berg 2009-04-08 19:28:28 UTC
Oh, I realized that premultiplying does not make any sense if the cairo surface does not even support alpha ...
Comment 6 Nickolay V. Shmyrev 2009-04-08 22:10:25 UTC
(In reply to comment #5)
> Oh, I realized that premultiplying does not make any sense if the cairo surface
> does not even support alpha ...
> 

So, what is the state of the patch? I also wonder why the first chunk moves #endif.
Comment 7 Benjamin Berg 2009-04-09 09:35:28 UTC
The patch does not do any premultiplying and should work fine.

The #endif is moved because the code depends on cairo_format_stride_for_width to return width*4. If the rowstride is different, one would need to not only convert the pixel data, but also move it around.
Comment 8 Nickolay V. Shmyrev 2009-04-09 20:19:02 UTC
Great, please commit to both branches if it's not hard
Comment 9 Benjamin Berg 2009-04-09 20:38:36 UTC
Oh, it was much simpler than yesterday ;-)

Committed to both branches.