Use cloud storage (s3) with putFileAs
Hey, is there a way to use PutFileAs and Intervention Image for large image files? I have the following code:
` $photo = Image::make($image)->encode('jpg', 70); $name = $image->hashName();
try {
$photo->widen(160);
$this->storeImage('lg_'.$name, $photo);
Storage::disk('...')->putFileAs(path..., $image->basePath(),$name);
$photo->widen(40);
$this->storeImage('xs_'.$name, $photo);
Storage::disk('...')->putFileAs(path..., $image->basePath(),$name);
} catch ( \Exception $e ) {
throw new HttpException(500, $e->getMessage());
}
`
Unfortunately, the manipulation is not taken over. In both cases, the image is saved in its original size. Is there any solution for this?
Thanks!
Not sure I follow your code correctly, is storeImage a method that contains the Storage::disk call?
In any case, $image->basePath() refers to the original source file so if you store that in S3 then it will store the original image right? You'll need to output the processed image in order to save it: https://image.intervention.io/v2/usage/overview#image-output