[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: insighttoolkit4 backport on wheezy 32bit -- 2 tests failures



On Fri, 2014-05-30 at 08:57 -0400, Yaroslav Halchenko wrote:

> > Considering this, one could indeed disable this test but then one should
> > probably also disable the corresponding functionality.
> 
> indeed.  What would be a preferable way to disable it?
> 
> a. throw exception when trying to access it?
> b. just remove from the API?
I've dug a bit deeper and what comes out is the following: 
The test image is a four channel image, and now I assume, that the old
version of libtiff doesn't support the alpha channel when writing to
JPEG, because COMPRESSION_JPEG is already defined in the according
tiff.h header file.

I'd suggest to fallback to "COMPRESSION_PACKBITS" in itkTIFFImageIO.cxx
for case TIFFImageIO::JPEG, old libtiff and more than three color
components. (Patch attached) This way calling code doesn't break, and I
doubt that the compression type is crucial for storing an image. 

> > > > would you mind adding a direct dependency to insighttoolkit4 package's control?
> 
> > Actually, it is currently not possible - libvtk5-dev is required
> > depends on libtiff4-dev. 
> 
> I must be too slow on Friday -- could you elaborate?  even if
> libvtk5-dev bdepends on libtiff4-dev, that doesn't forbid itk4 bdepend
> on it...
libvtk5-dev does not bdepend on libtiff4-dev, it *depends* on it, i.e. 
when you install libtiff5-dev on wheezy, libtiff4-dev and libvtk5-dev
will be removed (that's how I realized that there is a problem). 

The other question is of course, when tk is linked against libtiff4 and 
itk against libtiff5 and both are loaded by program X then you can not
be sure what code is actually called when a TIFF function is invoked
that is available in both libraries.

Best 
Gert 

--- itkTIFFImageIO.cxx.old	2014-04-09 16:15:24.000000000 +0200
+++ itkTIFFImageIO.cxx	2014-05-30 16:16:17.711566112 +0200
@@ -1834,6 +1834,14 @@
         case TIFFImageIO::PackBits:
           compression = COMPRESSION_PACKBITS; break;
         case TIFFImageIO::JPEG:
+#ifndef TIFF_INT64_T // tiff.h is not from libtiff5-dev 
+          if (scomponents > 3) 
+            {
+            itkWarningMacro(<< "The provided libtiff does not support JPEG compression "
+                               "with more than 3 channels, packbits compression used instead");
+            compression = COMPRESSION_PACKBITS
+            }else 
+#endif 
           compression = COMPRESSION_JPEG; break;
         case TIFFImageIO::Deflate:
           compression = COMPRESSION_DEFLATE; break;

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: