From: Bastian Dehn Date: Sat, 25 Jan 2025 18:38:36 +0000 (+0100) Subject: change image convert private method first X-Git-Tag: v1.0.29^2~4^2 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=321028fb04c3d3fcadee8555688cc7168065eb74;p=sane-kds-s2000w-net.git change image convert private method first --- diff --git a/src/kds_s2000w_image_converter.c b/src/kds_s2000w_image_converter.c index b0e9278..2a35e46 100644 --- a/src/kds_s2000w_image_converter.c +++ b/src/kds_s2000w_image_converter.c @@ -14,33 +14,6 @@ #include "kds_s2000w_image_converter.h" #include "kds_s2000w_debug.h" -void kds_s2000w_image_converter_metadata_from_jpg(blobdata* image, image_metadata* mdata) -{ - kds_s2000w_debug_printf(ALL, "kds_s2000w_metadata_from_image"); - - ExceptionInfo* exception = AcquireExceptionInfo(); - ImageInfo* image_info = CloneImageInfo(NULL); - sprintf(image_info->filename, "image.pnm"); - - Image* input_image = BlobToImage(image_info, image->data, image->size , exception); - - if (exception->severity != UndefinedException) { - kds_s2000w_debug_printf(ERROR, GetExceptionMessage(exception->error_number)); - CatchException(exception); - } - - mdata->width = input_image->columns; - mdata->height = input_image->rows; - mdata->depth = input_image->depth; - - DestroyImageInfo(image_info); - image_info = NULL; - DestroyImage(input_image); - input_image = NULL; - DestroyExceptionInfo(exception); - exception = NULL; -} - void _kds_s2000w_image_converter_to_pnm_depth(blobdata* in, blobdata* out, int depth, @@ -93,6 +66,33 @@ void _kds_s2000w_image_converter_to_pnm_depth(blobdata* in, exception = NULL; } +void kds_s2000w_image_converter_metadata_from_jpg(blobdata* image, image_metadata* mdata) +{ + kds_s2000w_debug_printf(ALL, "kds_s2000w_metadata_from_image"); + + ExceptionInfo* exception = AcquireExceptionInfo(); + ImageInfo* image_info = CloneImageInfo(NULL); + sprintf(image_info->filename, "image.pnm"); + + Image* input_image = BlobToImage(image_info, image->data, image->size , exception); + + if (exception->severity != UndefinedException) { + kds_s2000w_debug_printf(ERROR, GetExceptionMessage(exception->error_number)); + CatchException(exception); + } + + mdata->width = input_image->columns; + mdata->height = input_image->rows; + mdata->depth = input_image->depth; + + DestroyImageInfo(image_info); + image_info = NULL; + DestroyImage(input_image); + input_image = NULL; + DestroyExceptionInfo(exception); + exception = NULL; +} + void kds_s2000w_image_converter_jpg_to_pnm(blobdata* in, blobdata* out, int depth) { kds_s2000w_debug_printf(ALL, "kds_s2000w_convert_jpg_to_pnm_With_depth");