POV-Ray : Newsgroups : povray.general : Possible TIFF orientation read error Server Time
4 Aug 2024 12:15:30 EDT (-0400)
  Possible TIFF orientation read error (Message 1 to 1 of 1)  
From: Ray Gardener
Subject: Possible TIFF orientation read error
Date: 18 Apr 2003 21:42:59
Message: <3ea0a9a3$1@news.povray.org>
I'm testing exported TIFF images for use
with POV-Ray as imagemaps, and I've noticed
that RGB/RGBA TIFFs appear vertically flipped
in POV-Ray, although the orientation tag in
the TIFF file is the default (topleft). The
images appear correctly in other apps.

Looking at the libtiff 3.5.7 code used by POV-Ray,
it seems it writes to the RGBA buffer
upside down. This code fragment from libtiff's
setorientation() routine looks odd:

    case ORIENTATION_TOPLEFT:
      y = h-1;
      break;

because it would cause scanlines to be written
to the receive buffer from the bottom up instead
of from the top down.

This appears to be a bug in libtiff, so I've
logged bug 322 in their Bugzilla database, but
in the meantime, a possible fix in POV-Ray would
be to use the lower level libtiff routines.
POV's paletted TIFF-image read code, for example,
loads images correctly (it also ignores the
orientation entirely and just assumes it's topdown,
but most TIFF readers do).

One can also do "scale -1*<relavant axis>" in POV
image_map blocks for such cases, as a workaround.

--
Ray Gardener
Daylon Graphics Ltd.
"Heightfield modeling perfected"


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.