Page 1 of 1

InvokeDelegate() problem

Posted: 2008-01-14T06:34:22-07:00
by togo
when i use PingBlob() to ping a special pic, i find that 2 temp file magick-XX**** left after the call finished,
and then, i gdb follow the function call step by step, finally i found that the InvokeDelegate seem caused this problem.

in the function, the two temp files created by image->filename, image_info->filename, then. call AcquireUniqueSymbolicLink,
now image->filename, and image_info->filename become a linke path with input_filename and output_filename, but at the end of the function, the two temp files input_filename, and output_filename haven't RelinquishUniqueFileResource()

so the two temp files left.

is there any way to avoid?? or there is some thing i made wrong.

Re: InvokeDelegate() problem

Posted: 2008-01-14T07:29:46-07:00
by magick
Can you post a URL to your image so we can reproduce the problem?

Re: InvokeDelegate() problem

Posted: 2008-01-14T19:28:53-07:00
by togo
http://img.blog.163.com/photo/Bk7HoDehE ... 581559.jpg

the pic is an wmf type, and my imagemagick is not support this type in default.

and i just use pinblob() function, then pinblob return NULL...

and the imagemagick version is 6.3.7. thanks

btw: pls use ie to load the pic

Re: InvokeDelegate() problem

Posted: 2008-01-15T07:47:34-07:00
by magick
We cannot reproduce the problem We wrote a 10 line program that calls PingBlob() against your WMF image and no temporary files are left behind. We're using ImageMagick 6.3.7-10. What OS are you using? What version of ImageMagick? Can you post a short program or script that we can use to reproduce the problem?

Re: InvokeDelegate() problem

Posted: 2008-01-15T20:05:14-07:00
by togo

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "magick/api.h"
#include "magick/magick.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

int main(int argc,char **argv)
{
    ExceptionInfo
        exception;

    Image *image = NULL;

    ImageInfo *image_info = NULL;
        
    char buf[3 * 1024 * 1024];

    if (argc != 2) {
        (void) fprintf(stdout,"Usage: %s image thumbnail\n",argv[1]);
        exit(0);
    }   

    FILE *fp = fopen(argv[1], "r");
    if (fp == NULL) {
        (void) fprintf(stdout,"open file[%s] failed\n",argv[1]);
        exit(0);
    }   
    struct stat st; 
    if(stat(argv[1], &st) == 0 && st.st_size > 0) {
        if (fread(buf, st.st_size, 1, fp) != 1) {
            exit(0);
        }   
    }   

    GetExceptionInfo(&exception);
    image_info = CloneImageInfo((ImageInfo *) NULL);
    image = PingBlob(image_info, buf, st.st_size, &exception);
    if (image == NULL) {
        printf("pingblob failed\n");
        exit(0);
    }   
    printf("pingblob success\n");
    return(0);
}
i run in linux 2.4.18, and imagemagick is 6.3.3-10 and 6.3.7-1 as well

like this

[togo imagetest]$ ./imagetest 13500_problem.jpg
sh: wmf2eps: command not found
pingblob failed

and the 13500_problem.jpg
http://webf1.filecrunch.com/hitfile.php ... roblem.jpg

thanks for your help...

Re: InvokeDelegate() problem

Posted: 2008-01-15T22:07:38-07:00
by magick
With your program, we can reproduce the problem. We will have a patch within the next few days in ImageMagick 6.3.8-0 Beta. Thanks.