diff options
author | Francisco Massa <fvsmassa@gmail.com> | 2016-05-01 13:30:58 +0300 |
---|---|---|
committer | Francisco Massa <fvsmassa@gmail.com> | 2016-05-01 17:52:53 +0300 |
commit | 346c33a842b88eaa992f65cecb5d34fd6487820b (patch) | |
tree | 47510e2f81a3641321eadf2f4f1f6041c7aca2aa | |
parent | 0680e1fc7b99c0d6aaebc2985aa4df18f082c1b9 (diff) |
Fix in image.scale when one of the dimensions is too small
If height or width is less than one after the resize, the tensor would have wrong dimensions (2 or 1 instead of 3)
-rw-r--r-- | init.lua | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 |