Download the PHP package brocode/module-image-optimizer without Composer

On this page you can find all versions of the php package brocode/module-image-optimizer. 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 module-image-optimizer

Image Optimizer Base - a Magento 2 setup for image optimizations

This module should ease the way of adding new image formats to a Magento 2 shop without the need of adapting any templates or markups.

Goals of this module:

Installation

Idea on how to delivery optimized images in a Magento 2 shop (or any other system)

Magento 2 is slow when delivering anything where a PHP process is involved in comparison to a simple file transfer for any file directly servable via the web server. This can be utilized to separate the conversion of the optimized images and serving them.

1) The conversion takes place within the Magento2 environment (or any other) to determine which files need conversion and to which file they should be converted to.

2) The webserver utilizes internal rewrites and file checks which file needs to be served, based on the request of the user agent (browser Accept-Header).

Following .htaccess snippet can be used to deliver WEBP images for certain directories if they do exists in addition to the original one:

Background information for this .htaccess entry:

The same can be done with any other image format (e.g. for AVIF use the mime type image/avif).

Features

Cronjob for folder scanning of images

Scans all configured image folders, can be disabled via configuration.

Configuration

The cronjob can be disabled under , it is enabled per default.

Image Paths

The cron job recieves via dependency injection BroCode\ImageOptimizer\Api\Data\ImagePathProviderInterface which can provide any directory to be scanned.

`

One default path provider is implemented, which takes arguments via di.xml. The current setting is for the pub/media folder, the Magento base folder is added automatically to every entry given:

Conversion Hooks

This module provides an event hook for every image that needs to be converted. This is implemented with an default Magento 2 event and can be utilized with an observer listening on the event . The event has following data stored that can be used:

Convert Validator

A convert validator checks if a given found image in any configured path needs conversion and which converter might be used for it. Every validator must implement . A base implementation for file checks is implemented in the abstract class .

These converter validator need to be contributed via di.xml to the :

Image conversion

There is currently no image conversion implemented in this module, this is done with following two basic modules:

Though there is the default which catches the conversion event and try to convert the image with the help of any converter contributed to the :

This is done synchronously and slows down the according cron execution, especially if there are many images.

Consider using the extensions for the usage of the Magento 2 queue system to asynchronously process image conversion:


All versions of module-image-optimizer with dependencies

PHP Build Version
Package Version
Requires magento/framework Version *
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 brocode/module-image-optimizer contains the following files

Loading the files please wait ....