Reviewed-on: #11 Co-authored-by: Mathias Scheider <mathias2784@web.de>
This commit was merged in pull request #11.
This commit is contained in:
@@ -4,6 +4,8 @@ from pathlib import Path
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from photools3.models import transform_to_image_dict
|
||||
|
||||
|
||||
class Photo:
|
||||
|
||||
@@ -26,3 +28,6 @@ class Photo:
|
||||
self.image.save(buffer, format="JPEG", quality=85)
|
||||
image_data = base64.b64encode(buffer.getvalue()).decode("utf-8")
|
||||
return image_data
|
||||
|
||||
def to_llm_image_url(self):
|
||||
return transform_to_image_dict(self.resize().to_rgb().get_encoded())
|
||||
|
||||
Reference in New Issue
Block a user