Where does the error occur? On the call to rename?
I think that what's happening is that your ImageBuf is backed by an ImageCache,
which is holding the file open. That's my current hypothesis anyway.
I have two suggestions, either one might work:
1. Read the file explicitly, and use the
Can you rename the source file first, then open it, then try to write the
result to the original filename?
Then you can del all the OIIO Python objects and delete the original file
after everything is done. (Or add an option to leave the source file as a
backup for the user.)
On Wed, Apr 11,
thx for your answer
you right, i'm on Windows
i'm agree with you, my code is ugly with file path, it's just a crash code
simplification for my post
the problem is with os.remove on original image
if i launch my script in interactive mode, without the last two lines (
os.remove and os.rename)
Python binding launch the cache system ?
So the cache have handle on my file ?
2018-04-11 17:12 GMT+02:00 Stéphane Bertrand :
> thx for your answer
>
> you right, i'm on Windows
> i'm agree with you, my code is ugly with file path, it's just a crash code
> simplification