Download the PHP package tobento/service-picture without Composer
On this page you can find all versions of the php package tobento/service-picture. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-picture
Picture Service
The Picture Service provides interfaces for creating and rendering a picture for PHP applications. It comes with a default implementation but you may create specific implementation to fit your requirements.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Picture Creator
- Create Picture Creator
- Picture Creating
- Created Picture
- Definition
- Array Definition
- Picture Definition
- Definitions
- Default Definitions
- Json Files Definitions
- Stack Definitions
- Picture
- Img
- Sources
- Source
- Srcset
- Src
- Picture Factory
- Picture Tag Factory
- Picture Tag
- Null Picture Tag
- Picture Creator
- Credits
Getting started
Add the latest version of the picture service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
Documentation
Picture Creator
The picture creator creates images based on the given Created Picture holding the images to be stored wherever you like.
Create Picture Creator
The picture creator uses the Imager Service to create images.
In Detail
Picture Creating
Create Picture From Stream
Use the method to create a picture from a PSR-7 stream:
Check out the Definition section to learn more about definitions.
You may check out the Picture section to learn more about the default implementation.
Create Picture From Resource
Use the method to create a picture from any resource implementing the interface:
Check out the Imager Service - Resource section to learn more about it.
Check out the Definition section to learn more about definitions.
You may check out the Picture section to learn more about the default implementation.
Supported Resources
Created Picture
The created picture holds all created images which you can use to store the images in the way you need it.
Check out the Encoded Response to learn more about it.
Definition
Array Definition
The array definition is the default picture definition.
Example with pixel density descriptors:
Picture Definition
Definitions
You may use the following definitions classes to add, filter and get definitions from.
Default Definitions
Json Files Definitions
The class loads definitions from JSON files within the given directories.
Example Directory:
Example Json Definition:
Stack Definitions
Picture
The picture class may be used to create, store or render the picture.
Srces
The method returns a Generator with all collected classes:
toTag
The method returns a new created picture tag.
Check out the Picture Tag section to learn more about the default .
jsonSerialize
The method serializes the object to a value that can be serialized natively by .
Img
Sources
Source
Srcset
Src
Picture Factory
The picture factory may be used to create a picture.
Create From Array
Use the method to create a picture from the given array:
Picture Tag Factory
The picture tag factory may be used to create picture tags.
Create From Picture
Use the method to create a picture tag from the given picture:
Picture Tag
The picture tag renders the picture html tag.
You may check out the Tag Service - Tag Interface section to learn more about the .
Render Picture
Null Picture Tag
The null picture tag does not render any content at all and may be useful in some sitations.
Credits
- Tobias Strub
- All Contributors
All versions of service-picture with dependencies
tobento/service-imager Version ^1.0
tobento/service-dir Version ^1.0
tobento/service-filesystem Version ^1.0
tobento/service-tag Version ^1.0.5
league/mime-type-detection Version ^1.15
psr/log Version ^1.1 || ^2.0 || ^3.0