Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

Hi @wallarug,

When you open an image with access="sequential" you can only scan it once. Imagine if the image is coming over a pipe, for example --- you can get the pixels once, but then they are gone and you can't see them again.

You have:

    v = pyvips.Image.new_from_file(path, access="sequential")
... some time later
    webp_bytes = v.write_to_buffer(".webp")
...
    jpeg_bytes = v.write_to_buffer(".jpg")
...
    v.tiffsave("test_output.tif")

So the webp save will work, but the jpeg and tiff saves will fail, because the image has vanished by then.

The fix would be to either reload the image (this is very fast), or to load once in non-sequential mode.

Either this:

    v = pyvips.Image.n…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wallarug
Comment options

Answer selected by wallarug
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #4732 on November 19, 2025 09:36.