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
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-05-01 18:01:43 +0300
committerSoumith Chintala <soumith@gmail.com>2016-05-01 18:01:43 +0300
commit193477ef8e92f36b57324690c154fc75996761dc (patch)
tree47510e2f81a3641321eadf2f4f1f6041c7aca2aa
parent0680e1fc7b99c0d6aaebc2985aa4df18f082c1b9 (diff)
parent346c33a842b88eaa992f65cecb5d34fd6487820b (diff)
Merge pull request #163 from fmassa/scale_boundary
Fix in image.scale when one of the dimensions is too small
-rw-r--r--init.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index f2dda2c..80b5f06 100644
--- a/init.lua
+++ b/init.lua
@@ -648,6 +648,8 @@ local function scale(...)
dok.error('could not find valid dest size', 'image.scale')
end
if not dst then
+ height = math.max(height, 1)
+ width = math.max(width, 1)
if src:nDimension() == 3 then
dst = src.new(src:size(1), height, width)
else