Strange image orientation with all camera apps
I'm afraid you don't have any chance to make the image be in landscape mode when taken, if you don't have the source code of your ROM. But you can surely post-process it by yourself.

Termux provides some helpful (and famous) utilities like jhead and imagemagick. It's possible to write shell scripts that rotate portrait images into landscape and add a "Rotation" in the EXIF to "rotate" it back.