#include <stdio.h>
+#include <string.h>
#include <magick/MagickCore.h>
#include "kds_s2000w_image_converter.h"
void kds_s2000w_convert_jpg_to_pnm(const char* filename)
{
- printf("open image file: %s\n", filename);
+ printf("open input_image file: %s\n", filename);
+
+ ExceptionInfo* exception = NULL;
+ Image* input_image = NULL;
+ Image* output_image = NULL;
+ ImageInfo* image_info = NULL;
+
+ exception = AcquireExceptionInfo();
+ image_info = CloneImageInfo(NULL);
+ strcpy(image_info->filename, filename);
+ input_image = ReadImage(image_info, exception);
+
+ if (exception->severity != UndefinedException)
+ CatchException(exception);
+ if (input_image == NULL)
+ exit(1);
+
+ DestroyImageInfo(image_info);
+ DestroyExceptionInfo(exception);
+ exception = AcquireExceptionInfo();
+ image_info = CloneImageInfo(NULL);
+ strcpy(image_info->filename, "output_test.jpg");
+ WriteImages(image_info, input_image, "output.jpg", exception);
+
+ DestroyImageInfo(image_info);
+ DestroyImage(input_image);
+ DestroyExceptionInfo(exception);
}
\ No newline at end of file