https://github.com/themeplate/image
OTF processing but quietly generated
https://github.com/themeplate/image
image-processing on-the-fly wordpress
Last synced: 4 months ago
JSON representation
OTF processing but quietly generated
- Host: GitHub
- URL: https://github.com/themeplate/image
- Owner: ThemePlate
- License: gpl-3.0
- Created: 2020-03-23T17:55:46.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2025-03-01T04:45:53.000Z (over 1 year ago)
- Last Synced: 2025-03-01T05:25:16.712Z (over 1 year ago)
- Topics: image-processing, on-the-fly, wordpress
- Language: PHP
- Homepage:
- Size: 99.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ThemePlate Image
## Usage
```php
use ThemePlate\Image;
Image::register( 'wanted_size', 1920, 1080 );
Image::manipulate( 'wanted_size', 'pixilate', 10 );
Image::register( 'another_size', 640, 480 );
Image::manipulate( 'another_size', 'greyscale' );
Image::manipulate( 'another_size', 'blur', 20 );
$processor = Image::processor();
$processor->report( function( $output ) {
error_log( print_r( $output, true ) );
} );
// Simply use the core functions like you normally would
// - wp_get_attachment_image
// - wp_get_attachment_image_url
// - the_post_thumbnail
// - get_the_post_thumbnail
// - get_the_post_thumbnail_url
```
### Force refresh image/s
`/?tpi_refresh=`
`/?tpi_refresh[]=&tcs_refresh[]=`
> _works only when logged-in_
### Image::register( $name, $width, $height )
- **$name** _(string)(Required)_ Size identifier
- **$width** _(int)(Required)_ Width in pixels
- **$height** _(int)(Required)_ Height in pixels
### Image::manipulate( $size, $filter, $args )
- **$size** _(string)(Required)_ Registered size
- **$filter** _(string)(Required)_ Filter to apply
- **$args** _(array)(Optional)_ Parameters to pass. Default `null`
> See available filters in
### Image::processor()
Do the processing(crop/resize and manipulations) in the background