[CLOSED] Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
[CLOSED] Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
Hello,
I have an exe compiled in visual studio 2017 with magick ++ 7.0.8-15.
If I try to read a JPG or BMP file (I have not tried with others) I get an error "InsufficientImageDataInFile" (in jpg) "LengthAndFilesizeDoNotMatch" (in bmp) but only in Windows XP, in Windows 10 it works perfectly.
What happens?
Thxs
I have an exe compiled in visual studio 2017 with magick ++ 7.0.8-15.
If I try to read a JPG or BMP file (I have not tried with others) I get an error "InsufficientImageDataInFile" (in jpg) "LengthAndFilesizeDoNotMatch" (in bmp) but only in Windows XP, in Windows 10 it works perfectly.
What happens?
Thxs
Last edited by Portiella on 2018-12-27T04:36:37-07:00, edited 1 time in total.
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
can someone try on XP?
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
ImageMagick has a number of sanity checks for the image readers to help prevent security vectors caused by malformed images. Can you post your image here or post a link so we can download it. We need to reproduce the problem to determine if ImageMagick is being overly aggressive in its sanity checks or if the image is indeed malformed.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
Does this happen with all JPG and BMP files? If so, perhaps there is an installation problem. Did you rebuild the exe on both platforms, or did you copy the exe from one platform to the other, on the assumption that libraries were identical on both?Portiella wrote:What happens?
snibgo's IM pages: im.snibgo.com
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
It happens to me with all the images, jpg, bmp, tiff, images recorded with Microsoft Paint I also get error. It is not a problem of jpg bmp files
I am convinced that it is something of my code or visual studio 2017, but the same exe and same images in Windows 7/10 works perfectly.
I am convinced that it is something of my code or visual studio 2017, but the same exe and same images in Windows 7/10 works perfectly.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
Did you rebuild your exe on the XP platform, or did you simply copy the exe from the Windows 10 platform?
snibgo's IM pages: im.snibgo.com
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
I configure Visual Studio 2017 to compile XP target.
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
Doing debug in bmp.c, on line number 826 I modified
if ((MagickSizeType) bmp_info.file_size > GetBlobSize(image))
(void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
"LengthAndFilesizeDoNotMatch","`%s' sizeBMP: %u sizeBlob: %u", image->filename, bmp_info.file_size, GetBlobSize(image));
the "GetBlobSize (image)" function returns 0
if ((MagickSizeType) bmp_info.file_size > GetBlobSize(image))
(void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
"LengthAndFilesizeDoNotMatch","`%s' sizeBMP: %u sizeBlob: %u", image->filename, bmp_info.file_size, GetBlobSize(image));
the "GetBlobSize (image)" function returns 0
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
What are the reasons for the GetBlobSize function to return 0?
It is the same source code and same EXE for XP and Windows 10.
In 7/10, it works perfectly.
Thx.
It is the same source code and same EXE for XP and Windows 10.
In 7/10, it works perfectly.
Thx.
Re: Error InsufficientImageDataInFile / LengthAndFilesizeDoNotMatch
I have compiled the IMDisplay.exe utility for XP with Visual Studio 2017 and it does not work, it gives the same error, so it is not my source code.
Both imagemagick and graphicsmagick do not work on XP compiled with Visual Studio 2017.
I tried to install Visual Studio 2017 in Windows XP but I have not been able
Both imagemagick and graphicsmagick do not work on XP compiled with Visual Studio 2017.
I tried to install Visual Studio 2017 in Windows XP but I have not been able