Download the PHP package tiross/imagecraft without Composer
On this page you can find all versions of the php package tiross/imagecraft. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package imagecraft
Imagecraft
Imagecraft is a reliable and extensible PHP image manipulation library. It can edit and compose images in multiple layers and supports watermark, resize and text. Furthermore, it keeps GIF animation, optimizes memory usage, catches memory exhausted error, and gives an user-friendly/translated feedback.
Imagecraft is intended to be an image abstraction & manipulation layer, which offers a PDO-like API. It currently supports GD extension, and will support ImageMagick in version 2.0. If you have any suggestions, comments or feedback, let me know. Thanks.
Requirement
- PHP >= 5.6.0
- PHP GD extension
Installation
Composer is the recommended way to install Imagecraft, simply add a dependency to your project's composer.json file:
`
Or, you can install from an archive file: imagecraft_1.0.4.zip
Usage
Provide the User with a Hint on What He Needs to Upload
``
Build an Image in Fluent Pattern
- Client uploads an image from URL.
- Server performs resize and watermark operations.
- Server returns a message in English if an error occured, such as data size exceeds allowable limit (2MB), timeout expired (20s), file not found, etc.
``
Build an Image in Classic Pattern
- Client uploads an image directly.
- Server performs thumbnail and text operations.
- Server returns a message in traditional Chinese if an error occured.
``
When Debugging is Easier than Expected
``
Cheat Sheet
Options
Name | Default | Available | Description |
---|---|---|---|
engine |
php_gd |
php_gd |
image library to be used |
cache_dir |
n/a |
n/a |
project-specific cache directory |
debug |
true |
true, false |
debug mode of your project |
locale |
en |
en, zh_TW, .. |
error message language |
jpeg_quality |
100 |
[0, 100] |
quality of the JPEG image |
png_compression |
100 |
[0, 100] |
compression level of the PNG image |
memory_limit |
-10 |
[-∞, ∞] |
maximum memory to use in MB |
gif_animation |
true |
true, false |
whether to maintain the GIF animation |
output_format |
default |
jpeg, png, .. |
output image format |
Layers
Method | Compatible |
---|---|
http( $url, $dataLimit = -1, $timeout = -1) |
BackgroundLayer , ImageLayer |
filename($filename) |
BackgroundLayer , ImageLayer |
contents($contents) |
BackgroundLayer , ImageLayer |
resize($width, $height, $option = 'shrink') |
BackgroundLayer , ImageLayer |
move($x, $y, $gravity = 'center') |
ImageLayer , TextLayer |
font($filename, $size = 12, $color = '#FFF') |
TextLayer |
label($label) |
TextLayer |
angle( $angle) |
TextLayer |
lineSpacing($lineSpacing) |
TextLayer |
box(array $paddings, $color = null) |
TextLayer |
- Letting your mouse hover over should cause a tooltip to appear.
- Method
http()
,filename()
orcontents()
is required forBackgroundLayer
andImageLayer
. - Methods
font()
andlabel()
are required forTextLayer
.
Tips
-
In addition to the default English error message, Imagecraft can be switched to other languages. You can help with existing translations or to add another language. The translation files are located at:
Resources
-
Mike Flickinger (2005) "What's In A GIF".
-
David C. Kay (1994) "Graphic File Formats".
All versions of imagecraft with dependencies
coldume/imc-stream Version ~1.0
coldume/translated-exception Version ~1.0
symfony/event-dispatcher Version ~2.4