Git Product home page Git Product logo

fastimage.cr's Introduction

fastimage.cr

Build Status GitHub release GitHub license

Library that finds the dimensions and type of an image fetching as little as needed.

Documentation

https://jetrockets.github.io/fastimage.cr

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      fastimage:
        github:jetrockets/fastimage.cr
  2. Run shards install

Usage

require "fastimage"

.type : String|Nil

Returns image type. Returns nil if image type is not supported.

FastImage.type("https://file-examples.com/wp-content/uploads/2017/10/file_example_PNG_3MB.png")
# => png

.type! : String

Same as #type, but raise exception if anything goes wrong.

.dimensions : Tuple(UInt16?, UInt16?)|Nil

Returns image width and height as a Tuple(UInt16?, UInt16?). Returns nil if image type is not supported.

FastImage.dimensions("https://file-examples.com/wp-content/uploads/2017/10/file_example_PNG_3MB.png")
# => [2200, 1467]

.dimensions! : Tuple(UInt16?, UInt16?)

Same as #dimensions, but raise exception if anything goes wrong.

Feature Progress

  • Data sources
    • Remote file
      • HTTP/HTTPS
      • Proxy
      • HTTP redirects
    • Local file
    • IO
    • Base64
  • File formats
    • BMP
    • CUR
    • GIF
    • ICO
    • JPEG
      • parse EXIF information for JPEG orientation
    • PNG
    • PSD
    • SVG
    • TIFF
    • WEBP

Contributing

  1. Fork it (https://github.com/jetrockets/fastimage.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

fastimage.cr's People

Contributors

igor-alexandrov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fastimage.cr's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.