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

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

问题描述

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

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

为了减小文件大小,我们使用mogrify:

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(IPTC 标签格式取自 这里):

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"

从图像中去除所有现有的 exif 数据

Strip all existing exif data from the image

mogrify -strip image.jpg

为您的图片添加功劳

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

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

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