Reputation: 646
I would like to ask you if there is any way how to get information(bool value) if the file is jpeg.
I solved it in png like this:
bool isPng = !png_sig_cmp(reinterpret_cast<png_const_bytep>(header), 0, number);
I tried to search on the internet and read the documentation of jpeglib
, but didn't solve it.
Thank you for your answers.
Upvotes: 0
Views: 182
Reputation: 847
If you read the first few bytes of the file you should see the JFIF characters in a jpeg. Using jpeglib
you can attempt to read the header data and fail on that.
Upvotes: 2