summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-10-27 10:53:11 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-10-27 10:53:11 +0200
commit95538f17e238f65e4afceb5bcec89bb26e44b4fa (patch)
tree255f013ed9c0a222b5d5a7d21daccb0c2b04d923
parent30fa470b2226c442db9d79c765854dab63c6df39 (diff)
downloadufo-filters-95538f17e238f65e4afceb5bcec89bb26e44b4fa.tar.gz
ufo-filters-95538f17e238f65e4afceb5bcec89bb26e44b4fa.tar.bz2
ufo-filters-95538f17e238f65e4afceb5bcec89bb26e44b4fa.tar.xz
ufo-filters-95538f17e238f65e4afceb5bcec89bb26e44b4fa.zip
Fix #133: off-by-one cropping is bad
-rw-r--r--.travis.yml2
-rw-r--r--src/ufo-crop-task.c4
-rw-r--r--tests/meson.build1
-rwxr-xr-xtests/test-file-write-regression.sh2
4 files changed, 5 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index 3b15419..09c88cd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ env:
before_install:
- sudo apt-get install opencl-headers ocl-icd-opencl-dev libjson-glib-dev libzmq3-dev autoconf-archive libgl1-mesa-dev
- - sudo apt-get install libtiff4-dev libhdf5-serial-dev libjpeg-dev libgsl0-dev
+ - sudo apt-get install libtiff4-dev libhdf5-serial-dev libjpeg-dev libgsl0-dev libtiff-tools
- wget http://s3.amazonaws.com/omnia-ci/AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2;
- tar -xjf AMD-APP-SDK*.tar.bz2;
- AMDAPPSDK=${HOME}/AMDAPPSDK;
diff --git a/src/ufo-crop-task.c b/src/ufo-crop-task.c
index 417298c..cb53662 100644
--- a/src/ufo-crop-task.c
+++ b/src/ufo-crop-task.c
@@ -95,9 +95,9 @@ ufo_crop_task_get_requisition (UfoTask *task,
}
else {
x1 = priv->x;
- x2 = priv->width == G_MAXUINT ? in_width - 1: MIN (in_width - 1, x1 + priv->width);
+ x2 = priv->width == G_MAXUINT ? in_width : MIN (in_width, x1 + priv->width);
y1 = priv->y;
- y2 = priv->height == G_MAXUINT ? in_height - 1: MIN (in_height - 1, y1 + priv->height);
+ y2 = priv->height == G_MAXUINT ? in_height : MIN (in_height, y1 + priv->height);
}
requisition->dims[0] = x2 - x1;
diff --git a/tests/meson.build b/tests/meson.build
index 4ccf73f..69a4c7b 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1 +1,2 @@
test('test-file-write-regression', find_program('test-file-write-regression.sh'))
+test('test-133', find_program('test-133.sh'))
diff --git a/tests/test-file-write-regression.sh b/tests/test-file-write-regression.sh
index 2466e1b..22d7dc5 100755
--- a/tests/test-file-write-regression.sh
+++ b/tests/test-file-write-regression.sh
@@ -2,7 +2,7 @@
ufo-launch dummy-data width=512 height=512 number=3 ! write filename=foo-%02i.tif
-files=("*.tif")
+files=("foo-*.tif")
files=$(echo ${files[*]})
# cleanup