如何将exif数据添加到图像? [英] How do I add exif data to an image?

查看:200
本文介绍了如何将exif数据添加到图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的网站上,我们收到了大量从各种来源上传的照片。

On our site, we get a large amount of photos uploaded from various sources.

为了保持文件大小不变,我们删除所有 mogrify 的来源的exif数据:

In order to keep the file sizes down, we strip all exif data from the source using mogrify:

mogrify -strip image.jpg

我们希望能够做的是将一些基本的exif数据(版权所有Initrode等)插回到这个新的干净图像中,但我似乎无法在文档中找到任何内容实现这一目标。

What we'd like to be able to do is to insert some basic exif data (Copyright Initrode, etc) back onto this new "clean" image, but I can't seem to find anything in the docs that would achieve this.

有没有人有这方面的经验?

Has anybody any experience of doing this?

如果无法通过imagemagick完成,那么基于PHP的解决方案将是下一个最好的解决方案!

If it can't be done through imagemagick, a PHP-based solution would be the next best thing!

谢谢。

推荐答案

您可以节省大量空间,特别是如果您有大量图像..

You can save a large amount of space, especially if you have a large number of images..

将以下内容添加到text.txt(从这里):

Add the following to text.txt (format of the IPTC tags taken from here):

2#110#Credit="My Company"
2#05#Object Name="THE_OBJECT_NAME"
2#55#Date Created="2011-02-03 12:45"
2#80#By-line="BY-LINE?"
2#110#Credit="The CREDIT"
2#115#Source="SOURCE"
2#116#Copyright Notice="THE COPYRIGHT"
2#118#Contact="THE CONTACT"
2#120#Caption="AKA Title"

Strip来自图像的所有现有exif数据

Strip all existing exif data from the image

mogrify -strip image.jpg

将信用额度添加到您的图片

Add the credit to your image

mogrify -profile 8BIMTEXT:text.txt image.jpg

这篇关于如何将exif数据添加到图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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