Sideways camera uploads usually mean the pixels were never physically upright. The original file carries an EXIF orientation flag, a viewer honors it, and the derivative pipeline drops it. Read that flag and rotate the pixels once during ingest, before resizing or background removal.
Source: [Dev.to](https://dev.to/trippdonovan5461/debug-sideways-uploaded-camera-photos-in-nodejs-preserve-orientation-metadata-1d3h)