imagery 0.2.0 → 0.2.1

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 (3) hide show
  1. data/imagery.gemspec +1 -1
  2. data/lib/imagery.rb +9 -3
  3. metadata +1 -1
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "imagery"
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
4
4
  s.summary = "POROS + GraphicsMagick."
5
5
  s.description = "Provide a clean and light interface around GraphicsMagick."
6
6
  s.authors = ["Cyril David"]
@@ -2,7 +2,7 @@ require "fileutils"
2
2
  require "tempfile"
3
3
 
4
4
  class Imagery
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
 
7
7
  autoload :S3, "imagery/s3"
8
8
  autoload :Faking, "imagery/faking"
@@ -146,8 +146,14 @@ class Imagery
146
146
 
147
147
  def self.identify(io)
148
148
  file = Tempfile.new("imagery")
149
+
150
+ # Something poorly documented, but vastly important: we need to
151
+ # make sure the file is in binary mode.
152
+ file.binmode
153
+
154
+ # Now we can safely write the file knowing that we're operating in
155
+ # binary mode.
149
156
  file.write(io.read)
150
- file.close
151
157
 
152
158
  `gm identify #{io.path} 2> /dev/null`
153
159
 
@@ -157,7 +163,7 @@ class Imagery
157
163
  io.rewind
158
164
 
159
165
  # Tempfile quickly runs out of names, so best to avoid that.
160
- file.unlink
166
+ file.close!
161
167
  end
162
168
 
163
169
  # Return the cleaned dimension representation minus the
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: imagery
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Cyril David