# Exif / IPTC

**URL:** <https://discourse.gohugo.io/t/exif-iptc/25995>\
**Category:** Uncategorized\
**Created:** [June 2, 2020, 10:26am UTC](https://discourse.gohugo.io/t/exif-iptc/25995 "2020-06-02T10:26:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![willduncanphoto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willduncanphoto/32/11840_2.png) [@willduncanphoto](https://discourse.gohugo.io/u/willduncanphoto)\
**Post date:** [June 2, 2020, 10:26am UTC](https://discourse.gohugo.io/t/exif-iptc/25995/1 "2020-06-02T10:26:59Z")

</div>

I see that exif is supported now, when I originally looked at HUGO it wasn’t, so I had to dismiss Hugo as an option.

I am curious if there is more extensive documentation on exif data and IPTC.

Ideally, I’d like to pull data from the caption, copyright and creator/photographer fields from the IPTC data embedded in an image from a photographer or wire service, so when the image is processed/resized that data is extracted for use in a post. Is that even remotely plausible?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [June 2, 2020, 10:34am UTC](https://discourse.gohugo.io/t/exif-iptc/25995/2 "2020-06-02T10:34:05Z")

</div>

While I’m no expert on Exif vs IPTC (or where they overlap): From my tests from my photography produced from LigthtRoom with originals from my Pentax K3 II – the copyright/author etc. information is available as fields in Hugo’s `.Exif` object, so yes.

---

<div class="post-metadata">

**Author:** ![willduncanphoto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willduncanphoto/32/11840_2.png) [@willduncanphoto](https://discourse.gohugo.io/u/willduncanphoto)\
**Post date:** [June 2, 2020, 10:54am UTC](https://discourse.gohugo.io/t/exif-iptc/25995/3 "2020-06-02T10:54:30Z")

</div>

Thanks. I didn’t see much in the documentation mentioned besides the basics core camera data.

I’ll spend some time tinkering and see how far I can get though. My dream is to generate a post, drop in a photo to the folder, and hit publish without having to input any redundant data since working in journalism, all the data is stored in the file.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [June 2, 2020, 11:05am UTC](https://discourse.gohugo.io/t/exif-iptc/25995/4 "2020-06-02T11:05:50Z")

</div>

I created this site to sell of some lenses some time ago, which shows some Exif data in play:

> **[Pentax DA\* 16-50mm f/2.8 ED AL](https://master--forsale1.netlify.app/pentax/da-16-50/)**
>
> Profesjonell, lyssterk og vêrtett normalzoom.

---

<div class="post-metadata">

**Author:** ![Horbes](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@Horbes](https://discourse.gohugo.io/u/Horbes)\
**Post date:** [August 6, 2021, 1:51pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/5 "2021-08-06T13:51:03Z")

</div>

As I understand it EXIF data is what the camera knows. It’s very good for the technical apsects, time, date, shutter speed etc. and you can get copyright details saved in the camera too. The IPTC data I think is typically added later by a person. So while EXIF is good for some things it couldn’t tell you something like: this is Mark playing football with his new friends at school.

So I think it would be great if IPTC could be accessed by Hugo. It would allow personalised captions on image galleries that are generated in Hugo.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [August 6, 2021, 2:03pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/6 "2021-08-06T14:03:04Z")

</div>

> [@Horbes](#):
>
> So while EXIF is good for some things it couldn’t tell you something like: this is Mark playing football with his new friends at school.

This is not true.

You can use the EXIF ImageDescription tag. A few years ago, when I tested how Adobe Lightroom updates tags, I found that it wrote the caption in three places:

```plaintext
[IFD0] ImageDescription 
[IPTC] Caption-Abstract
[XMP-dc] Description

```

> [@Horbes](#):
>
> I think it would be great if IPTC could be accessed by Hugo

Agreed.

---

<div class="post-metadata">

**Author:** ![Horbes](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@Horbes](https://discourse.gohugo.io/u/Horbes)\
**Post date:** [August 6, 2021, 3:13pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/7 "2021-08-06T15:13:19Z")

</div>

That’s really interesting. I’ve been using IrfanView. This is very easy to edit the IPTC data (just press the letter i twice) but there is no option to edit the EXIF data at all, only to copy it. So I guess it depends which image editing software you use then. I will have to have a look at Lightroom.

Presumably you can access that with `.Exif.Tags.ImageDescription` then?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [August 6, 2021, 3:28pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/8 "2021-08-06T15:28:16Z")

</div>

> [@Horbes](#):
>
> Presumably you can access that with `.Exif.Tags.ImageDescription` then?

Yes, you can.

Phil Harvey’s [ExifTool](https://exiftool.org/) makes it really easy from the command line:

```bash
exiftool -ImageDescription="This is my dog Rover." foo.jpg

```

---

<div class="post-metadata">

**Author:** ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)\
**Post date:** [August 6, 2021, 5:03pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/9 "2021-08-06T17:03:58Z")

</div>

> [@jmooring](#):
>
> You can use the EXIF ImageDescription tag.

The problem with EXIF is that they prescribe 7 bit ASCII for character strings. Although nowadays, many programs seem to ignore that and simply use UTF-8, one can’t be sure that this is the case everywhere.

Therefore, IPTC with its UTF8 strings and many tags (title, description, keywords, location names …) is a lot more useful for human-generated metadata than EXIF.

---

<div class="post-metadata">

**Author:** ![Horbes](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@Horbes](https://discourse.gohugo.io/u/Horbes)\
**Post date:** [August 6, 2021, 9:04pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/10 "2021-08-06T21:04:03Z")

</div>

That’s a nifty little tool. I can use this with ImageDescription. But I can see that images using the IPTC Caption in IrfanView are storing them in `Caption-Abstract` so it would be useful if I could use that too.

But I’m not sure how to access that field. Hugo can’t use the hyphen. I tried camel case `Tags.CaptionAbstract` and also `{{ with ..Exif }}{{ eq .Tags "Caption-Abstract" }}{{ end }}`. These don’t cause Hugo to stop but they’re not grabbing the data either.

Any suggestions?

Thanks again for your help.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [August 6, 2021, 9:15pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/11 "2021-08-06T21:15:03Z")

</div>

`Caption-Abstract` is an IPTC tag, not an EXIF tag.

When you examine a file with exiftool, use the `-g` option to organize output by tag group.

```auto
exiftool -g foo.jpg

```

To copy the `Caption-Abstract` to the `ImageDescription`:

```auto
exiftool "-ImageDescription<Caption-Abstract" foo.jpg

```

---

<div class="post-metadata">

**Author:** ![Horbes](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@Horbes](https://discourse.gohugo.io/u/Horbes)\
**Post date:** [August 6, 2021, 9:41pm UTC](https://discourse.gohugo.io/t/exif-iptc/25995/12 "2021-08-06T21:41:54Z")

</div>

Thanks. I’ll have a play with that tomorrow.
