Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Fix bug introduced with Pillow 11.2, closes #895

davidmezzetti6a10aa88d0f2
diff --git a/src/python/txtai/database/encoder/image.py b/src/python/txtai/database/encoder/image.py
index d707b3ae..b5066a25 100644
--- a/src/python/txtai/database/encoder/image.py
+++ b/src/python/txtai/database/encoder/image.py
@@ -32,6 +32,9 @@ class ImageEncoder(Encoder):
# Create byte stream
output = BytesIO()
+ # Default filename, if necessary
+ obj.filename = obj.filename if hasattr(obj, "filename") else None
+
# Write image to byte stream
obj.save(output, format=obj.format, quality="keep")