Hi,
I want to write image into a FILE * fp from ImageInfo structure where FILE *file containd the image stram ;
I tried like
size_t size;
char * output;
FILE *output_file = open_memstream(output, &size);
images->file = output_file;
WriteImage(image_info,images);
but i got compilation error like there is Image does no have any member named as file
could you plz suggest how would I write image to a filehandle
Thanks in advance
Dheeraj
how to write into filehandle
Re: how to write into filehandle
Assign your file descriptor to the ImageInfo structure rather than the Image structure (e.g. image_info->file = file).
Re: how to write into filehandle
I think in WriteImage function it reads from ImageInfo structure and wtites to Image stucture
please suggest if I am wrong
so the problem is i want to write to file discriptor and Image stucture does not have any member of "FILE *" type,
Are there some other APIs where I can write to file descriptor or can I modify this WriteImage function?
please suggest if I am wrong
so the problem is i want to write to file discriptor and Image stucture does not have any member of "FILE *" type,
Are there some other APIs where I can write to file descriptor or can I modify this WriteImage function?
Re: how to write into filehandle
As ImageInfo->file member has been initialised with input filemagick wrote:Assign your file descriptor to the ImageInfo structure rather than the Image structure (e.g. image_info->file = file).
wont it overwrite the same ?
Pls see the code below - and confim if this is what you suggest:
image_info->file = fmemopen(input, input_len, "r");
images=ReadImage(image_info,exception);
FILE *output_file = open_memstream(output, &size);
image_info->file = output_file;
WriteImage(image_info,thumbnails);
In this case what is the sigbnificance of 2nd paramter -thumbnails?