I need to find size of a .jpg file without its header (or metadata). How can I do that?
I guess JPEG data contains two parts:
- Header or metadata which is not related to image and has information about subsampling values or quantization table
- Main data which is result of compressing the image and depends on image. For a reason, I just care about size of main data. How can I get the size (in bytes)?
Thanx for comments. As Anon Coward said I've found this useful image which shows different parts of a JPEG file:
I wanted length of
Image Dataso I need to find0xFF 0xDAand count bytes from there, then subtract 16 from it. Here is the code: