Resize an image by height, keeping its format and transparency

FeatureConversionService
Shipped
3 Septemba 2026, 22:55 UTC
Author
Kamo
Commit
aadfa49

Backs the email signature footer badges, which are downscaled to 150px tall on upload. resize-bg could not be reused. It exists to make a wallpaper cheap to ship, so it re-encodes everything to lossy WebP and fits it inside a box — and a badge is composited into a message body by mail clients (every Outlook on Windows among them) that cannot display WebP at all, on whatever background the recipient's client paints. So the format that was uploaded is the format that comes back: PNG through ffmpeg's negotiated pixel format, GIF through palettegen/paletteuse with a reserved transparent entry (animation intact), WebP lossless, JPEG at high quality. An SVG is returned untouched — a vector has no pixel height, and ffmpeg cannot read it either. An image already inside the limit comes back byte-for-byte. Re-encoding 'for consistency' is lossy for JPEG, re-palettises a GIF, and would discard an animation nobody asked to lose; being too tall is the only reason to touch it.

All changes

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei