MantisBT - ITK
View Issue Details
0005970ITKpublic2007-10-26 16:082007-10-26 16:11
Bill Lorensen 
Bill Lorensen 
normalminoralways
closedfixed 
AllAllAll
 
 
0005970: TIFF does not read 48bit images
hi,

we have found a problem in 48 bit tiff image loading
we have used this workaround in TIFFImageIO::EvaluateImageAt( void* out, void* in )

...
    case TIFFImageIO::RGB_:
      if(m_ComponentType == USHORT)
        {
        unsigned short *image_us = (unsigned short*)out;
        unsigned short *source_us = (unsigned short*)in;

        red = *(source_us);
        green = *(source_us+1);
        blue = *(source_us+2);
        *(image_us) = red;
        *(image_us+1) = green;
        *(image_us+2) = blue;
        if ( m_InternalImage->SamplesPerPixel == 4 )
            {
            alpha = *(source_us+3);
            *(image_us+3) = 65535-alpha;
            }
        }
      else
        {
        red = *(source);
        green = *(source+1);
        blue = *(source+2);
        *(image) = red;
        *(image+1) = green;
        *(image+2) = blue;
        if ( m_InternalImage->SamplesPerPixel == 4 )
            {
            alpha = *(source+3);
            *(image+3) = 255-alpha;
            }
        }
      increment = m_InternalImage->SamplesPerPixel;
      break;
...

best regards,
Mazzetto Manuel, Rizzi Davide


User supplied a sample file that contained 48 bits per pixel. Ran with itkTIFFImageIOTest. Resulting image was garbage.
No tags attached.
Issue History
2007-10-26 16:08Bill LorensenNew Issue
2007-10-26 16:08Bill LorensenStatusnew => assigned
2007-10-26 16:08Bill LorensenAssigned To => Bill Lorensen
2007-10-26 16:09Bill LorensenStatusassigned => confirmed
2007-10-26 16:09Bill LorensenSteps to Reproduce Updated
2007-10-26 16:11Bill LorensenNote Added: 0009575
2007-10-26 16:11Bill LorensenStatusconfirmed => closed
2007-10-26 16:11Bill LorensenResolutionopen => fixed

Notes
(0009575)
Bill Lorensen   
2007-10-26 16:11   
Applied user patch and the 48 bit image is now read correctly. Added a sample image and an additional test. Modified itkTIFFImageIOTest to read 48 bit rgb pixels.