Ensure multi-page extract remains sequential #3837

This commit is contained in:
Lovell Fuller 2023-11-01 13:54:33 +00:00
parent 159b986cdd
commit 655da113c8
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,9 @@ Requires libvips v8.14.5
[#3823](https://github.com/lovell/sharp/pull/3823) [#3823](https://github.com/lovell/sharp/pull/3823)
[@uhthomas](https://github.com/uhthomas) [@uhthomas](https://github.com/uhthomas)
* Ensure multi-page extract remains sequential.
[#3837](https://github.com/lovell/sharp/issues/3837)
## v0.32 - *flow* ## v0.32 - *flow*
Requires libvips v8.14.5 Requires libvips v8.14.5

View File

@ -370,6 +370,7 @@ namespace sharp {
pages.reserve(nPages); pages.reserve(nPages);
// Split the image into cropped frames // Split the image into cropped frames
image = StaySequential(image, VIPS_ACCESS_SEQUENTIAL);
for (int i = 0; i < nPages; i++) { for (int i = 0; i < nPages; i++) {
pages.push_back( pages.push_back(
image.extract_area(left, *pageHeight * i + top, width, height)); image.extract_area(left, *pageHeight * i + top, width, height));