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-02-01 23:41:25 +0300
committerSoumith Chintala <soumith@gmail.com>2016-02-01 23:41:25 +0300
commit4543acebcd340632fd7a3de309ccab0e79f5df22 (patch)
treeedefbaf36bf09907b1fb0ec56a078046f4997932
parentee646fdee4bb0ac86762f0210b00f2ae577acc2d (diff)
parent6a1efd27e9090ec9111ef0428a3b8ec99e6cbb71 (diff)
Merge pull request #138 from colesbury/master
Only scale output in image.crop if dst is provded
-rw-r--r--init.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 6e1ddec..895832f 100644
--- a/init.lua
+++ b/init.lua
@@ -466,8 +466,11 @@ local function crop(...)
x = src.new(endy-starty,endx-startx)
end
src.image.cropNoScale(src,x,startx,starty)
- dst = dst or src.new():resizeAs(x)
- image.scale(dst,x)
+ if dst then
+ image.scale(dst, x)
+ else
+ dst = x
+ end
end
return dst
end