• Stars
    star
    272
  • Rank 151,235 (Top 3 %)
  • Language
    PHP
  • Created almost 11 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Image manipulation library for Laravel 4 and 5 based on Imagine (https://github.com/avalanche123/Imagine) and inspired by Croppa for easy url based manipulation (with caching)

Laravel Image

Laravel Image is an image manipulation package for Laravel 4 and 5 based on the PHP Imagine library. It is inspired by Croppa as it can use specially formatted urls to do the manipulations. It supports basic image manipulations such as resize, crop, rotation and flip. It also supports effects such as negative, grayscale, gamma, colorize and blur. You can also define custom filters for greater flexibility.

Latest Stable Version Build Status Total Downloads

The main difference between this package and other image manipulation libraries is that you can use parameters directly in the url to manipulate the image. A manipulated version of the image is then saved in the same path as the original image, creating a static version of the file and bypassing PHP for all future requests.

For example, if you have an image at this URL:

/uploads/photo.jpg

To create a 300x300 version of this image in black and white, you use the URL:

/uploads/photo-image(300x300-crop-grayscale).jpg

To help you generate the URL to an image, you can use the Image::url() method

Image::url('/uploads/photo.jpg',300,300,array('crop','grayscale'));

or

<img src="<?=Image::url('/uploads/photo.jpg',300,300,array('crop','grayscale'))?>" />

Alternatively, you can programmatically manipulate images using the Image::make() method. It supports all the same options as the Image::url() method.

Image::make('/uploads/photo.jpg',array(
	'width' => 300,
	'height' => 300,
	'grayscale' => true
))->save('/path/to/the/thumbnail.jpg');

or use directly the Imagine library

$thumbnail = Image::open('/uploads/photo.jpg')
			->thumbnail(new Imagine\Image\Box(300,300));

$thumbnail->effects()->grayscale();
	
$thumbnail->save('/path/to/the/thumbnail.jpg');

Features

This package use Imagine for image manipulation. Imagine is compatible with GD2, Imagick, Gmagick and supports a lot of features.

This package also provides some common filters ready to use (more on this):

  • Resize
  • Crop (with position)
  • Rotation
  • Black and white
  • Invert
  • Gamma
  • Blur
  • Colorization
  • Interlace

Version Compatibility

Laravel Image
4.2.x 0.1.x
5.0.x 0.2.x
5.1.x 0.3.x
5.2.x 0.3.x

Installation

Dependencies:

Server Requirements:

Installation:

1- Require the package via Composer in your composer.json.

{
	"require": {
		"folklore/image": "0.3.*"
	}
}

2- Run Composer to install or update the new requirement.

$ composer install

or

$ composer update

3- Add the service provider to your app/config/app.php file

'Folklore\Image\ImageServiceProvider',

4- Add the facade to your app/config/app.php file

'Image' => 'Folklore\Image\Facades\Image',

5- Publish the configuration file and public files

$ php artisan vendor:publish --provider="Folklore\Image\ImageServiceProvider"

6- Review the configuration file

app/config/image.php

Documentation

Roadmap

Here are some features we would like to add in the future. Feel free to collaborate and improve this library.

  • More built-in filters such as Brightness and Contrast
  • More configuration when serving images
  • Artisan command to manipulate images
  • Support for batch operations on multiple files

More Repositories

1

laravel-graphql

Facebook GraphQL for Laravel 5. It supports Relay, eloquent models, validation and GraphiQL.
PHP
1,764
star
2

robot-illustrator

Automate Adobe Illustrator with Node.js and Applescript
JavaScript
14
star
3

laravel-hypernova

Laravel package to use Hypernova server-side rendering service of Javascript UI Components (React)
PHP
14
star
4

TTS

PHP script to output mp3 from text using text-to-speech
PHP
8
star
5

eloquent-localizable

Laravel 4 and 5 package to add localization capabilities to Eloquent Models
PHP
5
star
6

yeoman-generator-laravel

Yeoman generator for Laravel web application used by Folklore
JavaScript
5
star
7

laravel-pages

Laravel 4 and 5 package containing models dealing with pages and blocks content.
PHP
5
star
8

laravel-image

PHP
4
star
9

laravel-locale

Localization package for Laravel 5
PHP
3
star
10

eloquent-json-schema

Laravel package to add a new cast type to eloquent model so you can use JSON Schema.
PHP
3
star
11

eloquent-picturable

Laravel 4 and 5 package to add pictures capabilities to Eloquent Models
PHP
3
star
12

react-scene

React Component that helps to handle a scene lifecycle (play, pause, mute, unmute, resize...).
JavaScript
3
star
13

panneau-js

React components to build forms and administration panels
JavaScript
2
star
14

laravel-panneau

Laravel package to create administration dashboards
PHP
2
star
15

laravel-bazar

PHP
2
star
16

laravel-mediatheque

Package to manage medias within Laravel
PHP
2
star
17

Camcorder

Webcam recorder and playback plugin in Flash and Javascript
ActionScript
2
star
18

eloquent-mediatheque

PHP
2
star
19

homebrew-fonts

Homebrew formulas to install css3FontConverter, woff2 and sfnt2woff
Ruby
2
star
20

raconteur

Framework for building interactive experiences like web documentaries, interactive music videos, etc...
PHP
2
star
21

node-twitter-processor

Process tweets with Twitter Streaming API and Node.js
JavaScript
1
star
22

obs-remote

JavaScript
1
star