python-codecs: fix erroneous deletion

This commit is contained in:
Koushik Dutta
2023-11-17 20:48:01 -08:00
parent 385d331953
commit eab0746a0a
3 changed files with 9 additions and 3 deletions

View File

@@ -110,3 +110,9 @@ class ImageReader(scrypted_sdk.ScryptedDeviceBase, scrypted_sdk.BufferConverter)
async def convert(self, data: Any, fromMimeType: str, toMimeType: str, options: scrypted_sdk.MediaObjectOptions = None) -> Any:
vips = Image.new_from_buffer(data, '')
return await createImageMediaObject(VipsImage(vips))
def new_from_memory(data, width: int, height: int, bands: int):
return Image.new_from_memory(data, width, height, bands, pyvips.BandFormat.UCHAR)
def new_from_buffer(data, width: int, height: int, bands: int):
return Image.new_from_buffer(data, width, height, bands, pyvips.BandFormat.UCHAR)