GjjvdBurg / HugoPhotoSwipe

Command-line tool for easy PhotoSwipe galleries in Hugo
https://gertjanvandenburg.com/blog/hugophotoswipe/
GNU General Public License v3.0
128 stars 15 forks source link

error doing `hps update` #41

Open ghost opened 1 year ago

ghost commented 1 year ago

The photos folder contain iPhone images (I removed MOV files since these caused problems):

> hps update
[2023-09-10 18:06:06] - Skipping non-album directory: resources
[2023-09-10 18:06:06] - Skipping non-album directory: themes
[2023-09-10 18:06:06] - Skipping non-album directory: content
[2023-09-10 18:06:06] - Skipping non-album directory: archetypes
[2023-09-10 18:06:06] - Skipping non-album directory: static
[2023-09-10 18:06:06] - Skipping non-album directory: public
[2023-09-10 18:06:06] - Skipping non-album directory: git
[2023-09-10 18:06:06] - Skipping non-album directory: layouts
[2023-09-10 18:06:06] - Skipping non-album directory: data
Updating album: tOKvdGhp
[2023-09-10 18:06:07] - [2023-07-29_18-10-50.JPG] Scaling up image from (1119, 920) to (1600, 1315). Scaling up may not be desirable.
[2023-09-10 18:06:09] - [2023-08-23_16-53-16.JPG] Scaling up image from (1200, 824) to (1600, 1099). Scaling up may not be desirable.
[2023-09-10 18:06:09] - [2023-08-23_16-53-25.JPG] Scaling up image from (1200, 824) to (1600, 1099). Scaling up may not be desirable.
[2023-09-10 18:06:09] - [2023-08-23_17-05-53.JPG] Scaling up image from (1150, 751) to (1600, 1045). Scaling up may not be desirable.
[2023-09-10 18:06:09] - [2023-08-23_17-06-42.JPG] Scaling up image from (1170, 763) to (1600, 1043). Scaling up may not be desirable.
Traceback (most recent call last):
  File "/home/me/.local/bin/hps", line 8, in <module>
    sys.exit(main())
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/__main__.py", line 13, in main
    sys.exit(realmain())
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/ui.py", line 50, in main
    hps.update(name=album)
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/hugophotoswipe.py", line 55, in update
    self.update_all() if name is None else self.update_single(name)
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/hugophotoswipe.py", line 60, in update_all
    album.update()
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/album.py", line 340, in update
    photo.create_sizes()
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/photo.py", line 141, in create_sizes
    self.create_thumb(mode="thumb", pth=self.thumb_path)
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/photo.py", line 177, in create_thumb
    return self.create_thumb_py(mode=mode, pth=pth)
  File "/home/me/.local/lib/python3.10/site-packages/hugophotoswipe/photo.py", line 209, in create_thumb_py
    ret = sc.crop(img, crop_width, crop_height)
  File "/home/me/.local/lib/python3.10/site-packages/smartcrop/library.py", line 158, in crop
    Image.Resampling.LANCZOS)
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 65, in __getattr__
    raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
AttributeError: module 'PIL.Image' has no attribute 'Resampling'
GjjvdBurg commented 1 year ago

Thanks for reporting this issue, I believe this should be fixed in v0.3.1

squaregoldfish commented 11 months ago

FYI: I was still seeing this with v0.3.1 on my Ubuntu 22.04 installation (which has Pillow 9.0.1). Setting up a separate pipenv for hugophotoswipe allowed it to download Pillow 10.1.0 and everything was fine.