New version of readDir for images with EXIF data


I’ve stumbled upon this new feature and I thought I would be useful to read the EXIF data of images to generate cool galleries with adanced informations or maps with GPS data from those images.

I would like to propose a new function readImages which works the same way as readDir but readImages returns within the for _, img := range readImages $path loop a new struct containing all file information from os.FileInfo and on top important EXIF data, not all but many of them (we can add more later). The only library I’ve found without importing C is

Available EXIF fields:

Any thoughts? Maybe a better name for the function or which fields to include in the new EXIF struct?

Go or No-Go?


I think this would be a handy feature to have and would be very useful.

I’ve been thinking quite a bit about expanding the definition of content. I’m putting together some slides this week (hopefully) that will explain this thinking a bit more…

In short the concept is that content means more than just text and front matter meta data. Images are content and have their own meta data. It would be great if they were treated as such. All of the rules around nodes & pages would be extended to these alternative content types.

Ultimately the difference in these two approaches is that the readDir / readImage approach works outside of what Hugo already gives you where the approach I’m thinking works inside of Hugo…

I admit it’s a bit rough today and there’s no reason to suppose that both approaches shouldn’t be used. Just as ReadDir works alongside the Hugo content processing today.

Perhaps just seeing what I’m thinking would help you design your feature in a way that could be leveraged further in the future. In fact, the more I think about it the more I think what you’ve outlined may be step 1 towards what I’m thinking.


Great thoughts. That means we can even add more content-types. No need to hurry with your slides. I’m off to FOSDEM.


Hello there,

First, sorry for reviving this post, but I found it while searching if it would be possible to read EXIF from my photos and build a gallery with title/aperture/speed/etc.

I have no idea if it’s possible now, do you have any news on this feature ?

Thank you very much.