如何从图像中获取 EXIF 或元数据?
我需要一个非常好的库或命令行软件,可以用来从图像中提取 Exif 数据。没有特定的编程语言,除了库或软件必须运行良好。
我找到了各种 PHP 和 Python 库,但其中大部分尚未更新或维护,并且不适用于各个制造商。我浪费了很多时间只是为了找到有用的东西。
有人知道 Flickr 使用什么来获取 Exif 数据吗?也许这可以回答问题。
感谢您的帮助
I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well.
I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and don't work for various manufactures. I wasted a lot of time just to find something that works.
Anyone knows what Flickr uses to get Exif data? Maybe that might answer the questions.
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
没错,这就是你想要的。
http://www.sno.phy.queensu.ca/~phil/exiftool/
了解 flickr 的功能!
Right this is what you want.
http://www.sno.phy.queensu.ca/~phil/exiftool/
Gets what flickr does!
Gimp 的 Exif 查看器插件 使用 libexif,是C写的,最近好像更新了。另外,如果您想推出自己的标准,这里是 EXIF 标准本身。
The Gimp's Exif Viewer plugin uses libexif, which is written in C and seems to have been updated recently. Also, here is the EXIF standard itself, if you feel like rolling your own.
jhead 是一个很棒的命令行 EXIF 实用程序;它可以读取和写入 EXIF 数据。我什至最近更新了(2009 年 11 月)!
您可以下载适用于许多不同平台(包括 Linux、Mac OS X 和 Windows)的二进制文件。
jhead is a great command-line EXIF utility; it can both read and write EXIF data. I was even updated recently (November 2009)!
You can download binaries for many different platforms (including Linux, Mac OS X and Windows).
查看
exif_read_data()
(PHP)。Take a look into
exif_read_data()
(PHP).你有没有发现如果PHP是用--enable-exif编译的 它将有一个用于处理 EXIF 数据的 API?如果您确实找到了它,那么这顶帽子是否不能满足您的要求?
Did you not find that if PHP is compiled with --enable-exif that it will have an API for handling EXIF data? If you did find it, was hat one that doesn't do what you require?
您检查过这篇文章以及那里指向的模块吗?鉴于 Exif 的标准性质,理论上,一旦完全满足标准,就不需要进一步开发,也不需要制造商特定的调整,对吗?-)
Have you checked this article and the modules pointed to from there? Given the standard nature of Exif, in theory, once you fully meet the standard there should be no need for further development, nor for manufacturer-specific tweaks, right?-)
对于perl,有 Image::ExifTool 和 Image::EXIF 。
第一个由“exiftool”使用,它能够从图像中读取大量元信息(也可以是除 exif 之外的其他格式)。
For perl, there is Image::ExifTool and Image::EXIF.
The first is used by the "exiftool", which is capable of reading lots of meta informations (also in other formats then exif) from images.
您可以查看 exiv2。我使用命令行版本批量重命名所有照片,以在文件名中包含时间戳。
在任何脚本环境中使用都应该相当简单。
You could take a look at exiv2. I used the command line version to bulk rename all my photos to include a timestamp in the filename.
Should be fairly straighforward to use from any scripting environment.
我写了 pexif,它对我来说效果很好。它是纯Python,所以应该很容易扩展。它还允许您编辑 exif 字段(如果您愿意,我编写它是为了向我的照片添加 GPS 标签)。
主要缺点是它对制造商标签的支持有限,但如果我得到可用于测试的示例图像,我很乐意添加该支持。
我还编写了 JavaScript 版本,但是这纯粹是只读的。
I wrote pexif, which works pretty well for me. It is pure python, so should be easy to extend. It also lets you edit exif fields, (if you want, I wrote it to add GPS tags to my photos).
The major down side is that it has limited support for manufacturer tags, but I'm happy to add that support if I'm given example images that I can use for testing.
I've also written a JavaScript version, however this is purely read-only.