Download the PHP package devfactory/imagecache without Composer

On this page you can find all versions of the php package devfactory/imagecache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package imagecache

Laravel Laravel License

Imagecache

Laravel 4/5 package that allows you to create image thumbnails according to predefined presets, and store them in your Laravel public folder to serve them up without generating them on each page load.

Installation

Using Composer, edit your composer.json file to require devfactory/imagecache.

Laravel 5
"require": {
    "devfactory/imagecache": "3.0.*"
}
Laravel 4
"require": {
    "devfactory/imagecache": "2.1.*"
}

Then from the terminal run

composer update

Then in your app/config/app.php file register the following service providers:

And the Facade:

Publish the config:

Laravel 5
php artisan vendor:publish
Laravel 4
php artisan config:publish devfactory/imagecache

Usage

Define some presets in:

Laravel 5

config/imagecache.presets.php

Laravel 4

app/config/packages/devfactory/imagecache/presets.php

get($filename, $preset, $args = NULL)

Parameter Description
$filename The FILENAME passed to the get() method is relative to the files_directory that you set in the config file (which itself is relative to the public_path config). So if you pass images/sunset.jpg, it will actually look for PUBLIC_PATH/uplaods/images/sunset.jpg with the default config. I haven't tried, but if you set public_path and files_directory to '', you should be able to pass aa absolute path to the file.
$preset One of the presets defined in the presets.php config file
$args (optional) An array of additional properties.

$args properties

Property Description
base_dir If you don't want to use the base folder you have setup in the config file because you are referencing a file that might be stored in your assets, you can pass an absolute path here to override the defaults
class A string containing any classes you want the <img> tag to contain
alt The alt text for the image
title The title text for the image

Return Value:

Property Description
src The URL to the image to be used inside the <img src=""> attribute
img The full <img> tag to display the image
img_nosize The full <img> tag without width and height attributes for use with responsive themes
path The full path to the image on storage

Example usages:

You can also directly access one of the properties as such without needing to if gate the call to get(). If using Laravel 5 you'll need to use the new raw notation instead of the double curly braces {{ ... }}.

If you set the use_placeholders variable to TRUE in the imagecache.config.php file, and your image doesn't exist or doesn't generate a cached version. Where you would normally receive an array with empty values, you can get a placeholder image matching the preset that you requested. This is very useful during developement when you might not have images for all your content.

get_original($filename, $args = NULL)

If you don't want to apply any preset to the image, but still want to use the call to generate the <img> tag, accepts same parameters and works the same way as get(), just without $preset

delete($filename)

Deletes all the cached images for each preset for the given filename.

Presets

When defining your presets, these are the options you can set:

Property Description
width required The width of the generated image in pixels.
height required The height of the generated image in pixels.
method required Defines the way the image will be transformed. See the table below for accepted methods
background_color optional The color of the canvas which will be used as a background when using the method resize. e.g. '#FFFFFF'.

The method property accepts the following types of transformations:

Method Description
crop Will smart crop an image to make it fit the desired dimensions. It will cut content of the image off the top/bottom and sides if required to preserve the aspect ratio.
resize Will create a canvas of the desired dimensions and will then resize the image to fit within the bounds without cropping. Images will not be upscaled if they are smaller then the dimensions. The optional property background_colorcan be used here to define the color of the canvas which the image will be placed on.

All versions of imagecache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
intervention/image Version ~2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devfactory/imagecache contains the following files

Loading the files please wait ....