In order to speed up my image processing, I use the jpeg:size hint to give the JPEG decoder more efficiency.
However, I don't want to do this blindly. How can I detect an image type from the raw bytes before calling BlobToImage?
I could write code to inspect the header, but I think Imagemagick should be able to do this too?
Detecting Image type from raw bytes
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Detecting Image type from raw bytes
see string format at http://www.imagemagick.org/script/escape.php
%m image file format (file magic)
%m image file format (file magic)
Code: Select all
identify -format "%m" yourimage
Re: Detecting Image type from raw bytes
I am doing this in-memory with the MagickCore interface. I need to determine an image type from the raw bytes before calling BlobToImage