FishBun
FishBun copied to clipboard
Fix orientation of image based on EXIF metadata
I'm using the latest version of FishBun (0.8.8) and Glide (4.9.0) to take pictures and send them to my Firebase backend. When I take a picture in portrait mode, it is saved as a JPEG with orientation=6 in the EXIF. Most clients, including iOS and Glide on Android take that metadata into account and display the image in the right orientation. But I'm using html-pdf on the server to render those images into a PDF, and that library seems to ignore EXIF metadata.
I'm investigating the option of switching to another PDF generation library on the server, but another option would be to fix the orientation of the image before I save it to my backend, rotating the image and setting orientation to normal in the EXIF before I send it.
Is there any way to do that with FishBun and/or Glide today?