Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taylorfinnell/imagecr
Quickly determine image types and attributes in Crystal
https://github.com/taylorfinnell/imagecr
Last synced: 11 days ago
JSON representation
Quickly determine image types and attributes in Crystal
- Host: GitHub
- URL: https://github.com/taylorfinnell/imagecr
- Owner: taylorfinnell
- License: mit
- Created: 2017-10-23T21:48:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-28T02:44:13.000Z (over 5 years ago)
- Last Synced: 2024-10-25T02:04:40.150Z (about 2 months ago)
- Language: Crystal
- Homepage:
- Size: 7.2 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# imagecr
[![Build Status](https://travis-ci.org/taylorfinnell/imagecr.svg?branch=master)](https://travis-ci.org/taylorfinnell/imagecr)Image.cr is a shard to quickly and performantly identify an image type and basic
attributes of the image.## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
imagecr:
github: taylorfinnell/imagecr
```## Supported Image Types
- TIFF
- GIF
- BMP
- PNG
- PSD## Usage
```crystal
require "imagecr"
```Open from a URL.
```
image = Imagecr.open("http://someserver.com/test.png")
image.type # => "png"
image.width # => 100
image.height # => 100
```Open from a local file.
```
image = Imagecr.open("~/Downloads/test.png")
image.type # => "png"
image.width # => 100
image.height # => 100
```