in Education by
I am using Laravel Image Intervention to resize an image upload field on my form. This is the error I receive on upload - I am running on Valet. Command (Extension) is not available for driver (Gd). The following works fine without Image::make use Image; ... $authorID = Auth::user()->id; $file = request()->file('ts_image'); if($file) { $file = Image::make($file)->resize(300, 300); $fileExtension = $file->extension(); $unique_name = md5($file. time()).'.'.$fileExtension; // $fileImg = $file->storeAs('/public/images/' . $authorID, $unique_name); Any ideas? Thanks! Edit: When dd($file) this is what is returned: Image {#667 ▼ #driver: Driver {#668 ▼ +decoder: Decoder {#669 ▼ -data: null } +encoder: Encoder {#670 ▼ +result: null +image: null +format: null +quality: null } } #core: gd resource @16 ▼ size: "300x300" trueColor: true } #backups: [] +encoded: "" +mime: "image/jpeg" +dirname: "/private/var/tmp" +basename: "phpBPRGuD" +extension: null +filename: "phpBPRGuD" } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I used intervention to save my images into the database. I was working with laravel and i had to save images of different size, large, medium and small. this how it works for me if ($request->hasFile('image')) { $image_tmp = Input::file('image'); if ($image_tmp->isValid()) { $extension = $image_tmp->getClientOriginalExtension(); $filename = rand(111, 99999) . '.' . $extension; $large_image_path = 'images/backend_images/products/large/' . $filename; $medium_image_path = 'images/backend_images/products/medium/' . $filename; $small_image_path = 'images/backend_images/products/small/' . $filename; //resize image Image::make($image_tmp)->save($large_image_path); Image::make($image_tmp)->resize(600, 600)->save($medium_image_path); Image::make($image_tmp)->resize(300, 300)->save($small_image_path); $product->image = $filename; } }

Related questions

0 votes
    I'm pretty new at laravel, in fact and I'm trying to create my very first project. for some ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    I am using Laravel 5.7 version. I got the below error for users_activations table while run the command ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I am using Laravel 5.7 version. I got the below error for users_activations table while run the command ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I am currently developing a recipe website with Laravel and I have run into an issue on my recipe show ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I am currently developing a recipe website with Laravel and I have run into an issue on my recipe show ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I'm trying to insert data to the database and at the same time uploading an image to the path. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    Currently I'm using Cloudinary.com to save my users images. I know how to do some of the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I'm building a single page application. On the client side I'm using Nuxt.js (which includes Vue. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I've followed all guides and answers, and everything displays correctly, but the actual upload doesn't ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I've followed all guides and answers, and everything displays correctly, but the actual upload doesn't ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    in my app i want to upload an image chosen via UIImagePickerController to a database which only accepts JPEG ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    To lower the file size, while uploading, in Scratch, check the _________ box in the left corner of the upload screen Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    "The binary you uploaded was invalid. The key CFBundleVersion in the Info.plist file must contain a higher ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    So I'm using Codeigniter and I want to upload files. It's working fine except for this one thing. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have a piece of code which resizes animated gifs. if it helps the code will always resize images ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
...