如何识别镜像文件的格式和特征

时间:2020-01-09 10:39:16  来源:igfitidea点击:

要识别镜像文件的格式和特征,您需要使用称为identify的命令。

它还会报告镜像是否不完整或损坏。
显示的信息包括场景编号,文件名,镜像的宽度和高度,是否将镜像进行了颜色映射,镜像中的颜色数量,镜像中的字节数,镜像格式( JPEG,PNM等),最后是读取和处理镜像所需的秒数

如果您希望提供脚本解决方案来自动执行任务,那么此命令是最佳选择。

$ identify -verbose snap-S25-20060218-235000-1.ppm | less

输出:

Image: snap-S25-20060218-235000-1.ppm
Format: PNM (Portable anymap)
Geometry: 768x576
Class: DirectClass
Colorspace: RGB
Type: TrueColor
Depth: 8 bits
Endianess: Undefined
Channel depth:
  Red: 8-bits
  Green: 8-bits
  Blue: 8-bits
Channel statistics:
  Red:
    Min: 0
    Max: 255
    Mean: 87.5478
    Standard deviation: 89.9707
  Green:
    Min: 0
    Max: 255
    Mean: 73.0576
    Standard deviation: 84.7219
  Blue:
    Min: 0
    Max: 255
    Mean: 53.6681
    Standard deviation: 73.7701
Colors: 163423                                        
Rendering-intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 1.3mb
Interlace: None
Background Color: grey100
Border Color: #DFDFDF
Matte Color: grey74
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
signature: ad1ac5b547203e393117aab
Tainted: False
User Time: 0.020u
Elapsed Time: 0:01