Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#191 Freeimage refusing to load large PNG and other wierdness

None
closed
Hervé Drolon
None
5
2014-03-23
2011-11-13
Anonymous
No

Hi. Ive been having a go at writing my own dupe detector in VB6. Alls going well until my app hits a PNG file that has a res of 10000 x 7457 x 32.

The code fails inside the VB6 wrapper function \'Freeimage_LoadEx\' when the function\'s built-in error trap triggers. Looking at the code it seems the error is raised if the call to Freeimage_Load returns NULL, which is happening in the case of my test image and the original.

I then try to recreate the bug with a new image. Same dimensions, same format. I get a completely new bug. In my app I convert the loaded image to 32bpp for processing (if it isn\'t already) and I find that Freeimage_ConvertTo32Bits is returning NULL.

Freeimage_GetBpp was reporting that my test image was only 24bit while the original was 32 so I compared my test image with the original and I find that the original has a mask while my test image didn\'t. I added it and the original bug returned.

This bug was occurring with 3.14.1 and 3.15.1

Test image : http://www.jcomcp.plus.com/test.png

Discussion


  • Anonymous
    2011-11-17

    Just tested it again by converting the PNG to a BMP. It fails at 'Freeimage_ConvertTo32Bits' again.

     
  • Hervé Drolon
    Hervé Drolon
    2011-11-17

    Hi,

    This image is a 32-bit image with a size of ~ 284.5 MB.
    I have no problem loading it, so you problem is probably related to your memory.
    Maybe there's a limitation in VB6 with the memory you can allocate.
    Note that you can use FreeImage_SetOutputMessage to catch error messages.

    Hervé

     

  • Anonymous
    2011-11-24

    After force feeding myself C I have to agree with you. After translating my VB code to C I have no problems with those images. However I have found another bug pertaining to 3.15.1. I'l open a fresh bug for it.

    BTW, my error handler set with FreeImage_SetOutputMessage does not respond to the original bug. The mentioned functions just fail silently and return NULL without calling the error handler. Other errors work. I was getting other loading related messages (usually JPEG file related) properly.

     
  • Hervé Drolon
    Hervé Drolon
    2014-03-23

    closed with release 3.16.0

     
  • Hervé Drolon
    Hervé Drolon
    2014-03-23

    • status: open --> closed
    • Group: -->