These work reasonably well, but there are a number of disadvantages:
- The APIs are thin wrappers around the relevant image libraries. Neither of them offer particularly developer-friendly APIs, and the two APIs aren’t equal enough to make switching between them simple.
- You have to know which library your server has in order to start developing, or make extra work, and support both.
On a recent project I needed to do image manipulation (thumbnail generation etc.), and came across the Intervention Image library. This is a PHP library that can be used in any PHP project, and offers a much improved API for working with images. The API is agnostic to whether you’re using ImageMagick, or GD, so you can swap between them at will without having to re-code your application.
Next time you’re working with images, check out Intervention Image.
- Stuff I’ve used
- Error tracking with Sentry
- Autotrack for Google Analytics
- WordPress performance tracking with Time-stack
- Enforce user password strength
- WYSIWYG with Summernote
- Backing up your Laravel app
- Adding Google Maps to your Laravel application
- Activity logging in Laravel
- Image handling in PHP with Intervention Image
- Testing Laravel emails with MailThief
- Assessing software health
- IP Geolocation with MaxMind’s GeoLite2
- Uptime monitoring with Uptime Robot
- Product tours with Hopscotch
- Background processing for WordPress
- Using oEmbed resources in Laravel