I want to resize images that I upload on my page, but to do that I need library that will handle it.
I tried to use Intervention Images, everything was fine untill it came to run it. It requires GD Library, which first of all is supposted to by on my XAMPP, php.ini but really isnt. (After all there would be a problem with installing it on server where i would put my page so imo not worth deal.
GD Library extension not available with this PHP installation.
Then I tried Nette but it doesnt allow to read file and then resize (or I really missed something) you can just resize you make from this app.
So my question is simple, is there any other Image library that would allow me to resize my uploaded images?(that works with laravel 8.*
I don't think there is other alternative for image processing library that doesn't use php-gd since it's the most powerful image processing extension and natively supported by PHP (reference: https://www.php.net/manual/en/book.image.php).
If the error is on your php extension, you should recheck the php.ini configuration and the extension binary file (usually located at php ext/ directory).
But I highly recommend to use other local development environment such as Laragon for easy php extension management.
You can use Intervention Image.
I personally use Imagick (https://www.geeksforgeeks.org/how-to-install-imagemagick-and-imagick-php-extension-in-ubuntu) but it seems like you can also use GD for this.
This is where you can install it to your laravel project: http://image.intervention.io/getting_started/installation
You can now use this library in your code
use Intervention\Image\ImageManagerStatic as Image;
Saying the uploaded file is $file you can then resize the image and encode it as a 1024x1024 jpg (png works too).
$resize = Image::make($file->getRealPath())->fit(1024)->encode('jpg');
Finally you just have to save the image to the storage or work with it as you like
$resize->save(storage_path('image.jpg'));
Yes, there is a package called image intervention. I just used the package for my own project.
Related
I am new to 'Laravel'. I have generated thumbnail thing in core php using 'ffmpeg'. But don't how to do this in 'Laravel'.
Help me out. Thanks
You can use a popular package Intervention Image http://image.intervention.io
Follow the installation here: http://image.intervention.io/getting_started/installation
It's so easy to generate a thumbnail with this package.
We are using this for customer to generate images, but we have to serve the images in round-about way. It will be nice if OpenBabel gives us as Stream that can be redirected automatically.
YES. You can use swig to compile it.
cmake sourcepath -DPHP_BINDINGS=ON -DRUN_SWIG=ON
I'm a webdeveloper and I'm starting a huge project requested by a company.
I'm trying to figure out if is best to use a PHP framework or not, and in case, which one.
I know Codeigniter, but I wanted to look around to see what's the best framework at the moment. I found out Laravel is trending at the top so I wanted to try it out.
Being used to Codeigniter I usually download the zip file with all the phps inside and start working. I'm trying to do the same with Laravel but I saw you are to download and use composer to install it.
I'm not really used to the Terminal and I wanted to ask if that's the only way of installing it or if there is a downloadable version as in Codeigniter, CakePHP, etc...
You can always download the ZIPped code directly from project's GitHub site. You can find the base application here: https://github.com/laravel/laravel - you'll find a link at the bottom of the right column. This code is what composer downloads when you use that to setup the application.
If you want to use Laravel you will have to use Composer as this is what the application uses to manage its dependencies. It's not hard, as you'll only need to run a few commands.
You can learn more about how to install and use composer in the docs: https://getcomposer.org/download/
In this wiki that I recently set up, the images are not displayed. I tried both local uploads and InstantCommons (like I did in the main page), but the result is the same. The software is 1.16.5 and I cannot upgrade it since the hosting server only supports a PHP compatible to this MediaWiki version at the best. Any suggestion?
Danilo's own answer: I solved the problem. My LocalSettings.php was missing:
$wgUploadPath = "$wgScriptPath/uploads";
$wgUploadDirectory = "$IP/uploads";
which were needed to allow independent creations of URL.
We currently have a PHP script doing this, but it fails constantly, so I'm looking for a solution in Ruby. Basically we are collecting favicons and need to convert any that are in the .ico format into a .png format.
Please do not provide links to any hosted services to do this... we've probably already tried them all and abandoned them (this includes Google and Yahoo) ;)
Use ImageMagick or GraphicsMagick, both available as PHP modules (and very similar); in Ruby use the RMagick interface.
Try one of the Ruby interfaces to ImageMagick.