https://github.com/taylorfinnell/imagecr
Quickly determine image types and attributes in Crystal
https://github.com/taylorfinnell/imagecr
Last synced: 4 months 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-28T02:44:13.000Z (almost 6 years ago)
- Last Synced: 2025-02-05T22:18:51.026Z (5 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
[](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
```