Code: Select all
Image *images = NULL, *thumbnails = NULL;
ngx_buf_t* buf = NULL;
size_t len;
u_char *inputblob = NULL, *outputblob = NULL;
ImageInfo *image_info = NULL;
ExceptionInfo *exception = NULL;
exception = AcquireExceptionInfo();
buf = &(image_bean->src_image);
inputblob = buf->pos;
len = buf->last - buf->pos;
image_info = CloneImageInfo((ImageInfo *) NULL);
images = BlobToImage(image_info, inputblob, len, exception);
if (exception->severity != UndefinedException || images == (Image *) NULL)
{
if(images != (Image *) NULL)
{
images = DestroyImageList(images);
}
image_info = DestroyImageInfo(image_info);
exception = DestroyExceptionInfo(exception);
return;
}
thumbnails = SampleImage(images, width, height, exception);
printf("thumbnails->depth=%d ", (int)thumbnails->depth);