Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

imagecache

Caching extension for the Intervention Image Class

Subscribe to updates I use imagecache


Statistics on imagecache

Number of watchers on Github 351
Number of open issues 27
Average time to close an issue 14 days
Main language PHP
Average time to merge a PR 2 days
Open pull requests 10+
Closed pull requests 6+
Last commit about 2 years ago
Repo Created over 6 years ago
Repo Last Updated over 1 year ago
Size 75 KB
Homepage http://image.inte...
Organization / Authorintervention
Contributors2
Page Updated
Do you use imagecache? Leave a review!
View open issues (27)
View imagecache activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating imagecache for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Intervention Image Cache

Intervention Image Cache extends the Intervention Image Class package to be capable of image caching functionality.

The library uses the Illuminate/Cache package and can be easily integrated into the Laravel Framework. Based on your Laravel cache configuration you are able to choose between Filesystem, Database, Memcached or Redis for the temporary buffer store.

The principle is simple. Every method call to the Intervention Image class is captured and checked by the caching interface. If this particular sequence of operations already have taken place, the data will be loaded directly from the cache instead of a resource-intensive image operation.

Installation

You can install this package quickly and easily with Composer.

Require the package via Composer:

$ composer require intervention/imagecache

Now you are able to require the vendor/autoload.php file to PSR-4 autoload the library.

Laravel Integration

The Image Cache class supports Laravel integration. Best practice to use the library in Laravel is to add the ServiceProvider and Facade of the Intervention Image Class.

Open your Laravel config file config/app.php and add the following lines.

In the $providers array add the service providers for this package.

'providers' => array(

    [...]

    'Intervention\Image\ImageServiceProvider'
),

Add the facade of this package to the $aliases array.

'aliases' => array(

    [...]

    'Image' => 'Intervention\Image\Facades\Image'
),

Usage

The Image Cache is best called by the static method Image::cache from the Intervention Image class.

To create cached images just use the static method Image::cache and pass the image manipulations via closure. The method will automatically detect if a cached file for your particular operations exists.

// run the operations on the image or read a file
// for the particular operations from cache
$img = Image::cache(function($image) {
   return $image->make('public/foo.jpg')->resize(300, 200)->greyscale();
});

Determine a lifetime in minutes for the cache file as an optional second parameter. Pass a boolean true as optional third parameter to return an Intervention Image object instead of a image stream.

// determine a lifetime and return as object instead of string
$img = Image::cache(function($image) {
   return $image->make('public/foo.jpg')->resize(300, 200)->greyscale();
}, 10, true);

License

Intervention Imagecache Class is licensed under the MIT License.

imagecache open issues Ask a question     (View All Issues)
  • about 3 years URL Manipulation - Cache does not change when original image changes
  • over 3 years Intervention with imagecache get height
  • almost 4 years Not working in Laravel 5.2
  • almost 4 years storage/cache directory not building out
  • almost 4 years Imagecache URL routing not working on live server
  • about 4 years with extension => resource not found
  • about 4 years Cache in filesystem problems
  • over 4 years Custom templates doesn't work
  • over 4 years How to add imagecache route to my existing group
  • over 4 years Slow cache?
  • almost 5 years Cannot encode multiple times?
imagecache open pull requests (View All Pulls)
  • Use Laravel filesystems
  • Usage of non default laravel cache drivers
  • Added possibility to define Templates with arguments
  • Priority file source location for configured templates are introduced
  • Recursive search filename
  • Make private methods protected
  • Added variables to the template classes in the config file
  • Make ImageCacheController compatible with lumen and laravel
  • Add default image (no image) option
  • Support Laravel FileSystems
imagecache questions on Stackoverflow (View All Questions)
  • Laravel 5 Intervention ImageCache URL routing not working on live server
  • Laravel 5: Intervention Image, imagecache. Missing argument 2 error
  • Lightbox2 - Custom integration with CCK Imagefield and Imagecache
  • Laravel 4 imagecache intervention not displaying images
  • iitialize ImageCache from the context of an activity
  • imagecache not displaying preset images
  • ImageResizer.NET - too many images in imagecache folder
  • Resizing Teaser Images using Drupal ImageCache diminishes image quality
  • How do I force Drupal ImageCache create image styles on upload, not on first image request?
  • Clear the cache of all manipulations of an image using Intervention/ImageCache with Laravel
  • volley imageCache and imageRequest both cache the image
  • Imagecache Drupal 6 Permissions Not Showing Thumbnails
  • Imagecache actions textaction PHP code
  • where does drupal save images when you use cck and imagecache?
  • Drupal 6 + Imagecache + nginx = no images
  • how to combine drawRect: and ImageCache to speed up table view scrolling
  • OutOfMemoryException thrown due to ImageCache Memory Leak on Android
  • How to remove ImageCache when we use SDImageCache?
  • User profile picture is not displaying properly on comments with Imagecache
  • Drupal 7 imagecache effects not rendering in Chrome or Safari but ok in Firefox
  • Drupal ImageCache Action Features?
  • imagecache of atrium in Drupal
  • How to provide a default image file for ImageCache to use and process when the original does not exist?
  • Should I use Bitmap or Drawable to store in ImageCache on Android?
  • drupals imagecache module only works with 'default' site?
  • Drupal imagecache is not working for the first time
  • How to let Drupal editors choose an imagecache preset when uploading to imagefield?
  • Generate image with Drupal imagecache before using imagecache_create_path & getimagesize
  • How to remove imagecache classes in a view in Drupal
  • Drupal Imagecache not working
imagecache list of languages used
More projects by Intervention View all
Other projects in PHP