Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lesaff/statamic-imageinfo
https://github.com/lesaff/statamic-imageinfo
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lesaff/statamic-imageinfo
- Owner: lesaff
- Created: 2015-05-12T13:07:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-26T13:43:03.000Z (almost 9 years ago)
- Last Synced: 2023-08-06T05:21:27.483Z (over 1 year ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Info Add-on for Statamic
By Rudy Affandi (2015)Version 1.0.3
## What is this?
Use this plugin/modifier to get meta information from any given image## Changelog
- 1.0.3 - Added modifier option
- 1.0.2 - Fixed issue with displaying images from array
- 1.0.1 - Added all available meta information from getimagesize()
- 1.0.0 - Initial release## Installation
Copy the 'imageinfo' folder to the '_add-ons' folder in your Statamic website.## How to use
### As a modifier
`{{ image|imageinfo:width }}`returns `500`
`{{ image|imageinfo:dimension }}`
returns `width="500" height="300"`
*Available parameter*
- `src`: The image url
- `width` returns the width of image
- `height` returns the height of image
- `dimension` returns `width="XX" height="YY"`
- `bits` returns the number of bits for each color
- `channel` returns either `3` for RGB, or `4` for CMYK
- `mime` returns image mime type### As a plugin
```
{{ imageinfo src="{ image }" }}
{{ /imageinfo }}
```returns
``
or
```
{{ imageinfo src="/assets/img/image.png" }}
{{ /imageinfo }}
```returns
``
*Parameter*
- `src`: The image source*Available tag output*
- `src`: The image url
- `width` returns the width of image
- `height` returns the height of image
- `dimension` returns `width="XX" height="YY"`
- `bits` returns the number of bits for each color
- `channel` returns either `3` for RGB, or `4` for CMYK
- `mime` returns image mime type