0

I am experiencing difficulty with resize. I was wondering what could the causes of unsupported file types be? Are these related to HEADER or some other specific part of a file. I have gone over the code a few times, tried the debugger, which is a weird as it does not show loop variables eg. int n, n < k, n++, then in debugger the value of n does not change, but the loop actually goes throw all the iterations. I am looking for some pointers as I want to solve it myself, if i can't i shall post my code.

Thanks

1 Answer 1

0

This is almost certainly a header problem. Without seeing any code, I would suggest you very carefully review which elements in the header structure you are changing and how. Note that there are several header elements that are very similarly named, like bfSize, biSize, biSizeIMage, etc. Changing certain of these values, especially biSize, can have adverse effects, as serious as corrupting the header.

Another common problem relates to where things are written in the output file. Writing the bi and bf headers out in the wrong order, or overwriting the headers with the image data somehow, will corrupt the file and result in the errors you are seeing.

You should use the xxd tool to examine your output file to see exactly what is being written to the header. The peek tool won't help here because it won't recognize the file as a bmp, but xxd will let you actually see the hexadecimal data.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

1
  • Had messed up the bi and bf.bfSize. Thank you! Commented Apr 29, 2016 at 7:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .