Download the PHP package wcactus/croppedimages without Composer

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

Laravel 5 module for creating preconfigured image thumbnails on the fly

Features

N.B. this module does not contain visual image editor!

Installation

This module requires Laravel 5.4 or higher.

  1. Add CroppedImages to your Laravel project: composer require wcactus/croppedimages
  2. Publish config file and migration: php artisan vendor:publish --tag=croppedimages
  3. Apply migration: php artisan migrate

Facade and service provider will be autoloaded.

Directories structure

Original images and their crops stored using Laravel file storage functionality. You can choose disk and folder inside the disk to save images to.

The path to file looks like this: uplinkClass/cropName/uplinkId/fileName

For original image cropName will be «original».

This structure allows you to delete all the crops created for the uplink in one action, if you need to change the cropping configuration.

Configuration

The configuration file is located at config/croppedimages.php.

The target of configuration process is to define a list of allowed cropping variants for all Eloquent models that can have attached images, and to set cropping parameters for each cropping variant. You can also define storage disk and folder.

Here is configuration example:

As you can see, in this example we have defined two crops («main_page_logo» and «small») for App\Brand model, and one crop («small») for App\Product model.

The crop properties are:

The chosen cropping method doesn't take any effect when cropping is performed with explicitly defined parameters (offsets and scale).

FYI: if you prefer «public» storage drive to store image files, don’n forget to create a symbolic link using php artisan storage:link command.

Usage

The URL schema is similar to directory structure: http(s)://app.url/.../uplinkType/cropName/uplinkId/filename

Add this to your routes file:

Use CroppedImages::src($image, $cropName) method to generate original image or crop URL in your Blade templates:

For original image, $cropName must be set to «original».

Use WithCroppedImages trait it in each Eloquent model that can have attached images:

Use methods described below to add, modify and remove original images and their crops.

Methods

CroppedImages::routes() Register route to get existing images and their crops and to crop images on the fly.

CroppedImages::src(Wcactus\CroppedImages\CroppedImage $image, string $cropName) Get image URL.

CroppedImages::configuredCrops(string $uplinkClass) Return confugured crops for provided uplink's class name.

CroppedImages::addImage(Illuminate\Database\Eloquent\Model &$uplink, string $sourcePath, string $alt=null, string $filename=null, string $hash=null) Save new image. Only the original image is saved, no crops are created here.

CroppedImages::moveUp(Wcactus\CroppedImages\CroppedImage &$image) Move image one position up.

CroppedImages::moveDown(Wcactus\CroppedImages\CroppedImage &$image) Move image one position down.

CroppedImages::removeImage(Wcactus\CroppedImages\CroppedImage &$image) Delete original image and all its crops.

CroppedImages::removeAllImages(Illuminate\Database\Eloquent\Model &$uplink) Delete all images and their crops for provided uplink model.

CroppedImages::createAllCrops(Wcactus\CroppedImages\CroppedImage &$image) Create all configured crops of image.

CroppedImages::createCrop(Wcactus\CroppedImages\CroppedImage &$image, string $cropName, float $x=null, float $y=null, float $scale=null, integer $asteriskW=null, integer $asteriskH=null) Create one crop of image and return crop file's path.

CroppedImages::removeCrop(Wcactus\CroppedImages\CroppedImage &$image, string $cropName) Delete one crop of image.


All versions of croppedimages with dependencies

PHP Build Version
Package Version
Requires intervention/image Version ~2.0
illuminate/support Version ~5.0
illuminate/database Version ~5.0
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 wcactus/croppedimages contains the following files

Loading the files please wait ....