summary refs log tree commit diff
path: root/synapse/rest/media/v1/thumbnailer.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix error in thumbnail generation (#11288)Neeeflix2021-11-101-4/+4
| | | Signed-off-by: Jonas Zeunert <jonas@zeunert.org>
* Relax `ignore-missing-imports` for modules that have stubs now and update ↵David Robertson2021-10-081-4/+17
| | | | | | | | | | | | mypy (#11006) Updating mypy past version 0.9 means that third-party stubs are no-longer distributed with typeshed. See http://mypy-lang.blogspot.com/2021/06/mypy-0900-released.html for details. We therefore pull in stub packages in setup.py Additionally, some modules that we were previously ignoring import failures for now have stubs. So let's use them. The rest of this change consists of fixups to make the newer mypy + stubs pass CI. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Add missing type hints to non-client REST servlets. (#10817)Patrick Cloke2021-09-151-1/+1
| | | | Including admin, consent, key, synapse, and media. All REST servlets (the synapse.rest module) now require typed method definitions.
* Fix /upload 500'ing when presented a very large image (#10029)Michael Telatynski2021-05-211-0/+9
| | | | | | | | | | | | * Fix /upload 500'ing when presented a very large image Catch DecompressionBombError and re-raise as ThumbnailErrors * Set PIL's MAX_IMAGE_PIXELS to match homeserver.yaml to get it to bomb out quicker, to load less into memory in the case of super large images * Add changelog entry for 10029
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Handle image transparency better when thumbnailing. (#9473)Patrick Cloke2021-03-091-3/+8
| | | | Properly uses RGBA mode for 1- and 8-bit images with transparency (instead of RBG mode).
* Add type hints to media rest resources. (#9093)Patrick Cloke2021-01-151-8/+10
|
* Fix typos in comments.Patrick Cloke2020-09-141-2/+2
|
* Do not error when thumbnailing invalid files (#8236)Patrick Cloke2020-09-091-2/+12
| | | | If a file cannot be thumbnailed for some reason (e.g. the file is empty), then catch the exception and convert it to a reasonable error message for the client.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* isort 5 compatibility (#7786)Will Hunt2020-07-051-2/+1
| | | The CI appears to use the latest version of isort, which is a problem when isort gets a major version bump. Rather than try to pin the version, I've done the necessary to make isort5 happy with synapse.
* Fix: Pillow error when uploading RGBA image (#3325) (#6241)Filip Štědronský2019-12-021-1/+4
| | | Signed-Off-By: Filip Štědronský <g@regnarg.cz>
* media/thumbnailer: Better quality for 1-bit / 8-bit color palette images (#2142)Robert Swain2019-10-041-3/+11
| | | | | | Pillow will use nearest neighbour as the resampling algorithm if the source image is either 1-bit or a color palette using 8 bits. If we convert to RGB before scaling, we'll probably get a better result.
* Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-2/+2
| | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :)
* Run Black. (#5482)Amber Brown2019-06-201-11/+4
|
* Fix image orientation when generating thumbnail (#5039)PauRE2019-05-161-0/+35
|
* run isortAmber Brown2018-07-091-2/+2
|
* Fix upErik Johnston2017-10-131-10/+3
|
* Fix up thumbnailing functionErik Johnston2017-10-131-3/+10
|
* Copy everything to backupErik Johnston2017-10-121-1/+8
|
* Basic implementation of backup media storeErik Johnston2017-10-121-10/+6
|
* Log which files we saved attachments to in the media_repositoryMark Haines2017-01-101-0/+5
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* bump up image quality a bit more as it looks crapMatthew Hodgson2015-07-141-1/+1
|
* Move rest APIs back under the rest directoryMark Haines2015-01-221-0/+89