intervention

Adding watermark on image from databases in Laravel 5.3

China☆狼群 提交于 2019-12-24 05:07:13
问题 I am trying to add watermark on image from database in Laravel using Intervention Image package. In my database table I am saving the path of the image. I am using Accessors in my model to get access to the field of the image path but I am getting this error: Method insert does not exist. Here is my model: Here is my blade: 回答1: public function getFilePathAttribute($value){ $img = Image::make(public_path($value)); //your image I assume you have in public directory $img->insert(public_path(

How to upload large size image by Intervention Image in Laravel 5

ぃ、小莉子 提交于 2019-12-23 20:14:39
问题 I'm using Image Intervention in my project. My application working smoothly while uploading small size images. But when I try to upload large size image(>2mb), my application stops working! Even It shows no proper errors. Sometimes It shows Token mismatch error & sometimes the url not redirects. How to fix it? I've no idea. Here is my code: $post->new Post(); if($request->hasFile('image')){ $image=$request->file('image'); $filename=Auth::user()->id.'_'.time().'.'.$image-

Image source not readable in Laravel 5.2 - Intervention Image

↘锁芯ラ 提交于 2019-12-21 03:53:10
问题 I have a small problem concerning the resizing process of a given image, I am trying to submit a form containing an input type -->file<-- I was able to upload a picture without resizing it, after that I decided to resize that image so I installed the Intervention Image Library using: composer require intervention/image then I integrated the library into my Laravel framework Intervention\Image\ImageServiceProvider::class 'Image' => Intervention\Image\Facades\Image::class and finally I

Intervention Image: Save image directly from an url with original file name and ext?

主宰稳场 提交于 2019-12-20 12:17:02
问题 How to get the filename, when taking image from a remote server? And how to save with original size and filename? // Take remote image $img = Image::make('http://image.info/demo.jpg'); // how to save in the img/original/demo.jpg $img->save(????); I use Intervention, (http://image.intervention.io/api/make) to build CakePHP 3 image Behavior, I want to provide an easy uploading from remote servers, and keep the original image as a source for future manipulation. EDIT I ask, is there the

Intervention Image: Save image directly from an url with original file name and ext?

你离开我真会死。 提交于 2019-12-20 12:16:01
问题 How to get the filename, when taking image from a remote server? And how to save with original size and filename? // Take remote image $img = Image::make('http://image.info/demo.jpg'); // how to save in the img/original/demo.jpg $img->save(????); I use Intervention, (http://image.intervention.io/api/make) to build CakePHP 3 image Behavior, I want to provide an easy uploading from remote servers, and keep the original image as a source for future manipulation. EDIT I ask, is there the

Intervention imagick works in terminal but not in browser

霸气de小男生 提交于 2019-12-20 05:39:40
问题 I quite don't understand what's going wrong. I've installed Intervention from as guided here Then I created the following .php file and started my localhost Apache server and tested the results and it worked! Here's the code: test.php <?php require 'vendor/autoload.php'; use Intervention\Image\ImageManagerStatic as Image; Image::configure(array('driver' => 'gd')); $image = Image::make('ar.jpg'); $path = 'public/images/photoh.png'; $image->save($path); ?> But when I run the same file using php

Using Intervention package to compress images. My images are not being compressed, still the same size

↘锁芯ラ 提交于 2019-12-13 02:35:53
问题 I'm using this package http://image.intervention.io/getting_started/installation to compress my images that's uploaded to my server. However the images are not being compressed. First I installed the Intervention package by putting this in my terminal: composer require intervention/image Then I added this at the top of my controller: use Intervention\Image\ImageManagerStatic as Image; Then I added the encode to minify the image Image::make(request()->file('img'))->encode('jpg', 1); It's not

How to maintain the dpi (dots per inch) of an image in laravel 5.2 using intervention package?

旧巷老猫 提交于 2019-12-12 06:25:06
问题 I am using Laravel 5.2. I have almost done the resizing of an image that runs fine. But i am facing one problem When i upload an image of 300 dpi it reduces the dpi to 96 dpi. I don't know what i am doing wrong.I am using Intervention Package of laravel5.2. Here i have done so far:- // Input::file('image') -> upload file having dpi of 300 $height = 6048; //upload image height $width = 4032; //upload image width xxlheight = ($height*60)/100; $xxlwidth = ($width*60)/100; $xxlFileName = str

Unable to read image from file .SVG (intervention/image)

大憨熊 提交于 2019-12-11 06:09:45
问题 So I'm making an image uploader where I want to make thumbnails but also support svg as well, since GD doesn't support svg types I first tried switching to imagick in the config/image.php file but that didn't change anything. Which I am uncertain about as it does state it supports it, am I missing a required package that I have to install? If so which one?. But with that said, when I try to upload an svg image it states: NotReadableException in Decoder.php line 20: Unable to read image from

Laravel + Image Intervention : Force download of file that is not saved

ぐ巨炮叔叔 提交于 2019-12-10 11:00:32
问题 I want to simply upload files , resize them and then force a download for every uploaded file. I do not want to save the files. Resizing etc. works fine, however I cannot manage to force the download of the new file. $content = $image->stream('jpg'); return response()->download($content, $name); The shown snippet results in is_file() expects parameter 1 to be a valid path, string given Most probably because $content is not a path but the actual data. Is there a way to enforce the download