Extract image dimensions automatically

Is there a way to get an image’s width and height automatically in jekyll? I’m using photoswipe, which requires declaring the images dimensions to work. Closest solution I have found so far is this, but was wondering if there is another/better way.

If you can install Jekyll plugins, I believe jekyll-assets can spit out the width/height of an image.

Yes, I can install plugins. I looked into jekyll-assets a while back, but all the references to image dimensions I found were for a fairly old version, and using the supplied syntax did not work. Not sure if this feature was removed with version 3.

You can force image resizing, using images.weserv.nl. It can solve all your image problems. :slight_smile: