lib/jpeg.rb in jpeg-0.4.0 vs lib/jpeg.rb in jpeg-0.5.0
- old
+ new
@@ -1,22 +1,20 @@
require 'tempfile'
+require 'jpeg/version'
require 'jpeg/jpeg'
+require 'jpeg/image'
-class Jpeg
+module Jpeg
def self.open_buffer(str)
tmp = Tempfile::new("ruby-jpeg")
tmp.set_encoding Encoding::BINARY if tmp.respond_to?(:set_encoding)
tmp.puts str
tmp.rewind
- jpeg = Jpeg.open(tmp.path)
+ jpeg = Jpeg::Image.open(tmp.path)
tmp.close
jpeg
end
- def rgb?
- color_info == :rgb
- end
-
- def gray?
- color_info == :gray
+ def self.open(file)
+ Jpeg::Image.open(file)
end
end