Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要知道使用“initWithContentsOfFie”加载的文件中使用了哪种图像文件类型,因为我不想信任文件扩展名。
不幸的是,我在 NSImage 和 NSImageRep 中找不到任何有关格式的信息,
NSImage不保留该信息,因为它没有进一步的用途。您需要下拉CGImageSource以获取所需的信息。
NSImage
CGImageSource