mirror of
				https://git.sr.ht/~tsileo/microblog.pub
				synced 2025-06-05 21:59:23 +02:00 
			
		
		
		
	Webp support
This commit is contained in:
		| @@ -979,6 +979,11 @@ async def serve_proxy_media_resized( | |||||||
|         if getattr(i, "is_animated", False): |         if getattr(i, "is_animated", False): | ||||||
|             raise ValueError |             raise ValueError | ||||||
|         i.thumbnail((size, size)) |         i.thumbnail((size, size)) | ||||||
|  |         try: | ||||||
|  |             resized_buf = BytesIO() | ||||||
|  |             i.save(resized_buf, format="webp") | ||||||
|  |         except Exception: | ||||||
|  |             logger.exception("Failed to convert to webp") | ||||||
|             resized_buf = BytesIO() |             resized_buf = BytesIO() | ||||||
|             i.save(resized_buf, format=i.format) |             i.save(resized_buf, format=i.format) | ||||||
|         resized_buf.seek(0) |         resized_buf.seek(0) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user