You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I fetch a document with an ImageField, the image can be read using doc.image.read(), but if I do a doc.save() and then I do a doc.image.read(), the image is empty
The text was updated successfully, but these errors were encountered:
I believe the problem is not the .save() but the .read(). As it's a file-like object, when you call .read() you are moving the cursor to the end of the file. If you then call .read() without "rewinding" it, you get None because there is nothing to read anymore. This is also the case with the underlying pymongo GridFS/GridOut structure so its not really a bug, you need to call .seek(0) if you want to read() it multiple times. The doc was improved to reflect this in #2229
When I fetch a document with an ImageField, the image can be read using doc.image.read(), but if I do a doc.save() and then I do a doc.image.read(), the image is empty
The text was updated successfully, but these errors were encountered: