Trouble with FreeImage_Convert

  • dragon9

    dragon9 - 2014-06-12

    I'm working on a program using the pre-built Windows binaries for FreeImage 3.16.0. I'm making the following sequence of calls...

    fif = FreeImage_GetFIFFromFilename( fileName ); // returns FIF_TIFF
    bool result = FreeImage_FIFSupportsReading(fif); // returns TRUE
    FIBITMAP dib = FreeImage_Load(fif, fileName, 0); // returns a valid FIBITMAP
    pNewImg = FreeImage_ConvertTo24Bits( dib ); // returns NULL (why? help!)

    The FreeImage_GetFIFFromFilename() function correctly detects the file type as FIF_TIFF and FreeImage_Load() returns a valid FIBITMAP. The problem is that FreeImage_ConvertTo24Bits() (or any other FreeImage_Convert function) always returns NULL. I'm pretty sure that the FIBITMAP returned by FreeImage_Load() is good because I get correct values from it when calling functions like FreeImage_GetWidth() and FreeImage_GetBPP(), but I can't get any of the FreeImage_Convert functions to work on it. What am I doing wrong?

  • Hervé Drolon

    Hervé Drolon - 2014-06-14

    Maybe the bitdepth or the image type of your TIFF is not supported by the convert function ?
    What is the returned value for FreeImage_GetBPP() ?


Log in to post a comment.