Merge branch 'stable'
* stable: Fixed image-width and image-height helpers to function properly on Windows by forcing file reads in binary mode.
This commit is contained in:
commit
845b790155
@ -38,11 +38,11 @@ private
|
|||||||
|
|
||||||
private
|
private
|
||||||
def get_size_for_png
|
def get_size_for_png
|
||||||
IO.read(@file)[0x10..0x18].unpack('NN')
|
File.open(@file, "rb") {|io| io.read}[0x10..0x18].unpack('NN')
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_size_for_gif
|
def get_size_for_gif
|
||||||
size = IO.read(@file)[6..10].unpack('SS')
|
File.open(@file, "rb") {|io| io.read}[6..10].unpack('SS')
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_size_for_jpg
|
def get_size_for_jpg
|
||||||
|
Loading…
Reference in New Issue
Block a user