我正在尝试使用imagemagick向图像添加注释并读取它
要添加注释,可以执行以下操作:
convert -comment "processed" original.jpg converted.jpg
现在,执行 identify -verbose converted.jpeg 命令会输出以下内容:
Properties:
comment: processed
date:create: 2017-05-17T12:22:36+06:00
date:modify: 2017-05-17T12:22:36+06:00
exif:ColorSpace: 1
exif:DateTime: 2017:02:04 12:21:36
exif:ExifImageLength: 1273
exif:ExifImageWidth: 900
exif:ExifOffset: 164
exif:Orientation: 1
exif:ResolutionUnit: 2
exif:Software: Adobe Photoshop CS5 Windows
exif:thumbnail:Compression: 6
exif:thumbnail:JPEGInterchangeFormat: 302
exif:thumbnail:JPEGInterchangeFormatLength: 3805
exif:thumbnail:ResolutionUnit: 2
exif:thumbnail:XResolution: 300/1
exif:thumbnail:YResolution: 300/1
有没有更简洁的方法来读取评论,而不是
identify -verbose converted.jpg | grep 'comment'