haltakov / simple-photo-gallery

Beautiful and simple photo galleries that help you tell your story. Free and open-source.
https://haltakov.net/simple-photo-gallery
MIT License
194 stars 51 forks source link

Something went wrong while generating the thumbnails: module 'PIL.Image' has no attribute 'ANTIALIAS' #127

Closed tnTano closed 6 months ago

tnTano commented 12 months ago

Hi, when i try to run gallery-build in WSL (after succesfully run 'gallery-init' i receive this output

Building the Simple Photo Gallery... Generating thumbnails... Something went wrong while generating the thumbnails: module 'PIL.Image' has no attribute 'ANTIALIAS'

and i not able to complete the creation of my gallery...

thanks for your help

ps: i installed this tool today so i'm with the latest version...

BBSiteUser commented 11 months ago

@tnTano Hi, i ran into the same error. The problems seems to arise from the Python-package "Pillow" (PIL) which deprecated the "ANTIALIAS" attribute on images from version 10 onward. If its any help to you, here's how I fixed it: uninstall Pillow version 10 ("pip uninstall Pillow") and re-install a specific version before version 10 (I used Pillow version 9.5.0 and simple photo gallery worked fine). Command to install 9.5.0 is: pip install Pillow==9.5.0

tnTano commented 11 months ago

Thanks, it's works!!!On Jul 24, 2023, at 11:38 AM, BBSiteUser @.> @. Hi, i ran into the same error. The problems seems to arise from the Python-package "Pillow" (PIL) which deprecated the "ANTIALIAS" attribute on images from version 10 onward. If its any help to you, here's how I fixed it: uninstall Pillow version 10 ("pip uninstall Pillow") and re-install a specific version before version 10 (I used Pillow version 9.5.0 and simple photo gallery worked fine). Command to install 9.5.0 is: pip install Pillow==9.5.0—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Jared-Hincy commented 10 months ago

For those of us who do not manage Python through pip, but rather the package manager of a distro that does not support downgrading... How long till simple-photo-gallery changes this function usage in favor of the one not deprecated? Pillow (PIL) has dropped ANTIALIAS since version 10...

mxbdev commented 6 months ago

A simple fix: the value ANTIALIAS = 1 , and is equivalent to LANCZOS = 1. This is documented in PIL near the top. The offending piece of code is in media.py in your local simple-photo-gallery source directory. Change ANTIALIAS to LANCSOS eg: In media.py change: image = image.resize(thumbnail_size, Image.ANTIALIAS) to image = image.resize(thumbnail_size, Image.LANCSOS) #or simply use the value 1 Worked for me.