It seems like images uploaded from iPhones and iPads always tend to be sideways, how can I fix this?

This is a common issue among iPhone users. Most portrait images generated by an iPhone or iPad are saved with a Landscape Left EXIF Orientation tag. For the phone owner, the image is displayed normally because the software on their phone is EXIF aware and automatically rotates their images when they are displayed. This is also the case with most modern browsers when viewing an image directly. However, once that image is placed inside an HTML image tag, it will display the true orientation of the photo since HTML image tags are not EXIF aware.

For Example this image has an Exif orientation of "Rotate 90 CW":

 <img src="https://cdn.filestackcontent.com/l8k4xrEeRZOvr8IV7aWk" width="300px"> 
Example Rotated Sideway Image of Coffee Cup

Solution:

To display iPhone/iPad images correctly on your site, you can use Filestack's processing engine to rotate the image based on the exif data.

For example:

 <img src="https://process.filestackapi.com/rotate=deg:exif/l8k4xrEeRZOvr8IV7aWk" width="300px"> 
Example Image Rotated Based on Exif Data

You can also POST directly to the URL in order to generate a Filestack link that is pre-rotated.

>>> curl -X POST "https://process.filestackapi.com/rotate=deg:exif/l8k4xrEeRZOvr8IV7aWk"

Response:

{"container":"your_own_bucket","filename":"20150623_114134 (1).jpg","height":2560,"key":"AxTOz8wQUGzV3iQFao7g_20150623_114134 (1).jpg","size":874854,"type":"image/jpeg","url":"https://cdn.filestackcontent.com/dkYr5fuPSt2J9YtPX0kk","width":1920}
        

This new image is already rotated and can be included in a standard image tag:

 <img src="https://cdn.filestackcontent.com/dkYr5fuPSt2J9YtPX0kk" width="300px"> 
Example New Rotated Image