intervention

Can't write image data to path - Intervention Image

三世轮回 提交于 2021-01-29 10:55:52
问题 I'm trying to resize my images using Intervention package in my laravel project. I'm able to store images using Storage facade, but when I store them with Image class it throws below error. Can't write image data to path (/var/www/commerce/storage/featureds/2-1537128615.jpg) if ($request->has("featured_img")) { $file_path = $request->get("featured_img"); $exp = explode("/",$file_path); $filename = $exp[1]; $featured_path = "featureds/".$filename; \Storage::copy($request->get("featured_img"),

Image class not found when using Intervention

流过昼夜 提交于 2021-01-28 19:33:10
问题 I have installed Laravel 5.2 and Intervention, this is now in the composer.json file in the project. "require": { "php": ">=5.5.9", "laravel/framework": "5.2.*", "intervention/image": "^2.3" }, After reading tutorials, it mentions an Image.php file that should be in the config folder inside the project once you have installed Intervention. I believe I have installed Intervention correctly but when I try to use the Intervention functions it does not work. When I try to use this line of code I

How to fake image upload for testing with Intervention image package using Laravel

流过昼夜 提交于 2020-12-03 21:44:12
问题 I have a test asserting that images can be uploaded. Here is the code... // Test $file = UploadedFile::fake()->image('image_one.jpg'); Storage::fake('public'); $response = $this->post('/api/images', [ 'images' => $file ]); Then in controller i am doing something simpler.. $file->store('images', 'public'); And asserting couple of things. and it works like charm. But now i need to resize the image using Intervention image package. for that i have a following code: Image::make($file) ->resize

Call to undefined method Intervention\Image\Facades\Image::make()

醉酒当歌 提交于 2020-08-27 22:14:42
问题 I upgrade from Laravel4.2 to Laravel5.3 with intervention/image : "^2.3", if (Input::hasFile('logo')) { $path = public_path()."/assets/admin/layout/img/"; File::makeDirectory($path, $mode = 0777, true, true); $image = Input::file('logo'); $extension = $image->getClientOriginalExtension(); $filename = "logo.$extension"; $filename_big = "logo-big.$extension"; Image::make($image->getRealPath())->save($path.$filename); Image::make($image->getRealPath())->save($path.$filename_big); $data['logo'] =

Call to undefined method Intervention\Image\Facades\Image::make()

主宰稳场 提交于 2020-08-27 22:14:41
问题 I upgrade from Laravel4.2 to Laravel5.3 with intervention/image : "^2.3", if (Input::hasFile('logo')) { $path = public_path()."/assets/admin/layout/img/"; File::makeDirectory($path, $mode = 0777, true, true); $image = Input::file('logo'); $extension = $image->getClientOriginalExtension(); $filename = "logo.$extension"; $filename_big = "logo-big.$extension"; Image::make($image->getRealPath())->save($path.$filename); Image::make($image->getRealPath())->save($path.$filename_big); $data['logo'] =

Intervention\Image\Exception\NotWritableException Can't write image data to path

前提是你 提交于 2020-01-25 06:41:29
问题 I'm trying to put a image on a folder than i generate with a timestamp. This give me the error in the title. Intervention\Image\Exception\NotWritableException Can't write image data to path (/Users/me/Sites/test/public/uploads/images/1573905600/title-1.jpg) This is my code : $photoPaths = $request->get('photo_paths'); if (isset($photoPaths)){ $photos = explode(';', $photoPaths); $path = storage_path('tmp/uploads/'); $newPath = public_path('/uploads/images/').strtotime('12:00:00')."/";

Laravel image intervention compression

强颜欢笑 提交于 2020-01-24 03:50:08
问题 I have a script which saves and caches images with intervention, and it's working 100% However i am trying to work out how i can add 75% compression to jpg & png files, but i don't know i would apply it in this situation. I didn't think PNG files could be compressed apart from software which does it, so im not really sure if its the same thing? There is an example of compression here: http://image.intervention.io/api/save /* ////////////////////// IMAGES //////////////////////// */ Route::get

Use laravel storage with Image intervention canvas()

夙愿已清 提交于 2020-01-04 01:19:20
问题 Running Laraval 5.4 with Vagrant and Homestead. Saw a few other questions regarding this issue but none provided a solution which uses the canvas() method by Intervention/Image Laravel introduced a easier storage system since 5.3 My current code: $path = $request->file('logo')->store('/clients/logos','public'); $canvas = Image::canvas($width, $height); $image = Image::make($path)->resize($width, $height, function ($constraint) { $constraint->aspectRatio(); }); $canvas->insert($image, 'center'

Command (GetRealPath) is not available for driver (Gd)

本小妞迷上赌 提交于 2019-12-31 03:29:27
问题 I am trying to create a watermarked version of an uploaded image and store both of them to the storage folder using laravel 5.6 and Intervention. //create the watermarked image $watermarkedImage = Image::make($request->file('photo')); $watermark = Image::make(Storage::get('watermark.png')); $watermark->widen(floor(($watermarkedImage->width() / 4) * 3)); $watermarkedImage->insert($watermark, 'center'); //save the watermarked and standard image to disc and recording their names for db $location

getRealPath returning false (Image Intervention and Laravel 5.1)

情到浓时终转凉″ 提交于 2019-12-24 13:37:23
问题 I'm having a problem while using the getRealPath function. $file = Input::file('archivo'); $img = Image::make($file->getRealPath()); I'm getting this exception: NotReadableException in AbstractDecoder.php line 302. Image Not Readable. I tried printing the value for $file->getRealPath() with dd() function and it prints false . Also I tried using dd(Input::hasFile( 'archivo' )) and that returned me true . I can't seem to find an answer, I have tried almost everything I think. So basically I