Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Upload Zip to the Albums #4

Open
ghost opened this issue Aug 2, 2018 · 16 comments
Open

Can't Upload Zip to the Albums #4

ghost opened this issue Aug 2, 2018 · 16 comments

Comments

@ghost
Copy link

ghost commented Aug 2, 2018

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 <ContentFile: Raw content>
/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
Copy link

SKhakhulin commented Sep 27, 2018

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 <ContentFile: Raw content>
/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
Copy link
Owner

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

@SKhakhulin thanks for your help!

@VelinGeorgiev
Copy link
Owner

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

@bassory99
Copy link

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

@VelinGeorgiev VelinGeorgiev reopened this Jul 18, 2019
@VelinGeorgiev
Copy link
Owner

@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
Copy link

bassory99 commented Jul 18, 2019

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
Copy link
Owner

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

@VelinGeorgiev
Copy link
Owner

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
Copy link

bassory99 commented Jul 19, 2019

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

@bassory99
Copy link

bassory99 commented Jul 19, 2019

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
Copy link

JOFLIX commented Aug 24, 2019

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
Copy link

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

@FrankFeng-23
Copy link

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
Copy link

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
Copy link

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
Copy link

@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()`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants