summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/readers/ufo-tiff-reader.c3
-rw-r--r--src/ufo-read-task.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/readers/ufo-tiff-reader.c b/src/readers/ufo-tiff-reader.c
index caad515..0bac745 100644
--- a/src/readers/ufo-tiff-reader.c
+++ b/src/readers/ufo-tiff-reader.c
@@ -117,7 +117,8 @@ read_data (UfoTiffReaderPrivate *priv,
gchar *src;
gsize plane_size;
- plane_size = step * roi_height / roi_step;
+ /* Allow things like roi_height=1 and roi_step=20 */
+ plane_size = step * ((roi_height - 1) / roi_step + 1);
src = g_new0 (gchar, step * 3);
for (guint i = roi_y; i < roi_y + roi_height; i += roi_step) {
diff --git a/src/ufo-read-task.c b/src/ufo-read-task.c
index 17290ae..1587031 100644
--- a/src/ufo-read-task.c
+++ b/src/ufo-read-task.c
@@ -346,8 +346,9 @@ ufo_read_task_get_requisition (UfoTask *task,
}
}
- /* update height for reduced vertical ROI */
- requisition->dims[1] = priv->roi_height / priv->roi_step;
+ /* update height for reduced vertical ROI and allow things like roi_height=1
+ * and roi_step=20 */
+ requisition->dims[1] = (priv->roi_height - 1) / priv->roi_step + 1;
}
static guint