Goal c: How to find out image inspector information

I would like to find out information about the photo in the inspector. Is there any way to get this information from objective-c.

enter image description here

The above screenshot is a sample inspector window. I would like to get information about this window using target c. Thanks!

+4
source share
1 answer

While you can get most of these properties using NSImage or CGImage , I would look at ImageIO.framework.
This has the advantage that it can read the headers of several image formats without reading the entire image in RAM.
Apple provides an example application that does exactly what you need: ImageApp

Information on obtaining metadata with ImageIO can also be found in the Image I / O Programming Guide "Viewing Image Properties" .

To get file metadata, you can use NSFileManager attributesOfItemAtPath::

 NSError* error = nil; NSDictionary* fileAttributeDict = [[NSFileManager defaultManager] attributesOfItemAtPath:imageFilePath error:&error]; NSLog(@"creation date:%@\nmodification date:%@", fileAttributeDict.fileCreationDate, fileAttributeDict.fileModificationDate); 
+5
source

Source: https://habr.com/ru/post/1480614/


All Articles