Class: ImageRuby::DecoderLoader
- Inherits:
-
FileLoader
- Object
- FileLoader
- ImageRuby::DecoderLoader
- Defined in:
- lib/imageruby/persistor/decoder_loader.rb
Instance Method Summary collapse
Methods inherited from FileLoader
Instance Method Details
#load(path) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/imageruby/persistor/decoder_loader.rb', line 25 def load(path) content = nil File.open(path,"rb") do |file| content = file.read end begin ImageRuby::Decoder.decode(content, ImageRuby::Image) rescue ImageRuby::Decoder::UnableToDecodeException raise UnableToLoadException end end |