Lothar
Lothar

Reputation: 13067

How can i find the file type after loading NSImage withContentsOfFile

I need to know which image file type was used in the file i loaded with "initWithContentsOfFie" because i don't want to trust the file extension.

Unfortunately i can't find anything about the format in NSImage and NSImageRep,

Upvotes: 0

Views: 1298

Answers (1)

Mike Abdullah
Mike Abdullah

Reputation: 15003

NSImage doesn't keep that information, because it's of no further use. You'll need to drop down to CGImageSource to get the info you want.

Upvotes: 2

Related Questions