Gisc, short for Generic Image Signature Checker, is a generic image signature checker to validate if an image is of the type that is being loaded. Allows for making sure an image is a valid gif, jpeg or png.
Currently theonly supported image types are:
- jpg
- png
- gif
Add this to your application's shard.yml
:
dependencies:
Gisc:
github: exts/Gisc
require "Gisc"
imginfo = Gisc::Checker.new "path/to/image.png"
if imginfo.check "png"
puts "this is a valid png"
puts imginfo.signature
#puts imginfo.image.get() #read Gisc/Image.cr for more info
end
- Fork it ( https://github.com/exts/Gisc/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- exts exts - creator, maintainer