Processing pictures.
WHAT PYTHON CAN DO
Resize Convert formats Crop Compress Read dimensions and metadata Apply basic adjustments
WHAT THIS SUITS
Preparing uploads for a website Generating thumbnails Bulk processing
WHY IT MATTERS FOR WEBSITES
Unoptimised images are the largest cause of slow pages.
Automating resizing at upload solves it permanently.
WHAT TO SET
A maximum dimension A sensible compression level A consistent output format
WHAT TO BE CAREFUL WITH
Memory, on large images Metadata, which may contain location information Orientation information, which some readers apply and others do not
THE METADATA POINT
Photographs frequently carry location and device data.
Strip it before publishing anything from a phone.
WHAT TO VALIDATE ON UPLOADS
That the file is genuinely an image, by content rather than extension Its dimensions and size, before processing
WHY
Processing a maliciously crafted file is a known risk.
WHAT TO STORE
The processed version, and the original only if needed.