Download the PHP package it-blaster/crop-bundle without Composer

On this page you can find all versions of the php package it-blaster/crop-bundle. 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 crop-bundle

CropBundle

Scrutinizer Code Quality Build Status License Total Downloads Latest Unstable Version Latest Stable Version

This bundle is designed to create crops for images using the user-friendly UI in your forms. It uses the fengyuanchen/cropper jquery plugin and it-blaster/uploadable-bundle to handle images uploading.

Installation

Add it-blaster/crop-bundle to your composer.json file and run composer

Register the bundle in your AppKernel.php

Configure it-blaster/uploadable-bundle

Usage

1. Configure the CroppableBehavior for your table in schema.xml:

The parameter columns must contain one or more columns' names on which you want to apply this behavior (default value: image). If your table contains other file-columns and you use the UploadableBundle to handle them, don't worry: this bundle automatically adds its columns into UploadableBehavior configuration.

The CroppableBehavior creates two methods for each configured column: setCroppable<column_name> and getCroppable<column_name>. (For example, if you configured the behavior as above, in your base model will be created following methods: setCroppableFirstImage, getCroppableFirstImage, setCroppableSecondImage and getCroppableSecondImage). You have to use this methods if you want to set up the croppable FormType or get a cropped image.

2. Include bundle's resources in your page:

Also remember that this bundle doesn't contain the JQuery library that's required for the cropper plugin.

3. Configure your form:

This construction adds a crop control for a picture in your form. Required parameters width and height set up the minimum size of the crop area. You can read more about the croppable FormType's configuration in the relevant section.

After you upload an image, you'll see it with the crop area over it. Now you can select a part of the image and save crop coordinates.

4. The bundle contains a twig filter crop that provide you an ability to get a cropped image:

If you configured a few crops for one picture, you can pass an index of the crop you want:

CroppableFormType configuration

The full set of specific parameters that you can pass to croppable field looks as follows:

label

It's not a specific parameter but you need to know that this label display before all the field's controls.

width and height

Determine the default minimum size of the crop area. You can't select a part of image less than minimum.

validate

This parameter enables or disables validation for the image file. Validation constraints include a check of the mime-type (only gif, png and jpg formats are allowed) and a check of minimum picture's size (the image can't be less than the biggest of its crops). Default value: true.

max_canvas_width and max_canvas_height

These two values determine the max size of canvas in which will be inserted the original image and the crop control. The original image will be scaled proportionally. If you want to disable this limitation, set 0 or false to this options. Default values: 640 and 480 pixels.

instances

instances is a very important option. By default there is only one crop for each image. But if you want to do more different crops for one image, you can configure them in this option. It must be an array of array. Each of them describes one crop instance and takes three optional parameters:

TODO


All versions of crop-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
symfony/framework-bundle Version ~2.1
it-blaster/uploadable-bundle 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 it-blaster/crop-bundle contains the following files

Loading the files please wait ....