From 8665a98709e07631806081f6fabd7b7f30a66321 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Mon, 25 Dec 2023 16:48:22 +0100 Subject: [PATCH] Ensure multi-page crop remains sequential --- src/api/processors/crop.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/processors/crop.cpp b/src/api/processors/crop.cpp index b8d0805f..e37f0925 100644 --- a/src/api/processors/crop.cpp +++ b/src/api/processors/crop.cpp @@ -53,8 +53,12 @@ VImage Crop::process(const VImage &image) const { // Update the page height query_->update("page_height", crop_h); - return utils::crop_multi_page(image, crop_x, crop_y, crop_w, crop_h, - n_pages, image_height); + // Copy to memory evaluates the image, so set up the timeout handler, + // if necessary. + utils::setup_timeout_handler(image, config_.process_timeout); + + return utils::crop_multi_page(image.copy_memory(), crop_x, crop_y, + crop_w, crop_h, n_pages, image_height); } return image.extract_area(crop_x, crop_y, crop_w, crop_h);