Use the picture processing library in Laravel Integration/image

Source: Internet
Author: User
Tags configuration settings

System Requirements

    • PHP >= 5.3
    • Fileinfo Extension
    • GD Library (>=2.0) ... or ...
    • Imagick PHP Extension (>=6.5.7)


Install Deployment Integration/image
Add in Composer.json [require] section, then perform composer update

" Intervention/image " " 2.0.15 "

Laravel Configuration

After the installation deployment Integration/image is complete, open the configuration file config/app.php add the code in the appropriate location, and the image class will be automatically loaded and ready for use. It's powerful to handle almost all your picture processing needs.

// Service Provider ' Intervention\image\imageserviceprovider ' // alias Configuration ' Image ' ' Intervention\image\facades\image '

Configuration settings
By default, Integration/image uses the PHP GD library extension. If you want to switch to Imagick, you can use PHP artisan to create a configuration file to add the appropriate configuration.

$ php Artisan config:publish Intervention/imag

Basic use

A few basic features are listed here, and more detailed instructions are available in the relevant interface documentation.
1. Display a picture

function () {       $img = Image::make (' foo.jpg ')->resize (+);        return $img->response (' jpg ');});

2. read a picture file

$img = Image::make (' foo/bar/baz.jpg ');

3. Draw a picture

$img = Image::canvas (+, ' #ccc ');

4. Edit a picture

$img = Image::make (' foo.jpg ')->insert (' Watermark.png ')->resize ("the");

Use the picture processing library in Laravel Integration/image

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.