diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2018-06-20 14:21:30 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2018-06-20 14:21:30 +0200 |
commit | 0afe5e2259a5c942679cfe5d2795210d005fb2e6 (patch) | |
tree | 623c17fad66445b7f36e44fbe357a617cfe09470 | |
parent | f096c4612918da92b4ccb913aa2d8e4380830723 (diff) | |
download | ufo-filters-0afe5e2259a5c942679cfe5d2795210d005fb2e6.tar.gz ufo-filters-0afe5e2259a5c942679cfe5d2795210d005fb2e6.tar.bz2 ufo-filters-0afe5e2259a5c942679cfe5d2795210d005fb2e6.tar.xz ufo-filters-0afe5e2259a5c942679cfe5d2795210d005fb2e6.zip |
Check size and return error if not equal
-rw-r--r-- | src/ufo-flat-field-correct-task.c | 11 | ||||
-rw-r--r-- | src/ufo-interpolate-task.c | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/ufo-flat-field-correct-task.c b/src/ufo-flat-field-correct-task.c index 446c166..38ff731 100644 --- a/src/ufo-flat-field-correct-task.c +++ b/src/ufo-flat-field-correct-task.c @@ -61,8 +61,8 @@ ufo_flat_field_correct_task_new (void) static void ufo_flat_field_correct_task_setup (UfoTask *task, - UfoResources *resources, - GError **error) + UfoResources *resources, + GError **error) { UfoFlatFieldCorrectTaskPrivate *priv; @@ -79,8 +79,13 @@ ufo_flat_field_correct_task_get_requisition (UfoTask *task, UfoRequisition *requisition, GError **error) { - /* TODO: check the size is the same for all three inputs */ ufo_buffer_get_requisition (inputs[0], requisition); + + if (ufo_buffer_cmp_dimensions (inputs[1], requisition) != 0 || + ufo_buffer_cmp_dimensions (inputs[2], requisition) != 0) { + g_set_error_literal (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "flat-field-correct inputs must have the same size"); + } } static guint diff --git a/src/ufo-interpolate-task.c b/src/ufo-interpolate-task.c index 02d9c42..8e07f3e 100644 --- a/src/ufo-interpolate-task.c +++ b/src/ufo-interpolate-task.c @@ -79,8 +79,12 @@ ufo_interpolate_task_get_requisition (UfoTask *task, UfoRequisition *requisition, GError **error) { - /* TODO: check for input compatibility */ ufo_buffer_get_requisition (inputs[0], requisition); + + if (ufo_buffer_cmp_dimensions (inputs[1], requisition) != 0) { + g_set_error_literal (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "interpolate inputs must have the same size"); + } } static guint |