From ead8fc5e388cf03b83b5470430a1c3d70af00df3 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Thu, 11 Dec 2014 10:41:43 +0000 Subject: [PATCH] doc the thumbnail methods --- synapse/media/v1/media_repository.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/synapse/media/v1/media_repository.py b/synapse/media/v1/media_repository.py index 2bd29d2288..a0dc56be4b 100644 --- a/synapse/media/v1/media_repository.py +++ b/synapse/media/v1/media_repository.py @@ -49,15 +49,24 @@ class MediaRepositoryResource(Resource): - Clients can get thumbnails by supplying a desired width and height:: + Clients can get thumbnails by supplying a desired width and height and + thumbnailing method:: => GET /_matrix/media/v1 - /thumbnail/?width=&height= HTTP/1.1 + /thumbnail/?width=&height=&method= HTTP/1.1 <= HTTP/1.1 200 OK Content-Type: image/jpeg or image/png + + The thumbnail methods are "crop" and "scale". "scale" trys to return an + image where either the width or the height is smaller than the requested + size. The client should then scale and letterbox the image if it needs to + fit within a given rectangle. "crop" trys to return an image where the + width and height are close to the requested size and the aspect matches + the requested size. The client should scale the image if it needs to fit + within a given rectangle. """ def __init__(self, hs):