Page 1 of 1
Error during conversion of images that view fine: "length and filesize do not match"
Posted: 2016-07-22T07:15:00-07:00
by IanL
I have no control of the input .bmp files (I am converting files from a game's user created scenarios into .jpg files for use on the web) and all the viewers and editors I have used read them and display them OK but when I run convert the majority of them produce this (and no jpg file):
Code: Select all
convert -resize x220^> "The Battle for Borgo Cascino.bmp" "The Battle for Borgo Cascino.jpg"
convert: length and filesize do not match `The Battle for Borgo Cascino.bmp' @ warning/bmp.c/ReadBMPImage/809.
I have seen this error referenced from 13 years ago but nothing recent is there anything I can do to have this warning ignored or otherwise workaround this?
I am running this on Windows 10 with ImageMagick-7.0.2-Q16 64 bit.
Re: Error during conversion of images that view fine: "length and filesize do not match"
Posted: 2016-07-22T07:26:54-07:00
by snibgo
Can you supply an input file that shows the problem? You can upload to somewhere like dropbox.com and paste the link here.
Re: Error during conversion of images that view fine: "length and filesize do not match"
Posted: 2016-07-22T08:07:37-07:00
by IanL
Here is a sample image.
https://dl.dropboxusercontent.com/u/286 ... ascino.bmp
However I may have jumped the gun and really have a different problem - aka user error.
What I really want to do is convert the whole directory of images and the command I was trying to use was this to convert all .bmp images :
convert -resize x220^> *.bmp test\
I realized my error when I went to copy the file for you to look at and realized that there was a .jpg file there form my sample command line.
My attempt to convert *.bmp and put the files in the directory test failed to create output .jpg files but still touched and reported the warning for all the .bmp files. So, obviously I'm OK with warnings appearing for files that are not quite right but I cannot figure out how to convert to jpg files and copy to another directory. I have tried:
convert -resize x220^> *.bmp test\*.jpg
convert -resize x220^> *.bmp test
convert -resize x220^> *.bmp test/
I will continue to read the documentation...
Re: Error during conversion of images that view fine: "length and filesize do not match"
Posted: 2016-07-22T08:41:38-07:00
by IanL
So it seems the recommended way to go is to use mogrify instead of convert. This does the job:
mogrify -format jpg -path .\test -resize x220^> *.bmp
Re: Error during conversion of images that view fine: "length and filesize do not match"
Posted: 2016-07-22T08:54:38-07:00
by snibgo
Yes, use "mogrify".
Note the the correct syntax for "convert" is: read the input, do the 1processing, write the output. And don't use wildcards in the output. "Convert" is normally used when we want to combine inputs in a certain way. If we want the same processing to be done on a batch of files, with one output per input, "mogrify" is the tool to use.