escpos-image 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +69 -0
- data/Gemfile +4 -0
- data/README.md +47 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/escpos-image.gemspec +30 -0
- data/lib/escpos/helpers.rb +9 -0
- data/lib/escpos/image.rb +84 -0
- data/test/fixtures/tux_alpha.png +0 -0
- data/test/fixtures/tux_mono.png +0 -0
- data/test/lib/escpos/image_test.rb +30 -0
- data/test/test_helper.rb +9 -0
- metadata +134 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a9b0ee34ebffb71648d1f88d9393ef8691655398
|
4
|
+
data.tar.gz: 93c058d21c06840560942e325aec82a54ca57a9e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c2431794b2c3d3847ae4f6b085ede7b8287abdaadad9037f1b633e875b92325064135d7a24334f7a626d51a2e0ed09bda7b7431d215fcb072e7fb333ff65af46
|
7
|
+
data.tar.gz: 4a7c21beb08c0bfe494792b327d5121933f1dc19debde67b5cd31efac962a2d13673363411025052015e79697fc34e2c7e193bc4de0dbc0782ca4aefa19552aa
|
data/.gitignore
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Compiled source #
|
2
|
+
###################
|
3
|
+
*.com
|
4
|
+
*.class
|
5
|
+
*.dll
|
6
|
+
*.exe
|
7
|
+
*.o
|
8
|
+
*.so
|
9
|
+
|
10
|
+
# Packages #
|
11
|
+
############
|
12
|
+
# it's better to unpack these files and commit the raw source
|
13
|
+
# git has its own built in compression methods
|
14
|
+
*.7z
|
15
|
+
*.dmg
|
16
|
+
*.gz
|
17
|
+
*.iso
|
18
|
+
*.jar
|
19
|
+
*.rar
|
20
|
+
*.tar
|
21
|
+
*.zip
|
22
|
+
|
23
|
+
# Logs and databases #
|
24
|
+
######################
|
25
|
+
*.log
|
26
|
+
*.sql
|
27
|
+
*.sqlite
|
28
|
+
*.sqlite3
|
29
|
+
|
30
|
+
# OS generated files #
|
31
|
+
######################
|
32
|
+
.DS_Store
|
33
|
+
.DS_Store?
|
34
|
+
._*
|
35
|
+
.Spotlight-V100
|
36
|
+
.Trashes
|
37
|
+
ehthumbs.db
|
38
|
+
Thumbs.db
|
39
|
+
|
40
|
+
# Rails
|
41
|
+
*.rbc
|
42
|
+
*.sassc
|
43
|
+
.sass-cache
|
44
|
+
capybara-*.html
|
45
|
+
.rspec
|
46
|
+
/log
|
47
|
+
/tmp
|
48
|
+
/db/*.sqlite3
|
49
|
+
/public/system
|
50
|
+
/coverage/
|
51
|
+
/spec/tmp
|
52
|
+
**.orig
|
53
|
+
rerun.txt
|
54
|
+
pickle-email-*.html
|
55
|
+
config/initializers/secret_token.rb
|
56
|
+
config/secrets.yml
|
57
|
+
|
58
|
+
## Environment normalisation:
|
59
|
+
/.bundle
|
60
|
+
/vendor/bundle
|
61
|
+
|
62
|
+
# these should all be checked in to normalise the environment:
|
63
|
+
# Gemfile.lock, .ruby-version, .ruby-gemset
|
64
|
+
|
65
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
66
|
+
.rvmrc
|
67
|
+
|
68
|
+
pkg/*
|
69
|
+
Gemfile.lock
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Escpos-image
|
2
|
+
|
3
|
+
A ruby implementation of ESC/POS (thermal) printer image command specification.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'escpos-image'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install escpos-image
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
@printer = Escpos::Printer.new
|
25
|
+
|
26
|
+
image = Escpos::Image.new 'path/to/image.png'
|
27
|
+
# to use automatic conversion to monochrome format (requires mini_magick gem) use:
|
28
|
+
image = Escpos::Image.new 'path/to/image.png', convert_to_monochrome: true
|
29
|
+
|
30
|
+
@printer.write image.to_escpos
|
31
|
+
|
32
|
+
@printer.to_escpos # returns ESC/POS data ready to be sent to printer
|
33
|
+
# on linux this can be piped directly to /dev/usb/lp0
|
34
|
+
# with network printer sent directly to printer socket
|
35
|
+
# with serial port printer it can be sent directly to the serial port
|
36
|
+
|
37
|
+
@printer.to_base64 # returns base64 encoded ESC/POS data
|
38
|
+
|
39
|
+
## Contributing
|
40
|
+
|
41
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/escpos/escpos-image.
|
42
|
+
|
43
|
+
1. Fork it ( https://github.com/escpos/escpos-image/fork )
|
44
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
45
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
46
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
47
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "escpos/image"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'escpos/image'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "escpos-image"
|
8
|
+
spec.version = Escpos::Image::VERSION
|
9
|
+
spec.authors = ["Jan Svoboda"]
|
10
|
+
spec.email = ["jan@mluv.cz"]
|
11
|
+
spec.summary = %q{A ruby implementation of ESC/POS (thermal) printer image command specification.}
|
12
|
+
spec.description = %q{A ruby implementation of ESC/POS (thermal) printer image command specification.}
|
13
|
+
spec.homepage = "https://github.com/escpos/escpos-image"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.required_ruby_version = ">= 1.9"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
|
26
|
+
spec.add_development_dependency "minitest", "~> 5.4.2"
|
27
|
+
|
28
|
+
spec.add_dependency "escpos"
|
29
|
+
spec.add_dependency "chunky_png"
|
30
|
+
end
|
data/lib/escpos/image.rb
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
module Escpos
|
2
|
+
class Image
|
3
|
+
|
4
|
+
VERSION = "0.0.1"
|
5
|
+
|
6
|
+
def initialize(image_path, opts = {})
|
7
|
+
if opts.fetch(:convert_to_monochrome, false)
|
8
|
+
require_mini_magick!
|
9
|
+
image = convert_to_monochrome(image_path, opts)
|
10
|
+
@image = ChunkyPNG::Image.from_file(image.path)
|
11
|
+
else
|
12
|
+
@image = ChunkyPNG::Image.from_file(image_path)
|
13
|
+
end
|
14
|
+
|
15
|
+
unless @image.width % 8 == 0 && @image.height % 8 == 0
|
16
|
+
raise ArgumentError.new("Image width and height must be a multiple of 8.")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_escpos
|
21
|
+
bits = []
|
22
|
+
mask = 0x80
|
23
|
+
i = 0
|
24
|
+
temp = 0
|
25
|
+
|
26
|
+
0.upto(@image.height - 1) do |y|
|
27
|
+
0.upto(@image.width - 1) do |x|
|
28
|
+
r, g, b, a =
|
29
|
+
ChunkyPNG::Color.r(@image[x, y]),
|
30
|
+
ChunkyPNG::Color.g(@image[x, y]),
|
31
|
+
ChunkyPNG::Color.b(@image[x, y]),
|
32
|
+
ChunkyPNG::Color.a(@image[x, y])
|
33
|
+
px = (r + g + b) / 3
|
34
|
+
raise ArgumentError.new("PNG images with alpha are not supported.") unless a == 255
|
35
|
+
value = px > 128 ? 255 : 0
|
36
|
+
value = (value << 8) | value
|
37
|
+
temp |= mask if value == 0
|
38
|
+
mask = mask >> 1
|
39
|
+
i = i + 1
|
40
|
+
if i == 8
|
41
|
+
bits << temp
|
42
|
+
mask = 0x80
|
43
|
+
i = 0
|
44
|
+
temp = 0
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
[
|
50
|
+
Escpos.sequence(IMAGE),
|
51
|
+
[@image.width / 8, @image.height ].pack("SS"),
|
52
|
+
bits.pack("C*")
|
53
|
+
].join
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def require_mini_magick!
|
59
|
+
unless defined?(MiniMagick)
|
60
|
+
begin
|
61
|
+
require 'mini_magick'
|
62
|
+
rescue LoadError => e
|
63
|
+
raise 'Required options need the mini_magick gem installed.'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def convert_to_monochrome(image_path, opts = {})
|
69
|
+
image = MiniMagick::Image.open(image_path)
|
70
|
+
image.flatten
|
71
|
+
image.grayscale 'Rec709Luma'
|
72
|
+
if opts.fetch(:dither, true)
|
73
|
+
image.monochrome
|
74
|
+
else
|
75
|
+
image.monochrome '+dither'
|
76
|
+
end
|
77
|
+
if opts.fetch(:extent, true)
|
78
|
+
image.extent "#{(image.width/8.0).round*8}x#{(image.height/8.0).round*8}"
|
79
|
+
end
|
80
|
+
image
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
Binary file
|
Binary file
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require_relative '../../test_helper'
|
2
|
+
|
3
|
+
class TestPrinter < Minitest::Test
|
4
|
+
def setup
|
5
|
+
@printer = Escpos::Printer.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_image
|
9
|
+
image_path = File.join(__dir__, '../../fixtures/tux_mono.png')
|
10
|
+
image = Escpos::Image.new image_path
|
11
|
+
|
12
|
+
@printer.write image.to_escpos
|
13
|
+
@printer.write "\n" * 10
|
14
|
+
@printer.cut!
|
15
|
+
#pp @printer.to_base64
|
16
|
+
assert_equal @printer.to_base64, 'G0AddjAAEACYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//gAAAAAAAAAAAAAAAAAD///AAAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAD////gAAAAAAAAAAAAAAAB////+AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAf////+AAAAAAAAAAAAAAAP/////gAAAAAAAAAAAAAAH/////8AAAAAAAAAAAAAAB//////gAAAAAAAAAAAAAA//////4AAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAH//////wAAAAAAAAAAAAAB//////8AAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAP//////4AAAAAAAAAAAAAD//////+AAAAAAAAAAAAAA///////gAAAAAAAAAAAAAP//////8AAAAAAAAAAAAAD///////AAAAAAAAAAAAAA////D//wAAAAAAAAAAAAAP///Af/8AAAAAAAAAAAAAH4P/gB//AAAAAAAAAAAAAB8B/wAf/wAAAAAAAAAAAAAfAP8AD/8AAAAAAAAAAAAAHgD+AA//AAAAAAAAAAAAAB4AfgwH/4AAAAAAAAAAAAAeEHweB/+AAAAAAAAAAAAAHjh8Hwf/gAAAAAAAAAAAAA58fD8H/4AAAAAAAAAAAAAOfHw/B/+AAAAAAAAAAAAADnx+Pwf/gAAAAAAAAAAAAA5/w/8H/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MAAAAAAA/AAB/8AAAAAcADAAAAAAAP/AH//AAAAAcAAwAAAAAAD/////wAAAAcAAOAAAAAAAf////8AAAAeAABgAAAAAAH////+AAAAOAAAMAAAAAAB/////gAAAGAAAB8AAAAAA/////4AAADAAAAH/wAAAAP/gAf/AAABgAAAAH/4AAAD4AAAAwAAAwAAAAAAfgAABgAAAAMAAAYAAAAAAAfAAA4AAAABgAAMAAAAAAAB8AAcAAAAAcAAOAAAAAAAAH4AeAAAAADAAHAAAAAAAAAP/+AAAAAAcAHgAAAAAAAAAf+AAAAAADwPgAAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAAACgoKCgoKCgoKCh1WAA=='
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_image_conversion
|
20
|
+
image_path = File.join(__dir__, '../../fixtures/tux_alpha.png')
|
21
|
+
image = Escpos::Image.new image_path, convert_to_monochrome: true
|
22
|
+
|
23
|
+
@printer.write image.to_escpos
|
24
|
+
@printer.write "\n" * 10
|
25
|
+
@printer.cut!
|
26
|
+
#pp @printer.to_base64
|
27
|
+
assert_equal @printer.to_base64, 'G0AddjAAEACYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAD//AAAAAAAAAAAAAAAAAAH//+AAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAP////AAAAAAAAAAAAAAAAH////4AAAAAAAAAAAAAAAB/////AAAAAAAAAAAAAAAB/////4AAAAAAAAAAAAAAAf/////AAAAAAAAAAAAAAAP/////wAAAAAAAAAAAAAAH/////+AAAAAAAAAAAAAAB//////gAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAD//////4AAAAAAAAAAAAAA//////+AAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAH//////8AAAAAAAAAAAAAB//////+AAAAAAAAAAAAAA///////wAAAAAAAAAAAAAH//////8AAAAAAAAAAAAAD///8H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AAAAAYAAAAAGAGAAAAABwAAAAAMAAAAABwAwAAAAAcAAAAADAAAAAAMAIAAAAADgAAAAAwAAAAADAHAAAAAAYAAAAAcAAAAAAwBgAAAAADAAAAAGAAAAAAYAYAAAAAA4AAAAHgAAAAAOAGAAAAAAHAAAAH4AAAAAHADgAAAAAA8AAAH8AAAAAPgAwAAAAAAPwAAP/AAAAAHgAMAAAAAAB/wCf/wAAAAPgADAAAAAAAf////8AAAAHgAAwAAAAAAD/////AAAAHgAAGAAAAAAB/////gAAAHgAABwAAAAAAP////8AAABwAAAPgAAAAAH////+AAABwAAAA/+AAAAB/9qf/wAAA4AAAAB//AAAAfgAAGsAAAcAAAAAAH+AAAOAAAADAAAGAAAAAAAH4AAHAAAAAYAAHAAAAAAAAHgABgAAAAHAADgAAAAAAAA+ADwAAAAAwABwAAAAAAAAB/v4AAAAAHABwAAAAAAAAAH/4AAAAAA8B4AAAAAAAAAABAAAAAAAH/4AAAAAAAAAAAAAAAAAAAP4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgoKCgoKCgoKCh1WAA=='
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: escpos-image
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jan Svoboda
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 5.4.2
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.4.2
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: escpos
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: chunky_png
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: A ruby implementation of ESC/POS (thermal) printer image command specification.
|
84
|
+
email:
|
85
|
+
- jan@mluv.cz
|
86
|
+
executables:
|
87
|
+
- console
|
88
|
+
- setup
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- Gemfile
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- bin/console
|
97
|
+
- bin/setup
|
98
|
+
- escpos-image.gemspec
|
99
|
+
- lib/escpos/helpers.rb
|
100
|
+
- lib/escpos/image.rb
|
101
|
+
- test/fixtures/tux_alpha.png
|
102
|
+
- test/fixtures/tux_mono.png
|
103
|
+
- test/lib/escpos/image_test.rb
|
104
|
+
- test/test_helper.rb
|
105
|
+
homepage: https://github.com/escpos/escpos-image
|
106
|
+
licenses:
|
107
|
+
- MIT
|
108
|
+
metadata: {}
|
109
|
+
post_install_message:
|
110
|
+
rdoc_options: []
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.9'
|
118
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
requirements: []
|
124
|
+
rubyforge_project:
|
125
|
+
rubygems_version: 2.5.1
|
126
|
+
signing_key:
|
127
|
+
specification_version: 4
|
128
|
+
summary: A ruby implementation of ESC/POS (thermal) printer image command specification.
|
129
|
+
test_files:
|
130
|
+
- test/fixtures/tux_alpha.png
|
131
|
+
- test/fixtures/tux_mono.png
|
132
|
+
- test/lib/escpos/image_test.rb
|
133
|
+
- test/test_helper.rb
|
134
|
+
has_rdoc:
|