Releases: BKWLD/croppa
Preserving aspect ratio when cropping despite source image size
Previously, if an image was smaller than the requested dimensions, the image was not cropped at all. So if you called Croppa::url($url, 500,500)
image but the source was 500x400, you would get the original 500x400 image outputted.
Now, Croppa will give you a 400x400 image. In other words, it is preserving the original aspect ratio despite the source image size. This is important if you are showing a bunch of images in a grid and don't want gaps but you can't be sure that the source images are all big enough.
This release also adds a upscale
option that will tell Croppa to scale up images to match your requested dimensions. So, using the example above, with upscale
set to 1
, you will get a 500x500 image.
Fixes for max_crops config and deleting crops
Also includes better docs and tests for deleting crops in a subdirectory of of the src_dir.
Two new wiki pages were also created:
Fixes trim() option
Updating PHPThumb and fixing some URL options
- Fixes issue where jpgs were being created as pngs
- Fixes issue where pngs were getting a black background
- Fixes error when passing in
quality
andinterlace
options in the URL - Preparing for eventual update to Flysystem CachedAdapter (#87)
Croppa::delete() now correctly deletes crops
Fixing the facade's accessor reference
Merge pull request #82 from sdebacker/patch-1 Wrong service name in Facade
4.0
Flysystem support
In addition to the src_dir
being a local path, it can also be an IoC binding name to a Flysystem instance. Thus, your src images (and your crops) can be located on remote disks like S3, Dropbox, FTP, src.
Configuration
With this release major changes were made to the config file as part of the transition to Flysystem and to make the configuration more explicit / less confusing. For instance, the src_dir
is no longer an array of paths, there can be only one source. Also, a crops_dir
allows you to store the crops in a different directory than the source directory. Read the config file for docs on each option.
Fully dependency injected
The code architecture was rewritten from a single class to multiple that get instantiated using dependency injection through the Laravel container. This will make adding future tests and functionality easier and let people subclass and extend Croppa.
Support `route:cache` to work in L5
- #81 - Route handling is done with a
Controller
rather than a closure so applications that cache routes will not get a fatal error - Fixing composer.json so that L4 continues to be supported