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

media/thumbnailer: Better quality for 1-bit / 8-bit color palette images #2142

Merged
merged 4 commits into from Oct 4, 2019

Conversation

@superdump
Copy link
Contributor

superdump commented Apr 20, 2017

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.

Note: I haven't actually tested this but setting up a synapse just to do so is more effort than I'm willing at this particular moment.

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.
@superdump superdump requested a review from NegativeMjark Apr 20, 2017
@ara4n

This comment has been minimized.

Copy link
Member

ara4n commented Apr 20, 2017

lgtm, but please do test it first. setting up a synapse on OSX is absolutely trivial and very worthwhile - in your git checkout, just:

# deps, if needed
sudo easy_install pip
sudo pip install virtualenv
brew install pkg-config libffi

virtualenv -p python2.7 env
source env/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
python synapse/python_dependencies.py | xargs pip install
pip install lxml mock

# gen the config
python -m synapse.app.homeserver \
    --server-name my.domain.name \
    --config-path homeserver.yaml \
    --generate-config \
    --report-stats=yes

# start the synapse
./synctl start

i'd be surprised if copy-pasting that didn't give you a working homeserver on port 8008 ready to test against.

Copy link
Contributor

NegativeMjark left a comment

LGTM, but it might be nice to test uploading a 1-bit image with a unit test or a sytest. (I'm happy to take you at your word wrt image quality, but it would be nice to have some way to check it doesn't crash)

@APwhitehat

This comment has been minimized.

Copy link
Contributor

APwhitehat commented May 4, 2017

I tried uploading 1-bit & 8-bit image via riot-web and synapse showed no errors.
I used this and this .

Tell me if more rigorous test is required.

@erikjohnston erikjohnston force-pushed the develop branch from 2af75da to 47574c9 Jul 4, 2017
@richvdh richvdh added this to In progress in Homeserver Task Board via automation Oct 3, 2019
@richvdh richvdh moved this from In progress to Community PRs in Homeserver Task Board Oct 3, 2019
@richvdh

This comment has been minimized.

Copy link
Member

richvdh commented Oct 3, 2019

I don't know why we never merged this

@richvdh
richvdh approved these changes Oct 3, 2019
@richvdh richvdh merged commit 39b40d6 into develop Oct 4, 2019
18 checks passed
18 checks passed
buildkite/synapse Build #4775 passed (19 minutes, 6 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 28 seconds)
Details
buildkite/synapse/check-style Passed (1 minute, 42 seconds)
Details
buildkite/synapse/isort Passed (18 seconds)
Details
buildkite/synapse/mypy Passed (22 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (16 seconds)
Details
buildkite/synapse/packaging Passed (22 seconds)
Details
buildkite/synapse/pipeline Passed (3 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (17 minutes, 11 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (5 minutes, 37 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite-slash-old-deps Passed (8 minutes, 37 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (6 minutes, 13 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (16 minutes, 46 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (16 minutes, 50 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (6 minutes, 7 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-monolith Passed (11 minutes, 39 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-workers Passed (11 minutes, 17 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-sqlite-slash-monolith Passed (10 minutes, 6 seconds)
Details
Homeserver Task Board automation moved this from Community PRs to Done Oct 4, 2019
@richvdh richvdh deleted the rob/thumbnail-quality branch Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
5 participants
You can’t perform that action at this time.