zpng 0.1.1 → 0.1.2

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 (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/zpng/image.rb +4 -2
  3. data/zpng.gemspec +1 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/lib/zpng/image.rb CHANGED
@@ -59,12 +59,14 @@ module ZPNG
59
59
 
60
60
  def _from_string x
61
61
  if x
62
- if x[PNG_HDR]
62
+ if PNG_HDR.size.times.all?{ |i| x[i].ord == PNG_HDR[i].ord } # encoding error workaround
63
63
  # raw image data
64
64
  @data = x
65
- else
65
+ elsif File.exist?(x)
66
66
  # filename
67
67
  @data = File.binread(x)
68
+ else
69
+ raise "Don't know what #{x.inspect} is"
68
70
  end
69
71
  end
70
72
 
data/zpng.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "zpng"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrey \"Zed\" Zaikin"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: zpng
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andrey "Zed" Zaikin
@@ -154,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  segments:
156
156
  - 0
157
- hash: 2879730800431969805
157
+ hash: -657082677898355514
158
158
  none: false
159
159
  required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  requirements: