]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change image convert private method first
authorBastian Dehn <hhaalo@arcor.de>
Sat, 25 Jan 2025 18:38:36 +0000 (19:38 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 25 Jan 2025 18:38:36 +0000 (19:38 +0100)
src/kds_s2000w_image_converter.c

index b0e9278aca9fb40b8f6ea7a2022da4ed24a20261..2a35e461d4d482cc1c1d7a4c69c9c8519564212e 100644 (file)
 #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");