Code: Select all
char *blob = xxxxx //get from http request
size_t length = xxxx//get from http request
ImageInfo *blob_info = CloneImageInfo((ImageInfo *)NULL);
Image *blob_image = BlobToImage(blob_info, blob, length, exception);
Image *resize_image1 = ResizeImage(image, 400, 600, LanczosFilter, 1.0, exception);
Image *resize_image2 = ResizeImage(image, 200, 300, LanczosFilter, 1.0, exception);
Image *resize_image3 = ResizeImage(image, 100, 150, LanczosFilter, 1.0, exception);
Code: Select all
char *blob = xxxxx //get from http request
size_t length = xxxx//get from http request
ImageInfo *blob_info = CloneImageInfo((ImageInfo *)NULL);
Image *blob_image = BlobToImage(blob_info, blob, length, exception);
Image *resize_image1 = ResizeImage(image, 400, 600, LanczosFilter, 1.0, exception);
size_t new_length = 0;
char *new_blob = ImageToBlob(blob_info, resize_image1, new_length, exception);
char size[10] = "200x300";
blob_info->size = malloc(strlen(size)+1);
strcpy(blob_info->size, size);
Image *resize_image2 = BlobToImage(blob_info, new_blob, new_length, exception);
strcpy(blob_info->size, "100x150");
Image *resize_image3 = BlobToImage(blob_info, new_blob, new_length, exception);