How to remove a header from a file that is .bmp using objective c. I am getting 54 bytes extra. But in order to view image have to remove these 54 bytes and get actual image bytes.
NSData *data = [NSData dataWithContentsOfFile:snapshotFile options:0 error:&error];
NSBitmapImageRep *imagerep = [NSBitmapImageRep imageRepWithData:data];
NSData *bytes = [imagerep representationUsingType:NSBMPFileType properties:nil];
My image is of width = 1280 and height = 800, so total image bytes should be 800*1280*5= 4096000.
But when i checked for bytes calculated above it was 4096054 bytes.
It seems that 54 extra is header.
I want to remove these header bytes in order to get actual image.
Any help will be really appreciated.
And please excuse in case this has already been answered.