Skip to content

1.4.0

Choose a tag to compare

@oscarotero oscarotero released this 18 Aug 14:32
· 115 commits to master since this release
  • Use of constants to define the library to use (but you can keep using the strings "Gd", "Imagick"):
    php $image = Image::create('my-image.jpg', Image::LIB_IMAGICK);

  • The method Imagecow\Image::resize() accepts a fourth argument to resize the image using the smallest value instead the biggest. It's similar to css background-size: contain and background-size: cover. Example:

    //load an image of 400x200px
    $image = Imagecow\Image::create('image.jpg');
    
    $image->resize(100, 100, false); //the result is an image of 100x50px
    $image->resize(100, 100, false, true); //the result is an image of 200x100px
  • The use of proportions to define the position of the image on crop works like css's background-position great explained in this article

  • Implemented the constants Imagecow\Image::CROP_ENTROPY and Imagecow\Image::CROP_BALANCED to use instead x/y position in crop and resizeCrop methods. This methods are taken from stojg/crop library and only works in Imagick. For Gd there's a fallback that uses center/middle instead.

  • Improved documentation in README