Skip to main content
5 events
when toggle format what by license comment
Mar 14, 2016 at 17:26 vote accept Pedro Pelizzaro
Mar 14, 2016 at 17:26 comment added Pedro Pelizzaro Sorry for the several of days of delay between responses, but THANK YOU SO MUCH. Took quite some time to realize I should have multiplied biWidth for size of RGBTRIPLE. I didn't quite get what you meant, kept looking for the difference between int and long int :P Thanks a lot, man, off to recover.c!
Mar 7, 2016 at 22:40 comment added Cliff B That would be because you created the two new header structures without copying all of the data from the old to the new. There are a bunch of fields that you didn't copy. (Google the bitmap specification for BITMAPFILEHEADER AND BITMAPINFOHEADER.) However, there's a simple way to copy complete structures. As long as they're the same type, you can ` STRUCTTYPE struct_b = struct_a;` and then modify any fields in the new struct that you wish. (This was an example, STRUCTTYPE is merely a hypothetical type, not a keyword.)
Mar 7, 2016 at 22:31 comment added Pedro Pelizzaro How silly of me to make such basic mistakes. Anyway, I tried fixing those mistakes. Made some adaptations with it, will edit them on the main post. Now I'm getting invalid format, even though I copied all data of the file header. Sorry for asking this much, but could you have a look at the updated code? Thank you very much for the help so far.
Mar 7, 2016 at 20:06 history answered Cliff B CC BY-SA 3.0