![]() load method hidden, use constructor instead.: Version 2.1 (by Nazar Mokrynskyi), a lot of refactoring and new features Differences from Version 2 ![]() smart_crop and crop_center methods removed, simplified adaptive_resize added instead, new method is compatible with old, but simpler.: Version 2.2 (by Nazar Mokrynskyi) Differences from Version 2.1 without saving to file) $img-> flip( 'x')-> output() Change Log : Version 2.3 (by Nazar Mokrynskyi) Differences from Version 2.1 Flip the image and output it directly to the browser (i.e. Get the current orientation (returns 'portrait', 'landscape', or 'square') $orientation = $img-> get_orientation() Get the current height $height = $img-> get_height() Get the current width $width = $img-> get_width() Get info about the original image (before any changes were made) // // Returns: // // array( // width => 320, // height => 200, // orientation =>, // exif => array(.), // mime =>, // format => // ) $info = $img-> get_original_info() The image you're working with or output the image directly to the browser: The following methods are not chainable, because they return information about Valid positions are center, top, right, bottom, left, top left, top.Add 32-point white text top-centered (plus 20px) on the image* $img-> text( 'Your Text', 'font.ttf', 32, '#FFFFFF', 'top', 0, 20) Overlay watermark.png at 50% opacity at the bottom-right of the image with a 10 pixel horizontal and vertical margin $img-> overlay( 'watermark.png', 'bottom right'. Sepia effect (simulated) $img-> sepia() Pixelate using 8px blocks $img-> pixelate( 8) Smooth filter (-10 to 10) $img-> smooth( 5) Gaussian blur (two passes) $img-> blur( 'gaussian', 2) Selective blur (one pass) $img-> blur() Mean removal filter $img-> mean_remove() Colorize red at 50% opacity $img-> colorize( '#FF0000'. Desaturate (grayscale) $img-> desaturate() Fill image with white color $img-> fill( '#fff') Shrink the image proportionally to fit inside a 500x500 box $img-> best_fit( 500, 500) Shrink the image to the specified height while maintaining proportion (height) $img-> fit_to_height( 200) Shrink the image to the specified width while maintaining proportion (width) $img-> fit_to_width( 320) Trim the image and resize to exactly 100x75 $img-> adaptive_resize( 100, 75) Adjust the orientation if needed (physically rotates/flips the image based on its EXIF 'Orientation' property) $img-> auto_orient() Rotate the image 90 degrees clockwise $img-> rotate( 90) Flip the image horizontally (use 'y' to flip vertically) $img-> flip( 'x') Add 'SimpleImage' => 'Shekarsiri\Simpleimage\SimpleImage' to your 'aliases' array in the app\config\app.php file.Add 'Shekarsiri\Simpleimage\SimpleimageServiceProvider' to your 'providers' array in the app\config\app.php file.Add "shekarsiri/simpleimage": "dev-master" to your /laravel/composer.json.This class requires PHP 5.3 and PHP GD library. Convert between GIF, JPEG, and PNG formats.Overlay one image onto another (watermarking).Desaturate, colorize, pixelate, blur, etc.Resize images (free resize, resize to width, resize to height, resize to fit).It 90 degrees clockwise, shrink it to fit within a 320x200 box, apply a sepiaĮffect, convert it to a GIF, and save it to result.gif. The two lines inside the try block load image.jpg, flip it horizontally, rotate
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |