Laravel Storage :: get () does not return exif image data

I am trying to get exif image data to use image orientation function.

The only problem is that I cannot read exif data using Storage :: get ()

First, I save the downloaded images as follows:

$filename = uniqid().'.'.$file->getClientOriginalExtension();
$path = "images/$id/$filename";
Storage::put($path, File::get($file->getRealPath()));

In the queue, I read images, do some resizing, and upload to AWS:

$image = Image::make(Storage::disk('images')->get("$this->id/$file"));
            $image->orientate();
            $image->resize(null, 600, function ($constraint) {
                $constraint->aspectRatio();
            });
            $image->stream('jpg', 85);
Storage::put("images/$this->id/main/$file", $image);
$image->destroy();

The image can be resized and uploaded to AWS, but the only problem is that it will be displayed on the side, so it seems like I cannot read exif data using:

Storage::disk('images')->get("$this->id/$file")

I ran: php -m | more and I see that "exif" is specified, so I have a module on the Laravel Forge DO server

+4
1

exif , exif()

, :

$image->exif();

exif() array();

exif(), , : $image->exif('model')

-

0

Source: https://habr.com/ru/post/1661241/


All Articles