mirror of
https://github.com/sdsykes/fastimage.git
synced 2025-10-06 00:02:01 -04:00
Set content length for local files. Fixes #77
This commit is contained in:
parent
c89f556204
commit
ab07d1fe21
@ -350,6 +350,7 @@ class FastImage
|
||||
end
|
||||
|
||||
def fetch_using_file_open
|
||||
@content_length = File.size?(@uri)
|
||||
File.open(@uri) do |s|
|
||||
fetch_using_read(s)
|
||||
end
|
||||
|
@ -152,6 +152,10 @@ class FastImageTest < Test::Unit::TestCase
|
||||
assert_equal info[1], FastImage.size(File.join(FixturePath, fn))
|
||||
end
|
||||
end
|
||||
|
||||
def test_should_report_content_length_correctly_for_local_files
|
||||
assert_equal 3296, FastImage.new(File.join(FixturePath, "test.bmp")).content_length
|
||||
end
|
||||
|
||||
def test_should_report_type_correctly_for_ios
|
||||
GoodFixtures.each do |fn, info|
|
||||
|
Loading…
x
Reference in New Issue
Block a user