-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix/full invert crash 2942 #2957
Fix/full invert crash 2942 #2957
Conversation
ImageIO.write(image, "png", file); | ||
//Ensures temp file is deleted when jvm terminates | ||
file.deleteOnExit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete on exit isn't enough since this server could be running for weeks or months, we must delete it after operation
Can you replace this with a try finally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete on exit isn't enough since this server could be running for weeks or months, we must delete it after operation Can you replace this with a try finally?
Ok, I will replace it with a try-finally block
@Frooodle I’ve updated the code to address your feedback. Temporary files are now cleaned up immediately using |
Description of Changes
Please provide a summary of the changes, including:
What was changed
convertToBufferedImageTpFile
to useFile.createTempFile()
instead of writing to"image.png"
in the current directory.Why the change was made
java.io.FileNotFoundException: image.png (Permission denied)
).Any challenges encountered
Closes #2942
Checklist
General
Documentation
UI Changes (if applicable)
Testing (if applicable)