Priority
Medium
Summary
The plug-in creates uniquely named temporary JPEG files but never deletes them.
The current workflow also exports the selected photo more than once:
- When the dialog opens.
- Every time Generate is clicked.
Repeated use leaves orphaned files in the system temporary directory.
Relevant code
lightroom-llama.lrplugin/LrLlama.lua
local tempPath =
LrFileUtils.chooseUniqueFileName(
LrPathUtils.getStandardFilePath("temp")
.. "/thumbnail.jpg"
)
The dialog stores one thumbnail:
local thumbnailPath = exportThumbnail(selectedPhoto)
The Ollama request generates another:
local encodedImage =
base64EncodeImage(exportThumbnail(photo))
Expected behavior
One generated thumbnail should be reused for the preview and Ollama request, then removed when the dialog context ends.
Implementation notes
- Generate the thumbnail once.
- Pass the path or JPEG data into
sendDataToApi().
- Register cleanup through the Lightroom function context.
- Remove the temporary file when:
- The dialog is saved.
- The dialog is canceled.
- An error occurs.
- Log cleanup failures without interrupting the user workflow.
Acceptance criteria
Priority
Medium
Summary
The plug-in creates uniquely named temporary JPEG files but never deletes them.
The current workflow also exports the selected photo more than once:
Repeated use leaves orphaned files in the system temporary directory.
Relevant code
lightroom-llama.lrplugin/LrLlama.luaThe dialog stores one thumbnail:
The Ollama request generates another:
Expected behavior
One generated thumbnail should be reused for the preview and Ollama request, then removed when the dialog context ends.
Implementation notes
sendDataToApi().Acceptance criteria