PHPackages                             validoll/kohana-imagecache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. validoll/kohana-imagecache

ActiveKohana-module[Image &amp; Media](/categories/media)

validoll/kohana-imagecache
==========================

A Kohana module for create resized / cropped images.

3171PHP

Since Oct 17Pushed 11y ago2 watchersCompare

[ Source](https://github.com/validoll/kohana-imagecache)[ Packagist](https://packagist.org/packages/validoll/kohana-imagecache)[ RSS](/packages/validoll-kohana-imagecache/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

ImageCache
==========

[](#imagecache)

This module allows you to quickly create resized / cropped images. Modified images are cached after the initial request and served up thereafter to help reduce server strain,and also available, even when ImageCache switch off, on the same URL which was generated.

Compatibility
-------------

[](#compatibility)

ImageCache currently works with Kohana 3.2 and 3.3

Getting Started
---------------

[](#getting-started)

In your `application/bootstrap.php` file modify the call to Kohana::modules and include the image and imagecache modules.

```
Kohana::modules(array(
    ...
    'image'    => MODPATH.'image',
    'imagecache' => MODPATH.'imagecache',
    ...
));

```

\[!!\] The image module is requried for the ImageCache module to work.

Configuration
-------------

[](#configuration)

The default config files is located in `MODPATH/imagecache/config/*`.

- Main configuration - `MODPATH/imagecache/config/imagecache.php`
- Configuration patterns for modify images - `MODPATH/imagecache/config/imagecache_patterns.php`

You should copy this files to `APPPATH/config/*` and make changes there, in keeping with the cascading filesystem.

Configuration Options (imagecache.php)
--------------------------------------

[](#configuration-options-imagecachephp)

Empty or undefined options will always fallack to their defaults.

**cache\_expire:** 604800 Number of seconds before the browser checks the server for a new version of the modified image.

**cache\_dir:** 'cache/' Path to the image cache directory you would like to use, don't forget the trailing slash!

**quality:** 80 The default quality of images when not specified in the URL.

**scale\_up:** FALSE If the image should be scaled up beyond it's original dimensions on resize.

**default\_image:** FALSE Default image if the requested image is not available. For example:

```
'default_image'    => 'files/misc/default.png',

```

**watermarks**Configure one or more watermarks. Each configuration key can be passed as a param through an Imagefly URL to apply the watermark.

If no offset is specified, the center of the axis will be used. If an offset of TRUE is specified, the bottom of the axis will be used.

```
// Example watermarks
'watermarks' => array(
    'first_watermark' => array(
        'image'    => 'path/to/first/watermark.png',
        'offset_x' => TRUE,
        'offset_y' => TRUE,
        'opacity'  => 80
    ),
    'second_watermark' => array(
        'image'    => 'path/to/second/watermark.png',
        'offset_x' => 5,
        'offset_y' => 5,
        'opacity'  => 50
    )
)

```

Patterns configuration (imagecache\_patterns.php)
-------------------------------------------------

[](#patterns-configuration-imagecache_patternsphp)

Example of pattern settings:

```
'thumb' => array(
   'width' => '50%',
   'height' => '50px',
   'crop' => TRUE,
   'quality' => 80,
   'watermark' => 'custom_watermark',
),

```

**width**Width of cached image. Allow 'px' or '%' suffix.

**height**Height of cached image. Allow 'px' or '%' suffix.

**crop**Use crop for cached image. If 'FALSE', then use scale.

**quality**Quality of cached image.

**watermark**Name of one of watermark from the main config file.

Usage Examples
--------------

[](#usage-examples)

Here are some examples of what you can do with ImageCache.

At first set path of cache dir in your `imagecache.php`. For example:

```
'cache_dir' => 'files/imagecache/',

```

At second set at least one pattern in your `imagecache_patterns.php`. For example:

```
'thumb' => array(
    'width' => '80',
    'height' => '80',
    'crop' => TRUE,
),

```

**Use this path for get resized image**``

Notes
-----

[](#notes)

- This is project based on [Imagefly](https://github.com/Bodom78/kohana-imagefly) by [Fady Khalife](https://github.com/Bodom78)
- ImageCache will not process images when the width and height prams are the same as the source
- Don't forget to make your cache directory writable.
- Inspired by the [smart-lencioni-image-resizer](http://code.google.com/p/smart-lencioni-image-resizer/) by Joe Lencioni

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a70ac2a3b3e7c26766b37a8e63f35815edce495af603ab2e98835b4857155b8?d=identicon)[validoll](/maintainers/validoll)

---

Top Contributors

[![validoll](https://avatars.githubusercontent.com/u/1042711?v=4)](https://github.com/validoll "validoll (26 commits)")[![Bodom78](https://avatars.githubusercontent.com/u/139152?v=4)](https://github.com/Bodom78 "Bodom78 (25 commits)")[![jlazic](https://avatars.githubusercontent.com/u/1408904?v=4)](https://github.com/jlazic "jlazic (3 commits)")[![pridemon](https://avatars.githubusercontent.com/u/1212365?v=4)](https://github.com/pridemon "pridemon (2 commits)")[![imuller](https://avatars.githubusercontent.com/u/697558?v=4)](https://github.com/imuller "imuller (1 commits)")

### Embed Badge

![Health badge](/badges/validoll-kohana-imagecache/health.svg)

```
[![Health](https://phpackages.com/badges/validoll-kohana-imagecache/health.svg)](https://phpackages.com/packages/validoll-kohana-imagecache)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
