【发布时间】:2017-04-02 19:47:01
【问题描述】:
我正在尝试获取图像 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 服务器中有该模块
【问题讨论】: