Evince and EOG display TIFF files flipped

Bug #256330 reported by VladimirCZ
2
Affects Status Importance Assigned to Milestone
Evince
Fix Released
Medium
Eye of GNOME
Fix Released
Medium
eog (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs
evince (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs
tiff (Debian)
Invalid
Undecided
Unassigned

Bug Description

In Evince I can see all pages of one multiple page TIFF file, but they are all "flipped" (left <->right). Please, try to open the enclosed file in Evince to see what I mean (it is like a mirror reflection).

Note:
1) KFaxView can display the file in the same Ubuntu installation properly.
2) We have a lot of such TIFF files in our company from scanning of documents at the end of 90's - so it is probable that other business users may / will face the same problem.

64-bit Ubuntu 8.04 Hardy Heron, default gnome environment of Ubuntu

Revision history for this message
VladimirCZ (vlabla) wrote :
Revision history for this message
guidol (monk-e) wrote :

Confirmed on Ubuntu 8.04 32 bit.
Also affects Debian Lenny.

Since this also affects EOG (on both distros)
my best guess is this a libtiff problem.

Changed in evince:
status: New → Confirmed
Changed in tiff:
status: Unknown → New
Revision history for this message
Jay Berkenbilt (ejb) wrote :
Download full text (4.0 KiB)

This is not a libtiff bug, and the fact that the tiff file is multipage is not relevant. The problem is with the tiff file headers and with the applications' interpretations of those headers. I believe eog and evince are both misinterpreting the orientation header.

To rule out the multipage nature of the image as a source of the problem, you run tiffsplit on the attached image to get separate images for each of the eight pages, called xaaa.tif through xaah.tif. You can display any of those pages with evince or eog and see the same thing, indicating that this doesn't have anything to do with the image being a multipage image.

We can observe that the orientation of these tiff files is unusual. To do this, create a "normal" tiff file using "import" from ImageMagick. Run

import /tmp/a.tif

and click on any window. Then run

tiffinfo /tmp/a.tiff | grep Orientation

You will see

  Orientation: row 0 top, col 0 lhs

This means that the first row of the image is the visual top, and the first column is the visual left.

If you run tiffinfo on the attached image file and grep for Orientation, you see the following:

  Orientation: row 0 rhs, col 0 top
  Orientation: row 0 rhs, col 0 top
  Orientation: row 0 rhs, col 0 top
  Orientation: row 0 rhs, col 0 top
  Orientation: row 0 rhs, col 0 top
  Orientation: row 0 rhs, col 0 top
  Orientation: row 0 rhs, col 0 top
  Orientation: row 0 rhs, col 0 top

All subimages have row 0 rhs, col 0 top, meaning that the first row is the visual right and the first column is the visual top. This is the same as having the image rotated 90 degrees to the right.

It seems that both eog and evince are flipping the image horizontally instead of rotating it, and "display" from ImageMagick is ignoring the orientation field entirely. The only application I've been able to find that actually handles this orientation value is gthumb, which at least the way I have it configured (I know I set some option to obey image orientation because my Canon digital camera uses the jpeg orientation field), does actually show the image rotated 90 degrees to the right. Even gimp doesn't handle this properly. If you run gimp on one of the pages, you get the warning

** (tiff-load:27322): WARNING **: Orientation 6 not handled yet!

If you run tiffcp on the file to copy it to another file using the tiff library:

% tiffcp AK-LV104e.tif a.tif
AK-LV104e.tif: Warning, using top-left orientation.
AK-LV104e.tif: Warning, using top-left orientation.
AK-LV104e.tif: Warning, using top-left orientation.
AK-LV104e.tif: Warning, using top-left orientation.
AK-LV104e.tif: Warning, using top-left orientation.
AK-LV104e.tif: Warning, using top-left orientation.
AK-LV104e.tif: Warning, using top-left orientation.
AK-LV104e.tif: Warning, using top-left orientation.

you can observe that libtiff overrides the orientation. The resulting file displays properly with evince and eog and all the other viewers I can find.

I'm not sure whether eog and evince, both gnome applications, might be using the same underlying code between the application and libtiff to render the images. In that case, the bug is really against that library, not libtiff. It's al...

Read more...

Revision history for this message
Jay Berkenbilt (ejb) wrote :

In case it gets buried in the above comment, here is a workaround for your problem:

 * The above includes a workaround: run tiffcp your-image.tif new-image.tif. The resulting image, at least in the case of the above attachment, displays properly in all the above mentioned applications.

Also, I should mention that, as the debian maintainer of the tiff packages, I very much appreciate that someone took the trouble to report the bug in the debian bug tracking system. This is how I became aware of the issue. I've closed the bug there with comments pending investigation of where the bug actually lives. At the time, I hope someone will again create the appropriate bugs in the debian bug tracking system and/or in the bug tracking systems for the upstream software.

Changed in tiff:
status: New → Fix Released
Revision history for this message
VladimirCZ (vlabla) wrote :

Jay, many thanks for your research and analysis. Now, it seems the Ubuntu bug maintainer ("Monk-e" probably) should requalify the bug pertinence to Evince and EOG.

Revision history for this message
guidol (monk-e) wrote :

Added this bug to Evince. Don't know how to add more than one package (if that's at all possible). I hope the Evince or EOG maintainers can track the source of this bug.

guidol (monk-e)
Changed in tiff:
status: New → Unknown
Revision history for this message
guidol (monk-e) wrote :

Removing the link to Debian bugtracker to update the status manually.

Revision history for this message
guidol (monk-e) wrote :

here is the link to the invalid Debian bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494453

Changed in tiff:
status: New → Unknown
status: New → Invalid
Revision history for this message
Pedro Villavicencio (pedro) wrote :

I'm also getting it with Intrepid will look upstream thanks.

Changed in evince:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: Confirmed → Triaged
Revision history for this message
Pedro Villavicencio (pedro) wrote :

I've sent this upstream at: http://bugzilla.gnome.org/show_bug.cgi?id=548444 ; thanks everybody.

Changed in evince:
status: Unknown → New
Revision history for this message
Pedro Villavicencio (pedro) wrote :

I've sent the eog issue to here: http://bugzilla.gnome.org/show_bug.cgi?id=548474 ; The evince one was fixed upstream now, thanks all for reporting.

Changed in eog:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Triaged
Changed in evince:
status: Triaged → Fix Committed
Changed in eog:
status: Unknown → New
Changed in evince:
status: New → Fix Released
Changed in eog:
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

the new version is in intrepid now

Changed in evince:
status: Fix Committed → Fix Released
Changed in evince:
importance: Unknown → Medium
Changed in eog:
importance: Unknown → Medium
Changed in eog:
status: Confirmed → Fix Released
Revision history for this message
madbiologist (me-again) wrote :

Fixed in Eye of Gnome 3.1.2

Changed in eog (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.