Linux命令行图像文件工作

从验证文件格式到查找相片从何地拍取

  • 分享脸书
  • 分享Twitter
  • 共享链接
  • 共享eddit
  • 分享邮箱
  • 打印资源
Penguinadmin24px
莫伊尼

Linux图像文件查看或操作的最佳方式是打开桌面浏览或操作Gimp等工具,但有几条方法获取命令行重要细节

文件扩展识别图像类型

一般来说,图像文件可以通过列名识别命令行.jpg表示jpeg文件,.png表示移动网络图形文件,.gif表示图形交换格式文件,.tiff表示贴标签图像文件等

$s-l图片-rw-r256093Jl152018 mycts.jpg-r1shshshs784238JU152018 mycts.png-rw-rsshshshs6760JU1520181shsh8853JU152018箭头.png

几乎所有时间你都可依赖文件扩展精确报告文件类型,但更多命令你还可以做

识别带文件命令的图像

上头文件库命令通过从文件本身提取数据识别图像文件类型

$fileEmmy.jpgEmmy.jpg:JPEG图像数据,累进式精度8,704x5843

下文件显然是jpg文件,尽管它名存实存输出出文件库命令报告此 。

$文件阵营.png.pngJPEG图像数据JFIF标准1.01、分辨率二二二x八十八、日期二零八零四0.554、GPS-Data]、累进精度83465x2717

mostjpg文件这些天文件库命令将显示更多细节,如上下示例输出包括文件类型、解析细节和关于图像出自何地和取自何地的大量信息

file tulip_polar.jpg图lip_polar.jpg:JPEG图像数据Exif标准山星市软件=A526USQS5CC9定向=左上端日期2022:05:171958:50宽度=2448] 基准精度824482448组件3

从上方输出可见图lip_polar.jpg文件于2022年5月17日取用三星手机

使用 八进制转储查看图像细节

可使用图像细节查看md-bc命令透视前几行显示图像本身部分无济于事文件第一部分包含“meta信息”(数据描述内容而非图像内容本身)。举例说,下方第二行识别文件为png文件

od-bc椰子.png+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++PNG032N000rlHDR000200000112740000010257000000001725100000000

使用exiftool提取图像细节

显示图像元数据的另一个工具是exiftool.下示例命令中,我们可以看到png文件的广泛细节

exiftols.pngExifTool版本号:12.42文件名:coces.png目录:.File Size                       : 5.3 MB File Modification Date/Time     : 2023:01:19 16:18:18-05:00 File Access Date/Time           : 2023:01:19 16:18:34-05:00 File Inode Change Date/Time     : 2023:01:19 16:18:18-05:00 File Permissions                : -rw-r--r-- File Type                       : PNG File Type Extension             : png MIME Type                       : image/png Image Width                     : 2492 Image Height                    : 2223 Bit Depth                       : 8 Color Type                      : RGB with Alpha Compression                     : Deflate/Inflate Filter                          : Adaptive Interlace                       : Noninterlaced Pixels Per Unit X               : 11811 Pixels Per Unit Y               : 11811 Pixel Units                     : meters Profile Name                    : Photoshop ICC profile Warning                         : Install Compress::Zlib to read compressed information ICC Profile                     : (Binary data 2616 bytes, use -b option to extract) White Point X                   : 0.31269 White Point Y                   : 0.32899 Red X                           : 0.63999 Red Y                           : 0.33001 Green X                         : 0.3 Green Y                         : 0.6 Blue X                          : 0.15 Blue Y                          : 0.05999 Image Size                      : 2492x2223 Megapixels                      : 5.5

下文件取自2016年细节存储图像文件本身 异常广度内容不单包括照片拍摄时间细节, 也包括照片拍摄地点注意GPS经度测量

exiftote myboy.jpgExifTool版本号12.42文件名:myboy.jpg目录File Size                       : 3.4 MB File Modification Date/Time     : 2021:05:25 15:31:09-04:00 File Access Date/Time           : 2023:01:01 15:44:38-05:00 File Inode Change Date/Time     : 2021:05:25 15:31:09-04:00 File Permissions                : -rw-r--r-- File Type                       : JPEG File Type Extension             : jpg MIME Type                       : image/jpeg Exif Byte Order                 : Little-endian (Intel, II) Make                            : samsung Camera Model Name               : SM-G935V Orientation                     : Rotate 90 CW X Resolution                    : 72 Y Resolution                    : 72 Resolution Unit                 : inches Software                        : G935VVRU2APD2 Modify Date                     : 2016:06:16 13:54:56 Y Cb Cr Positioning             : Centered Exposure Time                   : 1/245 F Number                        : 1.7 Exposure Program                : Program AE ISO                             : 50 Exif Version                    : 0220 Date/Time Original              : 2016:06:16 13:54:56 Create Date                     :2016:06:16 13:54:56Components Configuration        : Y, Cb, Cr, - Shutter Speed Value             : 1/245 Aperture Value                  : 1.7 Brightness Value                : 5.2 Exposure Compensation           : 0 Max Aperture Value              : 1.7 Metering Mode                   : Center-weighted average Light Source                    : Unknown Flash                           : No Flash Focal Length                    : 4.2 mm Maker Note Version              : 0100 Device Type                     : Cell Phone Raw Data Byte Order             : Little-endian (Intel, II) Raw Data CFA Pattern            : Swap Face Detect                     : Off User Comment                    : .Flashpix Version                : 0100 Color Space                     : sRGB Exif Image Width                : 4032 Exif Image Height               : 3024 Interoperability Index          : R98 - DCF basic file (sRGB) Interoperability Version        : 0100 Sensing Method                  : One-chip color area Scene Type                      : Directly photographed Exposure Mode                   : Auto White Balance                   : Auto Focal Length In 35mm Format     : 26 mm Scene Capture Type              : Standard Image Unique ID                 : C12QSJB01SB GPS Latitude Ref                : North GPS Longitude Ref               : West GPS Altitude Ref                : Unknown (1.7) GPS Time Stamp                  : 17:54:32 GPS Date Stamp                  : 2016:06:16 Compression                     : JPEG (old-style) Thumbnail Offset                : 6142 Thumbnail Length                : 15400 Image Width                     : 4032 Image Height                    : 3024 Encoding Process                : Baseline DCT, Huffman coding Bits Per Sample                 : 8 Color Components                : 3 Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2) Time Stamp                      : 2016:06:16 13:54:56-04:00 Aperture                        : 1.7 Image Size                      : 4032x3024 Megapixels                      : 12.2 Scale Factor To 35 mm Equivalent: 6.2 Shutter Speed                   : 1/245 Thumbnail Image                 : (Binary data 15400 bytes, use -b option to extract) GPS Altitude                    : 0 m Above Sea Level GPS Date/Time                   :2016:06:16 17:54:32ZGPS纬度 :39度3'8.04'GPS经度:78德克22'1380Circle Of Confusion             : 0.005 mm Field Of View                   : 69.4 deg Focal Length                    : 4.2 mm (35 mm equivalent: 26.0 mm) GPS Position                    : 39 deg 3' 8.04" N, 78 deg 22' 13.80" W Hyperfocal Distance             : 2.14 m Light Value                     : 10.5

当然,我现在非常好奇 圆圈混淆场更多信息exiftool输出前列可用照片上你了解什么

ASCII图像浏览

取命令行图像的另一种方式是使用工具显示字符格式图像内容换句话说,图像显示为字符,对一些工具而言,字符和颜色复制图像工作原理取决于图像本身和工具使用一种工具调用Ing2txt.假设我把颜色写进下方图像 你可能能识别向你挥手的企鹅

$ img2txt penguin.png                                                  @                                                S8X                                               S888        8888@88XX8                           %@888@     ;88%88@@X888tS8                        S8888@X    @SS%tS:8 8S8t8@:!;@8888@8   t8;.;%SXX@888@@88                    8S8888888@   88:.;%888@88X: @@ %                 X88888888@X  %X8;;88S8%X88XS:.S  8              88@8888888@X  X8S%t8 ;:t8.St% 8%.;@             88@8888888@@  St888X8888@ 8888;888X8          X8X888888888X ;t:X8888888888:888888S@8        X@X88@88@8@@   .S8888888@8@8@888tX% 888     8@88888888@    %@X888@%88SX8X8%@:S88@888  8888888@88  ;tSS@8 88.8S888:8@%XS%:88888@@8888@8  SSS%t%S%X8 @888SX@X8%tt88@X8@@8% .%  8XXS%t%tX8:  8XX@88:@;;;tS8%S;%S!:% 8XX;##T#SXS@8XX;X;;t#XS.:%X.S8@S%8X%X8S0Ss%S8X8T888t X8SXQQQQXt

总结

查看命令行图像文件不太可能产生深怀旧感知,但您可以提取许多有趣的图像细节来告诉你图片类型、照片拍时和地点以及用何种设备拍照片

关联性 :

Raybet2版权2023IDG通信公司

十大企业联网2022