Convert media without losing meaning or overwhelming the request.
1. Orientation and scaling
Apply orientation metadata and resize deliberately. Excessive downsampling can erase small text; full-resolution images may waste bandwidth and exceed limits.
2. Encoding and size
Use a supported media type and bound encoded size. Decode safely and reject corrupt input before it reaches the model adapter.
3. Privacy cleanup
Consider metadata and surrounding visual content as potential personal data. Remove unnecessary metadata and crop to the task where the user can verify the crop.
Worked scenario
A receipt is rotated and its total is tiny. Correct orientation and a task-aware crop improve extraction more than sending an enormous unprocessed image.
Apply it
Test rotated, oversized, corrupt and low-resolution images through a preprocessing pipeline.
Check your understanding
Your adapter receives a supported, bounded and correctly oriented input. Explain the decision and show evidence from your implementation or design. If you cannot demonstrate it yet, revisit the relevant section before continuing.