Question: I have dropzone working no a site but once in a while when I drop an image in it turns to landscape. This seems to happen more on larger images. I cannot find anyone with this problem so I was hoping someone here has dealt with this issue.

Upon further testing I have narrowed this down to only images with the extension JPEG, if I re-save as JPG then it is fine. Any ideas?

Thanks

Answer: 
Use SimpleImage.

> 
> change vertical or horizontal mobile image into properly oriented.. So
>  that any vertical mobile store in vertical only.. Use simple image
>  auto\_orient funtion. Get Simple image from :
>  <https://github.com/claviska/SimpleImage>
> 
> 
> 

```
$img = new SimpleImage();   

    $imagenm="Bombay Realty.jpg"; // vertical mobile image store horizontally..
    $filepath='processed/'.$imagenm;

    $img->load($filepath)->auto_orient()->save($filepath);

```
Just in case anyone comes across this I figured I would answer it now that I have worked though it. I found in the EXIF data that the orientation needed to be locked in before converting the image. Even though the browser or email client rendered it upright it saved rated 90 degrees. By running the following php exec before doing anything with the image it made sure it was upright.

exec("convert -auto-orient {$this->s\_tmp} {$this->s\_tmp}");

$this->s\_temp obviously being the temporary image uploaded and this of course is using image magicks -auto-orient