dahlia / sqlalchemy-imageattach

SQLAlchemy extension for attaching images to entities.
https://sqlalchemy-imageattach.readthedocs.io/
MIT License
116 stars 25 forks source link

wand raises AttributeError in generate_thumbnail with S3Store #25

Closed fuhrysteve closed 9 years ago

fuhrysteve commented 9 years ago

I haven't dug into this too terribly much, but I'm having an issue generating thumbnails using S3Store. I'll update later with more info if I can find it. Could be that this is a bug in wand, not sure yet... in any case, it seems like HTTPResponse is expected to be treated like a file like object, but wand seems to be trying to get attributes that HTTPResponse doesn't implement.

Here are the details:

picture.generate_thumbnail(width=320)
File "sqlalchemy_imageattach/entity.py", line 671, in generate_thumbnail
img = WandImage(file=f)
File "wand/image.py", line 1973, in __init__
self.read(file=file, resolution=resolution)
File "wand/image.py", line 2022, in read
fd = libc.fdopen(file.fileno(), file.mode)
AttributeError: 'HTTPResponse' object has no attribute 'mode'
Wand==0.3.8
SQLAlchemy-ImageAttach==0.8.2
Flask-SQLAlchemy==2.0
SQLAlchemy==0.9.8
Pillow==2.6.1
$ python --version                                                                                                                                         (12-17 15:45)
Python 3.4.0
fuhrysteve commented 9 years ago

I believe this is a bug in wand, and I'm attempting to fix it upstream. Feel free to close this, otherwise I think I'll leave it open until it's resolved upstream..

dahlia commented 9 years ago

Fixed by dahlia/wand#205. Thanks!