image_size

0.1.1 released

image_size.cr

CI

Get the image dimension (width and height) of various image types.

Supported types:

Installation

  1. Add the dependency to your shard.yml:
dependencies:
 image_size:
   github: hkalexling/image_size.cr
  1. Run shards install

Usage

require "image_size"

# Using the path to the image file
size = ImageSize.get "test.png"
pp size.width
pp size.height

# Using binary data
file = File.new "test.png"
bytes = Bytes.new file.size
file.read bytes
file.close
size = ImageSize.get bytes
pp size.width
pp size.height

Contributors

image_size:
  github: hkalexling/image_size.cr
  version: ~> 0.1.1
License MIT
Crystal 0.34.0

Authors

Dependencies 0

Development Dependencies 0

Dependents 1

Last synced .
search fire star recently