VelinGeorgiev / django-photo-gallery

Responsive Django Image Gallery Site Sample optimized for performance and mobile devices
Apache License 2.0
203 stars 67 forks source link

Can't Upload Zip to the Albums #4

Open ghost opened 6 years ago

ghost commented 6 years ago

so all is fine, but when i try to uppload my archieve.zip i got this error. do you know why?

Request Method: POST

http://127.0.0.1:8000/admin/app/album/6/change/ 2.0.4 OSError cannot identify image file /usr/local/lib/python3.6/site-packages/PIL/Image.py in open, line 2585 /usr/local/opt/python/bin/python3.6 3.6.5 ['/Users/Desktop/django-photo-gallery/django_photo_gallery', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/Users/Library/Python/3.6/lib/python/site-packages', '/usr/local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/site-packages/email-6.0.0a1-py3.6.egg', '/usr/local/Cellar/numpy/1.14.3_1/libexec/nose/lib/python3.6/site-packages'] Thu, 2 Aug 2018 17:34:32 +0000

SKhakhulin commented 6 years ago

so all is fine, but when i try to uppload my archieve.zip i got this error. do you know why?

Request Method: POST http://127.0.0.1:8000/admin/app/album/6/change/
2.0.4 OSError
cannot identify image file /usr/local/lib/python3.6/site-packages/PIL/Image.py in open, line 2585
/usr/local/opt/python/bin/python3.6
3.6.5 ['/Users/Desktop/django-photo-gallery/django_photo_gallery', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/Users/Library/Python/3.6/lib/python/site-packages', '/usr/local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/site-packages/email-6.0.0a1-py3.6.egg', '/usr/local/Cellar/numpy/1.14.3_1/libexec/nose/lib/python3.6/site-packages'] Thu, 2 Aug 2018 17:34:32 +0000

I think you have some hidden files in the zip file.

VelinGeorgiev commented 5 years ago

@iocohen were you able to resolve that? Perhaps you can take a look at what @SKhakhulin commented.

@SKhakhulin thanks for your help!

VelinGeorgiev commented 5 years ago

Closing due to lack of response. Feel free to reopen if needed.

bassory99 commented 5 years ago

Hi ! I have the same issue. I checked and there is no hidden files in the zip. Do you have any other hint?

VelinGeorgiev commented 5 years ago

@bassory99 , Could you provide me with some more details please. If you can type some steps to reproduce so I can try and reproduce it, this would be very beneficial for me.

bassory99 commented 5 years ago

Thanks for your quick response. Basically I just tried to create a new album and attached a zip file.

  1. Installation of the demo app according to the procedure (https://github.com/VelinGeorgiev/django-photo-gallery)
  2. Execution on port 8989, and successful connection to the admin with admin/admin
  3. Creation of new album, including selection of a zip file containing only 3 jpeg files
Capture d’écran 2019-07-18 à 21 48 33 Capture d’écran 2019-07-18 à 21 48 46

OSError.pdf

VelinGeorgiev commented 5 years ago

Thank you very much @bassory99! I will try to reproduce it in the next days and see if I can fix it.

VelinGeorgiev commented 5 years ago

I have tried to reproduce it, but I could not with python 3.6.1 x32. So I tried with 3 jpegs in a zip Screenshot 2019-07-19 at 01 11 13 But it was a success for me. Screenshot 2019-07-19 at 01 05 34

I will try tomorrow with the x64 version of python 3.6.1 to see if it would crash for me.

bassory99 commented 5 years ago

thanks a lot for this feedback, I will also try it with Python 3.6

bassory99 commented 5 years ago

I think the issue is not related to the version of Python, I just tried it with a Python 3.6.0 virtualenv and still got the same error

Capture d’écran 2019-07-19 à 06 44 03 Capture d’écran 2019-07-19 à 06 44 39 Capture d’écran 2019-07-19 à 06 44 51
JOFLIX commented 5 years ago

I had the same issue, only to realize that this library doe not allow for deletion; I just had to make the app not vissible and create a new album, I think the problem is that you are trying to add a zip to a zip which has proved to be problematic,

bassory99 commented 5 years ago

I am not trying to delete anything, and the zip only contain pictures

FrankFeng-23 commented 4 years ago

Hi! Yesterday I had the same problem. I've tried all methods I could know, but failed eventually. BTW, I ran the program on MacOS yesterday. But today the program can successfully run on Windows. It turns that the issue is close related to the operating system. If everyone fails on MacOS or Linux, perhaps Windows is a good option.

FrankFeng-23 commented 4 years ago

I guess I just found something interesting. The program successfully runs on my Mac, beacause I don't use the Catalina10.15 build-in uncompressing tool. I just tried another tool called Keka, and it was a success for me.

rshah7924 commented 4 years ago

Hi there, I am facing this same issue as well. I created a new admin account and created a zip file for all of my images (25 PNG images) and I am getting the same error when saving the zip file. Has anyone happened to solve this issue without having to switch to Windows?

leeivan1007 commented 4 years ago

@rshah7924 you can just use the package by python. `>>> import zipfile

zf = zipfile.ZipFile('test.zip', mode='w') zf.write('test.jpg') zf.close() exit()`