MongoEngine / MongoEngine/mongoengine
ImageField does not save thumbnail content type (or any kwargs)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4h 41m
- Merged PRs (30d)
- 11
Description
It would be nice if ImageGridFsProxy would pass the kwargs to _put_thumbnail() so a content-type can be saved with the thumbnail. Without this some projects (like Flask Admin) will serve the GridFS thumbnail image as text/html instead of the correct image content type.
Maybe as simple as:
thumb_id = self._put_thumbnail(thumbnail, img_format, progressive, **kwargs)
vs.
thumb_id = self._put_thumbnail(thumbnail, img_format, progressive)
https://github.com/MongoEngine/mongoengine/blob/master/mongoengine/fields.py#L1940
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in mongoengine/fields.py around line 1940 and inspect ImageGridFsProxy's call to _put_thumbnail(). Confirm how the thumbnail kwargs carry the content type, then verify that saved thumbnails retain the requested image content type rather than defaulting to text/html.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100