我正在尝试获取图像 exif 数据,以便我可以使用图像干预定位功能。
唯一的问题是我无法使用 Storage::get() 读取 exif 数据
首先,我像这样存储上传的图像:
$filename = uniqid().'.'.$file->getClientOriginalExtension();
$path = "images/$id/$filename";
Storage::put($path, File::get($file->getRealPath()));
在队列中,我正在读取图像,调整大小并上传到 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();
图像确实会调整大小并上传到 AWS,但唯一的问题是它会横向显示,所以我似乎无法使用以下命令读取 exif 数据:
Storage::disk('images')->get("$this->id/$file")
我已经运行: php -m |更多,我可以看到列出了“exif”,因此我的 Laravel Forge DO 服务器中有该模块