Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

Fix/full invert crash 2942

Open Abdurrahman-shaikh opened this issue 10 months ago • 1 comments

Description of Changes

Please provide a summary of the changes, including:

  • What was changed

    • Modified the convertToBufferedImageTpFile to use File.createTempFile() instead of writing to "image.png" in the current directory.
    • This change ensures the file is saved in the default temporary directory, preventing permission issues.
  • Why the change was made

    • Previously, the method attempted to save the file in the current working directory, which caused permission errors (java.io.FileNotFoundException: image.png (Permission denied)).
  • Any challenges encountered

Closes #2942


Checklist

General

Documentation

UI Changes (if applicable)

  • [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • [x] I have tested my changes locally. Refer to the Testing Guide for more details.

Abdurrahman-shaikh avatar Feb 16 '25 09:02 Abdurrahman-shaikh

@Frooodle I’ve updated the code to address your feedback. Temporary files are now cleaned up immediately using try-finally blocks. Could you please review the changes?

Abdurrahman-shaikh avatar Feb 16 '25 18:02 Abdurrahman-shaikh