Identify which limit failed
An upload can fail because of file bytes, dimensions, megapixels, format, or a network timeout. Read the destination error before changing the image.
- Use compression for byte limits.
- Use resizing for dimension limits.
- Use conversion only when the format is unsupported.
Keep a batch consistent
Apply one deliberate resize rule to source files rather than fixing each image with unrelated settings. Preserve aspect ratio unless a crop is intentional and reviewed.