Skip to content

Instantly share code, notes, and snippets.

@opieters
Last active July 10, 2022 17:50
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save opieters/756c86fdad219867c0f4 to your computer and use it in GitHub Desktop.
Save opieters/756c86fdad219867c0f4 to your computer and use it in GitHub Desktop.
Python script to generate configuration for a lightGallery photo gallery in Jekyll.
@ow
Copy link

ow commented Aug 2, 2016

Hey! I was just trying this out, and it works really well, but fails to deduce that two different sized images are the same image, despite a similar filename with a letter appended. When it's renaming, the images get renamed from DSCF2615.jpg to DSCF2615.jp-2048x1365.jpg so it feels like the .jp in the middle is something to do with it, but my Python-fu ain't so good. Any ideas? (And thanks for this, BTW)

@opieters
Copy link
Author

opieters commented Jan 9, 2017

@ow Sorry for the late reply. Could you give about 5 filenames of the directory you are using? Then I can try to replicate your problem on my system.

@jeremydouglass
Copy link

You might also want to add a comment that the other dependency is installed with pip install pyyaml -- especially helpful as "import yaml" doesn't match "install pyyaml".

@AsheBlade
Copy link

Hi opieters, I cannot thank you enough for your guide. Your guide is very easy to use and very easy to read. I followed your guide and made my gallery. If you wish, you can check it out here. However, I do have one question. Why did you include so many different size of images for one single picture? I don't get why you want to put them there. I only used one picture and it still works well.

@opieters
Copy link
Author

@jeremydouglass indeed! Thanks for pointing this out.

@opieters
Copy link
Author

@easonback26 thank you. Looking good! The idea is that only the optimal image is loaded for given a certain screen size to save bandwidth. For instance, on a phone with a small screen it's not needed to load the image at the highest resolution to get the same DPI. Normally, the libraries used should take care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment