escpos-image 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3027cc8f6b64944bf51ab301eb078f8261afee063dc2cb1da644a1b84d5a016a
4
- data.tar.gz: 84cd2ce46feb585bd67f7d042bfeab6c5349740e5f568dc49106b2b15fa8832e
3
+ metadata.gz: cbbe37a75125cdbe23b571c0fcc3448653c57d6758f9ac2e8caaaa4b8a87daae
4
+ data.tar.gz: 6385051a04e48cf6223b71228ca7789f057a405515d9d6bb47ab0bd9c902cf10
5
5
  SHA512:
6
- metadata.gz: d615849b9b58d2459cd917850ab08bc0e1f06f0065df04bce8ed8dd25f3df3995f36fc98d5b273a95038d3fe4a6d09ea032926d3bd7f66c3cf206ea539af1b35
7
- data.tar.gz: bf4931809d7edfdb3a61f7c9e5325313a72b5d3583a10644956f1445dfac8cdef77281057bf3a6b3ec565b49b43ffe0b41a752709f13d56ea003c54f9f49adf5
6
+ metadata.gz: 3aec5d8f102a05c66f0123d1e0b1a7e12b4901701501cc86362003c29b542ebf5d8ecc4c632e593e10a57c2bb3fe78151983cd3383c470e66582dfe4f799968b
7
+ data.tar.gz: a40b937a4af26c5ae40d032862ba99d395237ca6f0f7160d45a22a4857019adf1be1a2c75491986cccdf5f56e6982091dcc4951332550355b4115ea18f148e45
data/README.md CHANGED
@@ -26,18 +26,28 @@ Or install it yourself as:
26
26
 
27
27
  ```ruby
28
28
  @printer = Escpos::Printer.new
29
-
30
29
  image = Escpos::Image.new 'path/to/image.png'
31
- # to use automatic conversion to monochrome format (requires mini_magick gem) use:
30
+
31
+ # Recommended usage for best results:
32
+ # Supports all mini_magick formats
33
+ # Converts the image to monochrome, applies dithering and blends alpha
34
+ # Requires the mini_magick gem installed
32
35
  image = Escpos::Image.new 'path/to/image.png', {
33
36
  convert_to_monochrome: true,
34
- dither: true, # the default
35
- extent: true, # the default
36
- compose_alpha: false, # the default
37
- compose_alpha_bg: 255, # default, assume white background
37
+ dither: true, # default
38
+ extent: true, # default
39
+ }
40
+
41
+ # Alternative usage:
42
+ # Supports only PNG images
43
+ # Does NOT require the mini_magick gem installed
44
+ image = Escpos::Image.new 'path/to/image.png', {
45
+ compose_alpha: true, # default
46
+ compose_alpha_bg: 255, # default, assumes white background
38
47
  }
39
48
 
40
49
  @printer.write image.to_escpos
50
+ @printer.write image # version 0.0.7 and up
41
51
 
42
52
  @printer.to_escpos # returns ESC/POS data ready to be sent to printer
43
53
  # on linux this can be piped directly to /dev/usb/lp0
data/escpos-image.gemspec CHANGED
@@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "minitest", "~> 5.4"
26
26
  spec.add_development_dependency "mini_magick"
27
27
 
28
- spec.add_dependency "escpos"
28
+ spec.add_dependency "escpos", ">= 0.0.7"
29
29
  spec.add_dependency "chunky_png"
30
30
  end
data/lib/escpos/image.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Escpos
2
2
  class Image
3
3
 
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
 
6
6
  attr_reader :options
7
7
 
@@ -9,7 +9,7 @@ class ImageTest < Minitest::Test
9
9
  image_path = File.join(__dir__, '../../fixtures/tux_mono.png')
10
10
  image = Escpos::Image.new image_path
11
11
 
12
- @printer.write image.to_escpos
12
+ @printer.write image
13
13
  @printer.write "\n" * 10
14
14
  @printer.cut!
15
15
  image.chunky_png_image.metadata = {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escpos-image
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Svoboda
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 0.0.7
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 0.0.7
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: chunky_png
85
85
  requirement: !ruby/object:Gem::Requirement