How are you storing the image to S3, is the EXIF data really passed along or are you creating a new image? Try using ->orientate() when storing/uploading the image instead of during download.
How to get EXIF data from an image on S3?
I use AWS S3 to store images and the Intervention Image package to manipulate them on downloading:
$source_file = Storage::disk('s3')->get($filename);
$file = Image::make($source_file)
->orientate()
->fit(200, 200, function ($constraint) {
$constraint->upsize();
})
->encode(null, 80);
Everything works well except of one case: if the original image is a vertical photo from an iPhone the resized version is 90 degrees rotated. Apparently, it's because iPhone uses some EXIF parameters to indicate orientation and these parameters are ignored by the Intervention Image orientate() method.
This returns nothing:
$source_file = Storage::disk('s3')->get($filename);
info(Image::make($source_file)->exif());
Intervention Image package documentation says:
Image object must be instantiated from file path to read the EXIF data correctly.
But I have no idea how to do it with S3. So the final questions sounds like how to get an image from S3 with EXIF information?
Please or to participate in this conversation.