I am in the process of upgrading a project from Laravel 5 to 5.1. One package that needed to be updated was League\Flysystem
.
I am using Intervention\Image
to resize an image and then Flysystem to save it to S3. The code below was working with 5.0 -
// Album ID
$id = $request->input('id');
// Filename for this photo
$filename = str_random() . ".jpg";
// Get the storage disk
$disk = Storage::disk('s3');
// Resize the photo
$image = Image::make($request->file('photo'));
$image->orientate();
$image->resize(1024, 748, function ($constraint) {
$constraint->aspectRatio();
});
$image->encode('jpg');
// Save the photo to the disk
$disk->put("img/album/$id/$filename", $image);
But now I am receiving the following error:
fstat() expects parameter 1 to be resource, object given
, thrown in league\flysystem\src\Util.php
, line 250.
I am using "intervention/image": "~2.1"
, "league/flysystem-aws-s3-v3" : "~1.0",
Any ideas what might be causing this?
(_toString) is not available for driver (Gd)
. – Implicative