diff options
author | Clement Farabet <clement.farabet@gmail.com> | 2012-06-02 01:09:20 +0400 |
---|---|---|
committer | Clement Farabet <clement.farabet@gmail.com> | 2012-06-02 01:09:20 +0400 |
commit | c3d410ec284c6e57c7a7c432c0fbbbabf945cf7c (patch) | |
tree | f3fedfaa4296e3f16cabbee862b65215b0f0a481 /init.lua | |
parent | 03c52de9069e9c6cc56c91c284b4ab25c1ffe592 (diff) |
Fixed crop function (was not working ok with 2d images)
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -229,10 +229,12 @@ local function crop(...) return src.image.cropNoScale(src,dst,startx,starty) else local depth=1 + local x if src:nDimension() > 2 then - depth=src:size(1) + x = src.new(src:size(1),endy-starty,endx-startx) + else + x = src.new(endy-starty,endx-startx) end - local x = src.new(depth,endy-starty,endx-startx) src.image.cropNoScale(src,x,startx,starty) dst = dst or src.new():resizeAs(x) image.scale(x,dst) |