Download the PHP package adevendorf/craft-pretzelimage without Composer

On this page you can find all versions of the php package adevendorf/craft-pretzelimage. 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 craft-pretzelimage

Pretzel Image

Pretzel Image generates image transforms at browser request time. The resulting image is stored in a public folder. Because the controller route is the same as the actual file, we let the web server serve the actual file before passing it off to the plugin to process the request.

The generated file can be deleted from the server at any time because it will just be recreated if it no longer exists.

The images are organized into a two character directory, then asset ID subdirectory. This is done to mitigate the possibility, of too many directories/files in a single folder.

The original purpose of this plugin is to place a CDN in front of the site so that these generated images would only live a short time on the actual Craft CMS server.

In practice, this plugin works well for multi-instance Craft CMS setups on high traffic sites. By utilizing an NFS server, you can reuse the same generated images between all the servers, then load balance the CMS for image generation.

Configuration

Pretzel should work out of the box, but you can customize it.

PRETZEL_PATH

By default images are stored in the @web/_imgs directory, but you can override it in your .env file with PREZTEL_PATH

PRETZEL_PATH="images"

PRETZEL_HOSTS

Pretzel will allow images to be generated by any host when in Craft CMS is in Dev Mode, otherwise it will only accept referrers from the current defined site url, or hosts you define in:

PRETZEL_HOSTS="www.somesite.com,help.somesite.com"

How to use

There are 3 arguments you pass into a url method.

  1. The Craft CMS Asset
  2. Object (or Array) of transformations
  3. (Optional) Default object of transformations that will be applied to all images

Twig

If multiple transformation configurations are passed, an array is returned instead of a URL string.

PHP (Element API)

Image Options

width


height:


ratio


position: 50-50 (default)


mode: crop (default), fill

Requirements

This plugin requires Craft CMS 4 or later, and PHP 8.0.2 or later.

TODO


All versions of craft-pretzelimage with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^5.0.0
intervention/image Version ^2.7.0
ext-fileinfo 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 adevendorf/craft-pretzelimage contains the following files

Loading the files please wait ....