Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lesaff/statamic-imageinfo


https://github.com/lesaff/statamic-imageinfo

Last synced: 9 days ago
JSON representation

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" }}
my Image
{{ /imageinfo }}
```

returns

`my Image`

*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