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

Cannot identify image file './public/images/thumbnails/document-error-outline.jpg' #101

Closed fastchain closed 3 years ago

fastchain commented 3 years ago

Hello,

I'm running the following commands (according to instructions) and get this:

(png)  ✘   ~/Downloads/png  pip install simple-photo-gallery
Collecting simple-photo-gallery
  Downloading simple_photo_gallery-1.4.0-py3-none-any.whl (2.5 MB)
     |████████████████████████████████| 2.5 MB 6.1 MB/s 
Collecting jinja2>=2.10.3
  Using cached Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting opencv-python>=4.2.0.32
  Downloading opencv_python-4.5.1.48-cp38-cp38-manylinux2014_x86_64.whl (50.4 MB)
     |████████████████████████████████| 50.4 MB 73 kB/s 
Collecting requests>=2.22.0
  Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 1.8 MB/s 
Collecting selenium>=3.141.0
  Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
     |████████████████████████████████| 904 kB 9.3 MB/s 
Collecting pillow>=7.0.0
  Downloading Pillow-8.1.0-cp38-cp38-manylinux1_x86_64.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB 10.7 MB/s 
Collecting MarkupSafe>=0.23
  Using cached MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl (32 kB)
Collecting numpy>=1.17.3
  Downloading numpy-1.19.5-cp38-cp38-manylinux2010_x86_64.whl (14.9 MB)
     |████████████████████████████████| 14.9 MB 5.9 MB/s 
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 9.1 MB/s 
Collecting idna<3,>=2.5
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting chardet<5,>=3.0.2
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
     |████████████████████████████████| 178 kB 9.8 MB/s 
Installing collected packages: MarkupSafe, jinja2, numpy, opencv-python, urllib3, certifi, idna, chardet, requests, selenium, pillow, simple-photo-gallery
Successfully installed MarkupSafe-1.1.1 certifi-2020.12.5 chardet-4.0.0 idna-2.10 jinja2-2.11.2 numpy-1.19.5 opencv-python-4.5.1.48 pillow-8.1.0 requests-2.25.1 selenium-3.141.0 simple-photo-gallery-1.4.0 urllib3-1.26.2
(png)    ~/Downloads/png  gallery-init
Creating a Simple Photo Gallery...
Creating the gallery config...
You can answer the following questions in order to set some important gallery properties. You can also just press Enter to leave the default and change it later in the gallery.json file.
What is the title of your gallery? (default: "My Gallery")
Png
What is the description of your gallery? (default: "Default description of my gallery")
description of png files
Which image should be used as background for the header? (default: "")

What is your site URL? This is only needed to better show links to your galleries on social media (default: "")

Gallery config stored in gallery.json
Copying gallery template files...
Moving all photos and videos to ./public/images/photos...
Simple Photo Gallery initialized successfully!
(png)    ~/Downloads/png  gallery-build
Building the Simple Photo Gallery...
Generating thumbnails...
Something went wrong while generating the thumbnails: cannot write mode RGBA as JPEG
(png)  ✘    ~/Downloads/png  ls               
gallery.json  Pipfile  public  templates
(png)    ~/Downloads/png  gallery-build
Building the Simple Photo Gallery...
Generating thumbnails...
Something went wrong while generating the thumbnails: cannot identify image file './public/images/thumbnails/document-error-outline.jpg'
(png)  ✘    ~/Downloads/png  ls public        
css  images  js
(png)    ~/Downloads/png  ls templates                   
gallery_macros.jinja  index_template.jinja
(png)   ~/Downloads/png  gallery-build
Building the Simple Photo Gallery...
Generating thumbnails...
Something went wrong while generating the thumbnails: cannot identify image file './public/images/thumbnails/document-error-outline.jpg'

What am I doing wrong?

Thank you!

(png folder filled with *.png files)

haltakov commented 3 years ago

I think I know what the problem is. It seems I'm not handling some specific PNG formats correctly. I'll try to reproduce and fix later today.

haltakov commented 3 years ago

The problem is fixed in version 1.4.1 which I just released. There was a bug handling PNG files in RGBA format.

To update, please run the following command:

pip install simple-photo-gallery --upgrade

I'll be happy about feedback if your issue is solved :)

fastchain commented 3 years ago

Thank you!

Now It's much better, but I still have issues with one PNG file

gallery-build                             

Building the Simple Photo Gallery...
Generating thumbnails...
/home/kkk/.local/share/virtualenvs/png-xZ0E5gSA/lib/python3.8/site-packages/PIL/Image.py:962: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
  warnings.warn(
Something went wrong while generating the thumbnails: cannot identify image file './public/images/photos/modularcolorexchange__2___1_.png'

I had to remove this file from folder to build gallery successfully.

If you'll need the problem file, I've uploaded it here: https://drive.google.com/file/d/1eK4iyy1Jdm7HbyXVFbuWxuouyp_3z-lf/view

Thank you.