detect: add format hints

This commit is contained in:
Koushik Dutta
2023-03-23 19:59:26 -07:00
parent 33ca0242b1
commit 6cd412de88
12 changed files with 30 additions and 19 deletions

View File

@@ -72,6 +72,7 @@ def toPILImage(pilImageWrapper: PILImage, options: scrypted_sdk.ImageOptions = N
async def createPILMediaObject(image: PILImage):
ret = await scrypted_sdk.mediaManager.createMediaObject(image, scrypted_sdk.ScryptedMimeTypes.Image.value, {
'format': None,
'width': image.width,
'height': image.height,
'toBuffer': lambda options = None: image.toBuffer(options),

View File

@@ -75,6 +75,7 @@ def toVipsImage(vipsImageWrapper: VipsImage, options: scrypted_sdk.ImageOptions
async def createVipsMediaObject(image: VipsImage):
ret = await scrypted_sdk.mediaManager.createMediaObject(image, scrypted_sdk.ScryptedMimeTypes.Image.value, {
'format': None,
'width': image.width,
'height': image.height,
'toBuffer': lambda options = None: image.toBuffer(options),