Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #475 from matrix-org/markjh/fix_thumbnail
Browse files Browse the repository at this point in the history
Only use cropped thumbnails when asked for a cropped thumbnail.
  • Loading branch information
NegativeMjark committed Jan 7, 2016
2 parents fcbe63e + 8677b7d commit 7c816de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/rest/media/v1/thumbnail_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _select_thumbnail(self, desired_width, desired_height, desired_method,
t_w = info["thumbnail_width"]
t_h = info["thumbnail_height"]
t_method = info["thumbnail_method"]
if t_method == "scale" or t_method == "crop":
if t_method == "crop":
aspect_quality = abs(d_w * t_h - d_h * t_w)
min_quality = 0 if d_w <= t_w and d_h <= t_h else 1
size_quality = abs((d_w - t_w) * (d_h - t_h))
Expand Down

0 comments on commit 7c816de

Please sign in to comment.