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 +4 -4
- data/README.md +16 -6
- data/escpos-image.gemspec +1 -1
- data/lib/escpos/image.rb +1 -1
- data/test/lib/escpos/image_test.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbbe37a75125cdbe23b571c0fcc3448653c57d6758f9ac2e8caaaa4b8a87daae
|
4
|
+
data.tar.gz: 6385051a04e48cf6223b71228ca7789f057a405515d9d6bb47ab0bd9c902cf10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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, #
|
35
|
-
extent: true, #
|
36
|
-
|
37
|
-
|
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
data/lib/escpos/image.rb
CHANGED
@@ -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
|
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.
|
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:
|
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:
|
82
|
+
version: 0.0.7
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: chunky_png
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|