Is there a lib to use? If not this will be quite a lot of work.
@Johnny Petersen The original is in the zip 5d630284307d0a64696d10b26d13f6af.png
Can you copy the image then edit out the sensitive data (pixels/metadata) and upload it so we will have something to work with. Parsing TIFF tags is not a trivial task and we have to see what is going on.
Hi, undefined tags are not garbage in TIFF, they are simply unknown. Also even garbage icc profile should not make FreeImage crash. If you are able to preproduce the scenario with another image it will be great.
I have created https://github.com/mnaydenov/FreeImage-Sidecar as a small "add-on" library to load HEIF and AVIF. Because of the restrictive FreeImage license, which is not compatible with LGPL, I was forced to make the plugin stand alone and not as a path to FreeImage.
Hello, I have created https://github.com/mnaydenov/FreeImage-Sidecar which is a small "add-on" (to FreeImage) library to load HEIF and AVIF. It is basically just a wrapper for a single plugin file that loads both. Because of the restrictive FreeImage license, which is not compatible with LGPL (the license of libhief), I was forced to make the plugin stand alone and not as a path to FreeImage.
This is very interesting. Where exactly does it overflow. You changed many unsigned to size_t, but this way we mask the issue. Can you please add a comment where the size_t is required to draw attention, please!
Hi, looking at the code, FreeImage_ConvertToGreyscale does not work with FIT_RGB16 images. If you don't care about 16bit color, convert first to FIT_BITMAP, then run ConvertToGrayscale. If you do care about 16bit, I think you can simply convert to FIT_UINT16