Download the PHP package carrooi/images-manager without Composer

On this page you can find all versions of the php package carrooi/images-manager. 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 images-manager

Images manager

Build Status Donate

Simple to use tool for managing uploaded images.

BC break!

Be careful, version 3.0 was completely rewritten.

If you are using just latte templates and uploading images, it should be enough just to move basePath and baseUrl configuration under the storage section.

Installation

config.neon:

Namespaces

On your website you can have many different types of images. For example users' images, articles' images and so on. But you also want to keep them separate and this is where namespaces came from.

Namespace is actually just a directory in chosen path (in our example %appDir%/../www/uploads)

This means that users' images will be saved here: %appDir%/../www/uploads/user.

Only thing you need to do is create this directory.

Saving images

There is automatically registered "manager" service for handling all images operations, so lets include it and than use it (presenter will be enough for this example)

As you can see, isn't really simple, just call upload with desired image, namespace and final name. That's it :-)

But be careful, if there is already image with name david.jpg in users namespace, it will be removed with all its thumbnails as well.

Latte templates

This step also couldn't be easier, because there are some Latte macros prepared for you.

The nice thing about this package is that you don't need to worry about browsers cache. Increasing version number is automatically appended to all URLs, so browser will always try to load new images when you change it.

original image:

thumbnail with width:

thumbnail with width and height:

thumbnail with different resize method (default is fit):

You can even use names without files' extensions and images-manager will try to find it for you:

Found files' extensions are cached, so if you change some image in other way than with ImagesManager, you'll have to delete the cache yourself.

Other Latte macros

image:

is-image (with alias isImage):

is-not-image (with alias isNotImage):

Default images

Maybe you will want some default image. Users are again great example, because it is quite usual to have some default avatar. Default name of default image is default.jpg and it needs to be in desired namespace directory.

Dummy images

When even default image does not exists, you can show some dummy image (like cute cats). This is possible because of lorempixel service.

Entities, DTOs and so on instead of string names

With default setup, you have to use string names like david.jpg. But for users it would be better to use eg. their entities directly. You just have to configure custom namespace setup with own name resolver.

configuration:

Quality of images

Quality of jpg and png images can be customized. This can be done either globally for all image namespaces or for each image namespace separately.

Presets

If you are using specific sizes of images many time, it will be a good idea to create preset from such size. You can save all your images' sizes into configuration under some names and than use these names.

This is really good when you'll need to change some size in a future, you'll have to change it only in configuration.

configuration:

template:

which is same as:


All versions of images-manager with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
nette/di Version ^2.4
nette/application Version ^2.4
nette/caching Version ^2.5
latte/latte Version ^2.4
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 carrooi/images-manager contains the following files

Loading the files please wait ....