无论如何,是否有(命令行工具)为.NEF(还有.CR2,.TIFF)计算MD5哈希值? [英] Is there anyway (commandline tools) to calculate MD5 hash for .NEF (also .CR2, .TIFF) regardless any metadata?

查看:66
本文介绍了无论如何,是否有(命令行工具)为.NEF(还有.CR2,.TIFF)计算MD5哈希值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论如何,(命令行工具)是否都可以为.NEF(也包括.CR2,.TIFF)计算MD5哈希,而无需考虑任何元数据,例如EXIF,IPTC,XMP等?

Is there anyway (commandline tools) to calculate MD5 hash for .NEF (also .CR2, .TIFF) regardless any metadata, e.g. EXIF, IPTC, XMP and so on?

一旦我们更新了图像文件中的任何元数据,MD5哈希就应该相同.

The MD5 hash should be same once we update any metadata inside the image file.

我搜索了一会儿,最接近的解决方案是:

I searched for a while, the closest solution is:

exiftool test.nef -all= -o - -m | md5

,但是'exiftool -all ='仍然在输出文件中保留一组EXIF标记.如果我更新其余标签,则可以更改MD5哈希值.

but 'exiftool -all=' still keeps a set of EXIF tags in the output file. The MD5 hash can be changed if I update remaining tags.

推荐答案

ImageMagick 有一种完全可以做到这一点的方法.它已安装在大多数Linux发行版中,并且可用于OSX(最好通过 homebrew )和Windows.图像签名有一个转义符,其中仅包含像素数据,不包含元数据-您可以像这样使用它:

ImageMagick has a method for doing exactly this. It is installed on most Linux distros and is available for OSX (ideally via homebrew) and also Windows. There is an escape for the image signature which includes only pixel data and not metadata - you use it like this:

identify -format %# _DSC2007.NEF
feb37d5e9cd16879ee361e7987be7cf018a70dd466d938772dd29bdbb9d16610

例如,当您修改PNG文件中的元数据时,我知道它会做您想要的事情,并且计算出的校验和不会改变,并且我知道它确实为 CR2 NEF 文件.但是,在这种情况下,我不习惯修改RAW文件(例如,您已经测试过并且尚未测试)的正确做法-尽管如果不这样做,我会感到惊讶!因此,请在使用前进行测试.

I know it does what you want and that the calculated checksum does not change when you modify the metadata on PNG files for example, and I know it does calculate the checksum correctly for CR2 and NEF files. However, I am not in the habit of modifying RAW files such as you have and have not tested it does the right thing in that case - though I would be startled if it didn't! So please test before use.

这篇关于无论如何,是否有(命令行工具)为.NEF(还有.CR2,.TIFF)计算MD5哈希值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆