Download the PHP package rvdlee/zf-image-resizer without Composer

On this page you can find all versions of the php package rvdlee/zf-image-resizer. 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 zf-image-resizer

ZF3 Package to resize images

Latest Version on Packagist Scrutinizer Code Quality Total Downloads GitHub license Donate

This is a image resizer package. I've written this with ZF3 in mind, everything is written with configuration over convention in mind. Highly extendible and easy in use. You can use this along side my other package to optimise images.

Key features of this package is:

Usage

To get started you need to choose one of the programs to resize with. By default we support ImageMagick out of the box. It is mainstream and does a fantastic job at resizing images while maintaining great image quality.

You will need a bit of configuration to get started. We kept the validation chain simple since ImageMagick support over 200 formats. If you are writing your own adapter you now have the option to validate if the image is suitable for resizing through that adapter.

The model has a few calculations build in and some fallback logic when certain parameters are not provided. A good example would be the ratio scaling when only the width or height is provided.

Other calculations included is to crop based on one of nine locations on the image. Here are a few examples of crops. The beautiful image was published under a free license by Scott Walsh. Thanks for doing that!

Here we have the full image. I resized the original photo for the example because its quality and resolution was a bit high to illustrate an image resizer.

Full image, by

Let's start simple. An image resize. You can resize the following image using one of the two methods, you can define the width and height $imageResizerService->resizeImage($file->getPath(), 300, 200) or simply only provide the width $imageResizerService->resizeImage($file->getPath(), 300) or height $imageResizerService->resizeImage($file->getPath(), 0, 200). When you only provide either of them, it will rescale the image by ratio.

Resized to 300x200

Then there is a simple crop. We are going to use build-in calculations to crop the center of the image with a defined cropped width and height. $imageResizerService->cropImage($file->getPath(), 350, 350, Image::CENTERED_CROP))).

Cropped 350x350 Centered

You are the master of your own crop and you can define the width and height how you want. Choosing the centered or any other mode already provided by the package. $imageResizerService->cropImage($file->getPath(), 300, 450, Image::CENTERED_CROP)

Cropped 300x450 Centered

Additionally, there is also an manual mode if you want full control. The last two parameters are the x and y coordinates of the crop.$imageResizerService->cropImage($file->getPath(), 400, 400, Image::MANUAL_CROP, 0, 400)

Manual 400x400 crop with own coordinates

InputFilters

Just like my optimiser package we support InputFilters to make resizing a breeze when uploading photo's like avatars for example. Passing along the Image::CENTERED_CROP option to the service object automatically makes a centered crop of the original video.

Using an InputFilter is easy.

Service

The service object is the baseline of the resizer. You can use DI to instance this anywhere in your zend application. We also use support logging to catch all output from the programs used to resize images.

The service by default gets decked out with a default Zend\Log\Writer\Mock writer. You can still access the logs in this writer. You can override this when building the service. Allowing you to provide a DB, Logfile or Stdout writer.

If you want to access the logs in the Mock writer, just use the following snippet. Locate the Mock writer and then look at the events.


All versions of zf-image-resizer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^7.3
zendframework/zend-modulemanager Version ^2.8
zendframework/zend-servicemanager Version ^2.7.8 || ^3.3
zendframework/zend-mvc Version ^2.7.10 || ^3.0.1
zendframework/zend-filter Version ^2.9
zendframework/zend-validator Version *
zendframework/zend-stdlib Version ^3.2
zendframework/zend-log Version ^2.11
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 rvdlee/zf-image-resizer contains the following files

Loading the files please wait ....