Download the PHP package mercator/wn-media-plugin without Composer

On this page you can find all versions of the php package mercator/wn-media-plugin. 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 wn-media-plugin

Winter CMS Media Plugin

Improved media handling for WinterCMS, including:

Installation

composer

github

Twig Filters

iresize([width=null], [height=null], [filters=null], [extension=null], [quality=null])

or

ifilter([width=null], [height=null], [filters], [extension], [quality])

These are identical filters to resize images and apply filters to them.

If width and height are specified, the image is resized before applying any filters. This significantly boosts performance.

To keep the aspect ration of an image, set either width or height to zero (0).

Setting either width or height to null leaves this dimension untouched and results typically in distorted images. Examples:

resize only the width of the image. Likewise

resize only the height of the image

You can apply Intervention filters to the image. See the Intervention website for information about the available filters.

You can specify the filters as a Twig array:

Alternatively (but that this approach will be deprecated in the future) filters can be specified as a string, such as

Both examples would first resize the image to 150x100px, add a 1% blur filter, remove all red from the image and finally flip the image vertically.

By default, the plugin will serve an optimal image format depending on the rendering capabilities of the browser. If the optional parameter extension is specified, the plugin will convert the image to the image format corresponding to the extension. Valid extensions are jpg, gif, tiff and webp. If the respective image format supports compression, the quality can be explicitly set.

Consequence: If you specify an explicit exentsion, the browser might not be able to display it due to lack of functionality (e.g. webp images on certain Safari versions).

Twig Functions

exif([key])

Returns an array (key/value) of all EXIF meta data from image. Alternatively, if a key is set, it returns a string with the value for that EXIF key. If no data is found, null is returned.

Example

returns the camera's model name if set.

iptc([key])

Returns an array (key/value) of all IPTC meta data from image. Alternatively, if a key is set, it returns a string with the value for that IPTC key. If no data is found, null is returned.

Limitations and next steps

This is a pre-production version of the plugin. Winter's original resize function has not been fully implemented, in particular mode. Implementation will follow in the very near future.

Error handling must still be implemented, in particular failure to apply a filter, in particular when a filter is incorrectly written (e.g. blurs instead of blur).

A word of caution

Intervention is rather resource-intensive. As a consequence:


All versions of wn-media-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
composer/installers Version ~1.0
intervention/image Version ^2.5
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 mercator/wn-media-plugin contains the following files

Loading the files please wait ....