如何使用命令行更改 Exif 中的相机信息

jcu*_*bic 3 command-line exif

我有模拟相机,我把胶片交给实验室,他们扫描它,我想将它上传到 flickr,但想更改有关相机的信息。现在它是NORITSU KOKI QSS-32_33,我希望它是pentax k1000(我不想清除 exif 数据)。如何从命令行执行此操作。

slm*_*slm 6

您正在寻找的工具称为 exiftool。您可以使用它的递归开关 ( -r)来读取和写入附加到单个图像或整个目录的文件的 exif 元数据。

要更改相机型号,您可以使用-model=".."开关。

例子

这是更改前的图像。

$ exiftool ff42403138dd5fa56e38efdaab2ced1435d0e28c.jpg 
ExifTool Version Number         : 9.27
File Name                       : ff42403138dd5fa56e38efdaab2ced1435d0e28c.jpg
Directory                       : .
File Size                       : 2.1 kB
File Modification Date/Time     : 2013:12:31 14:18:44-05:00
File Access Date/Time           : 2013:12:31 14:18:44-05:00
File Inode Change Date/Time     : 2013:12:31 14:18:44-05:00
File Permissions                : rw-------
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
Comment                         : CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 95.
Image Width                     : 50
Image Height                    : 50
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 50x50
Run Code Online (Sandbox Code Playgroud)

更改我的相机型号。

$ exiftool -model="sam's camera" ff42403138dd5fa56e38efdaab2ced1435d0e28c.jpg
Run Code Online (Sandbox Code Playgroud)

现在,当我们重新检查标签时。

$ exiftool ff42403138dd5fa56e38efdaab2ced1435d0e28c.jpg 
ExifTool Version Number         : 9.27
File Name                       : ff42403138dd5fa56e38efdaab2ced1435d0e28c.jpg
Directory                       : .
File Size                       : 2.3 kB
File Modification Date/Time     : 2013:12:31 14:19:14-05:00
File Access Date/Time           : 2013:12:31 14:19:14-05:00
File Inode Change Date/Time     : 2013:12:31 14:19:14-05:00
File Permissions                : rw-------
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Big-endian (Motorola, MM)
Camera Model Name               : sam's camera
X Resolution                    : 1
Y Resolution                    : 1
Resolution Unit                 : None
Y Cb Cr Positioning             : Centered
Comment                         : CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 95.
Image Width                     : 50
Image Height                    : 50
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 50x50
Run Code Online (Sandbox Code Playgroud)

还有另一个工具叫做exiv2,它可以做同样的事情exiftool,以防你感兴趣。

参考