Skip to content

Commit

Permalink
Ensure multi-page crop remains sequential
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Dec 25, 2023
1 parent 6bea287 commit 8665a98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/processors/crop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8665a98

Please sign in to comment.