png - How to identify a NSData's image format? -


If I get an NSData that I know is the data of an image. But I do not know what this format is. So how can I identify which format is the format? JPEG or PNG?

PS: IOS

You can see and guess the first byte Are there. There are several lists of magic numbers available on the Internet, e.g. .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

ruby on rails - Convert a Activerecord result with has_one associations into a single hash per record -

c# - GetType() == type perfomance question -