Menu

#256 Can't open RGBAF TIF image using 3.17.0 release

None
closed
tif (1) rgbaf (1)
5
2018-07-31
2015-04-03
Mike
No

I'm using the FreeImage library with my Sharp IMG Viewer desktop application written for .NET Framework.
It is possible to open images with FreeImage library from menu File->Import->From Image File.

I have RGBAF TIF image RGBAF, which can be opened with the 3.16.0 FreeImage library version. However, when I replaced FreeImage library to the 3.17.0 release I found that the image is opened by OpenMultiBitmap function, but LockPage function for the returned bitmap is failed. Therefore, RGBAF TIF can't be opened using the 3.17.0 release.

Please answer, if the mentioned bug could be fixed.

1 Attachments

Discussion

  • Jorge Diogo

    Jorge Diogo - 2015-07-10

    Not sure if the same format as above, but the attached 32 bits per sample image also fails to load with this error:
    Unable to handle this format: bitspersample = 32, samplesperpixel = 3, photometric = 2

     
  • Frits Talbot

    Frits Talbot - 2015-08-22

    I ran into the same problem (as Diogo, at least), and tracked it down to a change made in http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginTIFF.cpp?r1=1.72&r2=1.73 on lines 1123-1128.

    To get around the problem on my end, I added PHOTOMETRIC_RGB as an allowed condition for 32 bits per sample, which makes it load my images fine. Not sure why it has been made so restrictive in 3.17.0?

     
  • Mathew Maher

    Mathew Maher - 2015-08-25

    I've run into the same problem.

    Running a write/read sequence on FIT_RGBF formatted files. The write works ok, but then the readback fails with "Unable to handle this format: bitspersample = 32, samplesperpixel=3, photometric=2".

    Looking deeper into this issue, the failure looks to be caused by a lack of support for 32bit x3 RGBF formats: PluginTIFF.cpp (line 1097) has a IsValidBitsPerSample(...) function which doesn't support 96bit (aka 32x3) bit depths.

    Unless theres something in the spec preventing it, can we just add a 96bit case to this function?

     
  • Hervé Drolon

    Hervé Drolon - 2015-08-25

    Hi,

    This is clearly a bug in release 3.17.0.
    I've added a quick fix to the CVS.

    However, I think the TIFF plugin needs a complete refactoring in order to avoid this kind of bug in the future. I'm currently working on this refactoring for the next release.

    Hervé

     
  • Hervé Drolon

    Hervé Drolon - 2015-08-25
    • status: open --> pending
    • Group: -->
     
  • Hervé Drolon

    Hervé Drolon - 2018-07-31
    • status: pending --> closed
     
  • Hervé Drolon

    Hervé Drolon - 2018-07-31

    Fixed in release 3.18.0

     

Log in to post a comment.

MongoDB Logo MongoDB