Note the {% exiftag image_description, , {{ image.path }} %} part: it works great.
However, I wonder how to use the same for PNG images? I am using a tool called SetEXIFData v9.2 (Marc's Place - SetEXIFData) via which I can confirm that I can include ImageDescription EXIFData to a PNG, just like to a JPG.
However, the {% exiftag image_description, , {{ image.path }} %} is not working for PNG images … it instead shows the image path.
How to make the caption work please for PNG images?
Additionally, I have a general question about plug-ins. I already added gem "exifr" in my Gemfile. And so (after bundle install or bundle update) I can retreive an exifr-1.3.9 in my vendor/bundle/ruby/gems folder. In it I can see a lib/exifr/ folder with inside the following files: jpeg.rb and tiff.rb
In the same lib/ folder there is also an exifr.rb file.
So I wonder why the tutorial asks me to also install a seperate exiftag.rb file inside my Jekyll main directory’s _plugins folder?
How do these plugins in the _plugins folder relate to the installed gems in the vendor/bundle/ruby/ folder please?
Would it be easy to provide a patch for the exifr gem, such that it works for PNG?
Currently I receive the error no start of image marker found in my terminal when including a PNG.
Yes you can use it. The top of the readme covers gem install. The repo is a mix of ruby and c code and you can treat it as a ruby gem to install and use a Jekyll plugin. It won’t work on standard GH Pages though, as with any unsupported plugin.
") which would be placed inside the _plugins folder.
I believe we would need something similar for Jekyll to be able to access an image’s EXIF data via GitHub - tonytonyjan/exif: The fastest Ruby EXIF reader. ? Because when I try data.image_description it doesn’t really work. The usage instructions there aren’t really understandable for a noob like me.
{% **exif data.image_description**, , {{ image.path }} %} is of course not working out of the box like that … I understand because there is no Jekyll tag defined.
If you add the gem to Gemfile and run bundle update, that is sufficient.
You should not run gem install exif as in the docs as that will install in a gems folder shared across projects.
exif is not a Jekyll plugin, just a Ruby gem. So it can go anywhere inside Gemfile. not in a plugin group and not in plugins key.
If you installed a gem with bundle, you can find it with
bundle open exif
Normally there should be no need to edit your own _plugins directory as Jekyll will look at the gem in your vendor gems.
You would need the _plugins directory if you want to write your own ruby code or copy and paste a single script plugin.
In this case it sounds like you want to use the existing Jekyll plugin which only handles jpeg and tiff and extend it. So you can do that with a script in plugins directory and do an import exif in ruby and use that.
If your adapted plugin is multiple files, then it is probably better to make a fork of the plugin you want to use, add exif to it and then install your forked plugin using a GitHub URL.
e.g.
group :jekyll_plugins do
gem "jekyll-exiftag", git: "https://github.com/MichaelCurrin/jekyll-exiftag"
end
Generally for gems that are Jekyll plugins, make sure it is inside the plugins group.
group :jekyll_plugins do
gem "jekyll-seo-tag"
end
Note that using a gem inside the plugins group as above is sufficient. You do not have to add to plugins key in the config. I’ve tested this with several plugins yes use of the plugins key still persists in documentation.