Download the PHP package steirico/kirby-plugin-image-crop-field without Composer

On this page you can find all versions of the php package steirico/kirby-plugin-image-crop-field. 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 kirby-plugin-image-crop-field

Kirby Image Crop Field

This plugin provides a field for cropping images visually and very flexibly.

kirby-plugin-image-crop-field

The field is based on vue-cropperjs and gumlet/php-image-resize.

Installation

Use one of the alternatives below.

Download

Download and copy this repository to `/site/plugins/kirby-plugin-image-crop-field.

Git submodule

Composer

Usage

File Blueprint Usage

The plugin defines the new field type imagecrop which can be used in file blueprints. Define an appropriate file blueprint for images and add the field as follow:

/site/blueprints/files/image.yml:

Blueprint Options

minSize

Defines the minimum allowed size of the area that can be cropped from the original image.

Defaults:

targetSize

Target size of the image after it has been cropped. The resulting image will be scaled to width as defined by targetSize.width and height as defined by targetSize.height.

For both, width and height, negative values are interpreted as absolute values.

Defaults: The resulting image represents the cropped area and is not scaled.

preserveAspectRatio

Whether to preserve the aspect ratio of the crop area as defined by minSize.width / minSize.height or to allow free cropping:

Default: false

Cropped Image in the Panel

The plugin provides the file method called croppedImage. Applied as any other file method, croppedImage provides a file object of the cropped version of origin image.

The following configuration previews the cropped image in a files sections:

/site/blueprints/pages/album.yml:

Use Cropped Image in Templates and Snippets

Use the the file method called croppedImage in order to work with the cropped image in templates and snippets:


  <figure>
    <?= $page->image()->croppedImage() ?>
  </figure>

Issues

Feel free to file an issue if you encounter any problems or unexpected behavior.

Currently there is a know issue that crooped images apear twice when geting images by $page->images().

License

MIT

Credits


All versions of kirby-plugin-image-crop-field with dependencies

PHP Build Version
Package Version
Requires gumlet/php-image-resize Version 2.0.*
getkirby/composer-installer Version ^1.1
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 steirico/kirby-plugin-image-crop-field contains the following files

Loading the files please wait ...