escper 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/escper.rb +6 -2
  2. data/lib/escper/version.rb +1 -1
  3. metadata +3 -3
data/lib/escper.rb CHANGED
@@ -1,8 +1,12 @@
1
1
  require 'RMagick'
2
2
  module Escper
3
3
  class Image
4
- def initialize(img)
5
- @image = convert(Magick::Image.read(img).first)
4
+ def initialize(data, type)
5
+ if type == :file
6
+ @image = convert(Magick::Image.read(data).first)
7
+ elsif type == :blob
8
+ @image = convert(Magick::Image.from_blob(data).first)
9
+ end
6
10
  end
7
11
 
8
12
  def convert(img=nil)
@@ -1,3 +1,3 @@
1
1
  module Escper
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 2
9
- version: 1.0.2
8
+ - 3
9
+ version: 1.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Franzl
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-10-20 00:00:00 +02:00
17
+ date: 2011-10-24 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20