Download the PHP package tobento/service-imager without Composer
On this page you can find all versions of the php package tobento/service-imager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-imager
Imager Service
Image processor interface for PHP applications using Intervention Image as default processor.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Basic Usage
- Create Imager
- Image Processing
- Resource
- Base64 Resource
- Binary Resource
- Data Url Resource
- File Resource
- Stream Resource
- Url Resource
- Action
- Background
- Blur
- Brightness
- Colorize
- Contrast
- Crop
- Encode
- Fit
- Flip
- Gamma
- Greyscale
- Orientate
- Pixelate
- Resize
- Rotate
- Sepia
- Save
- Sharpen
- Response
- Encoded Response
- File Response
- Advanced Usage
- Grouping Actions
- Creating New Action
- Actions To Messages
- Interfaces
- Imager Factory Interface
- Imager Interface
- Processor Factory Interface
- Processor Interface
- Resource Interface
- Action Interface
- Actions Interface
- Response Interface
- Intervention Image
- Intervention Imager Factory
- Intervention Processor Factory
- Basic Usage
- Credits
Getting started
Add the latest version of the imager service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
Documentation
Basic Usage
Create Imager
Check out the Imager Interface to learn more about the interface.
Image Processing
Check out the Resource section for available resources.
Check out the Action section for available actions and its response type.
Check out the Response section for response details.
You might be using the corresponding methods instead
Resource
Base64 Resource
Binary Resource
Data Url Resource
File Resource
You may check out the Filesystem Service - File to learn more about it.
Stream Resource
Url Resource
Action
Background
Applies the specified background color for transparent images.
Blur
Blurs the image.
Brightness
Adjusts the brightness of the image.
Colorize
Colorizes the image.
Contrast
Adjusts the contrast of the image.
Crop
Crops the image with the specified parameters.
Encode
Encodes image to the specified mime type.
Check out the Encoded Response to learn more about it.
mimeType
Supported mime types:
- or just ,
- or just
- or just
- or just
- or just
- or just , , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
quality
The quality for the image ranging from 0 to 100.
Fit
Fits image to the specified width and height.
position
- is default
Examples
Flip
Mirrors image horizontally or vertically.
flip
Gamma
Adjusts the gamma of the image.
Greyscale
Greyscales the image.
Orientate
Auto orientates image by EXIF data to display the image correctly.
Pixelate
Pixelates the image.
Resize
Resizes image by the specified parameters.
Examples
Rotate
Rotates image by the specified number of degrees clockwise and fills empty triangles left overs with the specified background color.
Sepia
Adds a sepia filter to the image.
Save
Saves the current processed state of the image to the specified filename.
Check out the File Response to learn more about it.
filename
The filename to save the processed image.
mimeType
The prioritized mimeType for the filename to save. If specified the filename will change its file extension to the corresponding format.
Supported mime types:
- or just ,
- or just
- or just
- or just
- or just
- or just , , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
- or just , if processor supports it
quality
The quality for the image ranging from 0 to 100.
overwrite
Option | Description |
---|---|
Allows overwriting image which is the default. | |
Creates unique image if exists. | |
Throws ActionException if image exists. |
modeDir
The directory mode to create the folders from the filename if they do not exist.
Sharpen
Sharpens the image.
Response
Encoded Response
File Response
The file response holds the processed image file.
Check out the Response Interface to learn more about it.
You may check out the Filesystem Service - File to learn more about it.
Advanced Usage
Grouping Actions
For reusage, you might create a group of actions to be processed.
Creating New Action
If you want to create a new action, you would need to handle each processor individually.
Actions To Messages
You might render the descriptions of the processed actions using the messages factory.
You may check out the Message Service to learn more about it.
You may check out the Actions Interface to learn more about it.
Interfaces
Imager Factory Interface
createImager
Creates a new imager.
Imager Interface
resource
Sets the image resource to perform the actions.
Check out the Resource section for available resources.
getResource
Returns the image resource or null if not set.
getProcessor
Returns the processor or null if not yet available.
file
Sets the image resource as file.
action
Adds an action to be processed.
Check out the Action section for available actions and its response type.
Processor Factory Interface
createProcessor
Creates a new processor for the specified resource.
Processor Interface
processAction
Processes the action specified.
Resource Interface
Action Interface
parameters
Returns the action parameters.
description
Returns a description of the action.
processedBy
The action by which the action was processed.
Actions Interface
add
Adds an action.
empty
If has any actions.
filter
Returns a new instance with the filtered actions.
only
Returns a new instance with the specified action(s) only.
except
Returns a new instance except the specified action(s).
withoutProcessedBy
Returns a new instance without actions processed by another.
all
Returns all actions.
Response Interface
actions
Returns the actions processed.
Intervention Image
Intervention Image imager implementation.
Intervention Imager Factory
Check out the Imager Factory Interface for its available methods.
Check out the Intervention Image Configuration for the config available parameters.
Intervention Processor Factory
Check out the Processor Factory Interface for its available methods.
Check out the Intervention Image Configuration for the config available parameters.
Credits
- Tobias Strub
- All Contributors
- Intervention Image
All versions of service-imager with dependencies
tobento/service-dir Version ^1.0
tobento/service-filesystem Version ^1.0
tobento/service-message Version ^1.0
intervention/image Version ^2.7