barby 0.6.0 → 0.6.1

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
  SHA1:
3
- metadata.gz: eebdb2eff35d0984c66ce11079fd6a524c95ae08
4
- data.tar.gz: 03d708dff70b1b71f0117e9c23e6bbd1c00f5915
3
+ metadata.gz: ad8050c7d031bdc4c866046b84740632b1f72b74
4
+ data.tar.gz: daf30f880b830c955b4653684d95996bd0906356
5
5
  SHA512:
6
- metadata.gz: 5bfe166db311575c6da4f69d95135443f47529b5eef5f23bdb947fd7076e60f77495e54f7559a3fce24bd7c062db2eb344b6b2f354915974ecc238f23763a019
7
- data.tar.gz: e183f8086780beb20e4c0220024262a93d1f3bccb6e522cf7633bfb66831702051d61e17a727e3314b85f73c3ffbe365aeab5e46d9dcb21c0cab2275874ce892
6
+ metadata.gz: 9ba0fac4a2f56fd7c88689d1b09b69c72a1556e138d0e59a807e4dfe39aef3d1b775770e354fa19e0e2e1cd5e2b9525b6e6a9cfe8fc5c25920a2c0396ad7d7b7
7
+ data.tar.gz: ce42a339359f0a77ba6127b43be32fc10fc82078a4d99e2883e9a0882c8325f4b5a9b9fe7950841b424b818c8bd23ee895443355d395f6d43bc6448084a273f0
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ * 0.6.1
2
+
3
+ * Fix single-pixel error with RMagick [James Brink]
4
+
1
5
  * 0.6
2
6
 
3
7
  * Add automatic character set to Code128
@@ -46,26 +46,35 @@ module Barby
46
46
  canvas = Magick::Image.new(full_width, full_height)
47
47
  bars = Magick::Draw.new
48
48
 
49
- x = margin
50
- y = margin
49
+ x1 = margin
50
+ y1 = margin
51
51
 
52
52
  if barcode.two_dimensional?
53
53
  encoding.each do |line|
54
54
  line.split(//).map{|c| c == '1' }.each do |bar|
55
55
  if bar
56
- bars.rectangle(x, y, x+(xdim-1), y+(ydim-1))
56
+ x2 = x1+(xdim-1)
57
+ y2 = y1+(ydim-1)
58
+ # For single pixels use point
59
+ if x1 == x2 && y1 == y2
60
+ bars.point(x1,y1)
61
+ else
62
+ bars.rectangle(x1, y1, x2, y2)
63
+ end
57
64
  end
58
- x += xdim
65
+ x1 += xdim
59
66
  end
60
- x = margin
61
- y += ydim
67
+ x1 = margin
68
+ y1 += ydim
62
69
  end
63
70
  else
64
71
  booleans.each do |bar|
65
72
  if bar
66
- bars.rectangle(x, y, x+(xdim-1), y+(height-1))
73
+ x2 = x1+(xdim-1)
74
+ y2 = y1+(height-1)
75
+ bars.rectangle(x1, y1, x2, y2)
67
76
  end
68
- x += xdim
77
+ x1 += xdim
69
78
  end
70
79
  end
71
80
 
@@ -2,7 +2,7 @@ module Barby #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tore Darell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-28 00:00:00.000000000 Z
11
+ date: 2014-05-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Barby creates barcodes.
14
14
  email: toredarell@gmail.com