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?
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.
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.
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.
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:
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?
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.
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.