【问题标题】:How to get the Color Profile data for an image on disk in swift如何快速获取磁盘上图像的颜色配置文件数据
【发布时间】:2016-10-10 12:24:49
【问题描述】:

无法完全了解如何以编程方式快速获取“更多信息”部分中任何给定照片的所有内容。我对颜色配置文件数据特别感兴趣。有什么想法吗?

【问题讨论】:

    标签: swift file cocoa nsimage


    【解决方案1】:

    原来很简单:

    let path = // Some Image path on disk
    let url = NSURL.fileURL(withPath: path)
    let imageSource = CGImageSourceCreateWithURL(url as CFURL, nil)
    if imageSource != nil {
    let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource!, 0, nil)
    var dict = imageProperties as! Dictionary<String, Any>
    print(dict["ProfileName"]!)
    }
    

    【讨论】:

      猜你喜欢
      • 2017-12-23
      • 1970-01-01
      • 2012-03-04
      • 2013-12-05
      • 1970-01-01
      • 2020-05-22
      • 2021-03-29
      • 2023-03-22
      • 1970-01-01
      相关资源
      最近更新 更多