Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when combining rotate and sequentialRead #2016

Closed
joesong168 opened this issue Dec 22, 2019 · 2 comments
Closed

Error when combining rotate and sequentialRead #2016

joesong168 opened this issue Dec 22, 2019 · 2 comments

Comments

@joesong168
Copy link

ERROR VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
VipsJpeg: out of order read at line 3840
key:largeExif.jpg

What are the steps to reproduce?

await image
.rotate()
.sequentialRead
.tiff({ pyramid: true, tile: true, tileWidth: 512, tileHeight: 512 })
.toBuffer()

What is the expected behaviour?

normal buffer

Are you able to provide a sample image that helps explain the problem?

https://s3.cn-northwest-1.amazonaws.com.cn/iiif.etu.wiki/largeExif.jpg

@lovell
Copy link
Owner

lovell commented Dec 22, 2019

Hi, this should work if you remove the use of sequentialRead().

Adding the rotate operation to the list of exceptions where we know sequentialRead could fail will also prevent this. You'll notice trim, normalise and some of the crop strategies already follow this pattern:

sharp/src/pipeline.cc

Lines 1417 to 1422 in 755a0ca

// Force random access for certain operations
if (baton->accessMethod == VIPS_ACCESS_SEQUENTIAL && (
baton->trimThreshold > 0.0 || baton->normalise ||
baton->position == 16 || baton->position == 17)) {
baton->accessMethod = VIPS_ACCESS_RANDOM;
}

Happy to accept a PR if you're able.

@lovell lovell added bug and removed triage labels Dec 22, 2019
@lovell lovell added this to the v0.24.0 milestone Jan 13, 2020
@lovell
Copy link
Owner

lovell commented Jan 16, 2020

v0.24.0 is now available with the fix for this. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants