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

Image files are cached and not updated #99

Open
TimoZikeli opened this issue Jun 12, 2021 · 1 comment
Open

Image files are cached and not updated #99

TimoZikeli opened this issue Jun 12, 2021 · 1 comment
Labels
question Further information is requested

Comments

@TimoZikeli
Copy link

Hi,
today I encountered a strange bug while using the new VipsImage(File) constructor. When an image is loaded once, then the file is changed and then the image is loaded again using the file constructor, it seems that not the data from the file is loaded, but that libvips uses some cache which is not invalidated.

Steps to reproduce:

  1. Read an image using the new VipsImage(File) constructor
  2. Update the image file (I checked afterwards that the file was really changed)
  3. Read the image again using the file constructor
  4. Save the read image somewhere else
    => Then the saved image is equal to the old image.
@dbouron
Copy link
Contributor

dbouron commented Jul 22, 2021

Hello,
I think it's because libvips cache the image either in memory or in disc temporary file:

In VIPS_ACCESS_RANDOM mode, small images are decompressed to memory and then processed from there. Large images are decompressed to temporary random-access files on disc and then processed from there.

http://libvips.github.io/libvips/API/8.6/VipsImage.html#vips-image-new-from-file
http://libvips.github.io/libvips/API/8.6/How-it-opens-files.md.html

@dbouron dbouron added the question Further information is requested label Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants