Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2015-08-17 20:47:17 +0300
committerSam Gross <colesbury@gmail.com>2015-08-17 20:47:17 +0300
commit869978fd4152a7605815f5d2c8c54066fa3fec16 (patch)
tree0a0cecb15cf7d479e05d1993d95c63545dd46cad /test
parent5c2e963f4cca3a6c76dc75d0d7503d77dee57d4f (diff)
Support saving torch.ByteTensor images
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_decompress_jpg.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_decompress_jpg.lua b/test/test_decompress_jpg.lua
index a64a443..5728eaf 100755
--- a/test/test_decompress_jpg.lua
+++ b/test/test_decompress_jpg.lua
@@ -51,9 +51,11 @@ function test.LoadInvalid()
local img_binary = torch.rand(file_size_bytes):mul(255):byte()
-- Now decompress the image from the ByteTensor
- local img_from_tensor = image.decompressJPG(img_binary)
+ local ok, img_from_tensor = pcall(function()
+ return image.decompressJPG(img_binary)
+ end)
- mytester:assert(img_from_tensor == nil,
+ mytester:assert(not ok or img_from_tensor == nil,
'A non-nil was returned on an invalid input! ')
end