Download the PHP package rapidez/image-resizer without Composer

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

Rapidez Image Resizer

Instead of just loading the full and big images from Magento this extension resizes the images. This works by passing the Magento image path through the image route: /storage/{store id}/resizes/{size}/magento/{file}.

Let's say a product image is located at: https://magentowebsite.com/media/catalog/product/a/a/product-image.jpg the path will be /catalog/product/a/a/product-image.jpg. To get this image with a maximum width of 200 pixels you go to: /storage/1/resizes/200/magento/catalog/product/a/a/product-image.jpg. If you also want to specify a maximum height: /storage/1/resizes/200x200/magento/catalog/product/a/a/product-image.jpg.

Automatic webp conversion will also be done if the url has .webp as it's extension e.g. /storage/1/resizes/200x200/magento/catalog/product/a/a/product-image.jpg.webp This will make it retrieve the image from https://magentowebsite.com/media/catalog/product/a/a/product-image.jpg, resize it, format it as webp and save it as /storage/1/resizes/200x200/magento/catalog/product/a/a/product-image.jpg.webp.

Installation

This package is installed by default in Rapidez. But if removed you can re-install it with:

And make sure you ran php artisan storage:link

Image from SKU

You can retrieve a product image by using the product's SKU. This is enabled by default, but can be toggled with the sku.enabled value in the config file.

To retrieve a product image using SKU, request a path like this: /storage/1/resizes/200x200/sku/13706. You can also request a webp like this: /storage/1/resizes/200x200/sku/13706.webp.

Config

Keep in mind that you have to whitelist all sizes to avoid ddos attacks! Publish the config and specify the sizes you want:

External sources

If you are using images from other external location (see the CMS integrations) you can add that source:

Now you can use the following path to resize the images from the external source:

Or alternatively using Laravels route function

How it works

Images are downloaded from the media url and stored in /storage/app/public/<store>/resizes. Because of the symlink created with php artisan storage:link the files are then publicly available. Because the route is the same as the path, the webserver first tries to serve the file if it exists, otherwise it will go through PHP to resize and create it.

Deleting resizes

The image resizes can be deleted using this artisan command:

License

GNU General Public License v3. Please see License File for more information.


All versions of image-resizer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2
illuminate/http Version ^9.0|^10.0|^11.0
illuminate/routing Version ^9.0|^10.0|^11.0
illuminate/support Version ^9.0|^10.0|^11.0
rapidez/core Version ~0.54|^1.0|^2.0
spatie/image Version ^3.3
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 rapidez/image-resizer contains the following files

Loading the files please wait ....