TIFFReadRGBAImage doesn't actually return errors unless you ask it to.
authorRalph Giles <giles@xiph.org>
Sun, 20 Feb 2011 06:15:01 +0000 (06:15 +0000)
committerRalph Giles <giles@xiph.org>
Sun, 20 Feb 2011 06:15:01 +0000 (06:15 +0000)
The final argument to TIFFReadRGBAImage is 'stopOnError'. That is,
if it's not true then the function will return success even if
loading the actual image data failed. As such, copying the example
code out of the documentation wasn't really what we wanted.

svn path=/trunk/theora/; revision=17856

examples/tiff2theora.c

index ffd7b10..37fd9d5 100644 (file)
@@ -410,7 +410,7 @@ tiff_read(const char *pathname,
     TIFFClose(tiff);
     return 1;
   }
-  if(!TIFFReadRGBAImage(tiff, width, height, raster, 0)) {
+  if(!TIFFReadRGBAImage(tiff, width, height, raster, 1)) {
     fprintf(stderr, "%s: error: couldn't read tiff data.\n", pathname);
     free(raster);
     TIFFClose(tiff);