From: cristy Date: Mon, 7 Sep 2009 23:47:59 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~10756 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41083a49f005b0abe7ec428d2d07e6cd32ee35cc;p=imagemagick --- diff --git a/coders/pdf.c b/coders/pdf.c index 67d7e2109..0bdf59a5d 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -160,7 +160,7 @@ static MagickBooleanType InvokePostscriptDelegate( if (gs_func == (GhostscriptVectors *) NULL) { status=SystemCommand(verbose,command,exception); - return(status != 0 ? MagickTrue : MagickFalse); + return(status == 0 ? MagickTrue : MagickFalse); } if (verbose != MagickFalse) { @@ -171,7 +171,7 @@ static MagickBooleanType InvokePostscriptDelegate( if (status < 0) { status=SystemCommand(verbose,command,exception); - return(status != 0 ? MagickTrue : MagickFalse); + return(status == 0 ? MagickTrue : MagickFalse); } argv=StringToArgv(command,&argc); status=(gs_func->init_with_args)(interpreter,argc-1,argv+1); @@ -186,23 +186,23 @@ static MagickBooleanType InvokePostscriptDelegate( for (i=0; i < (long) argc; i++) argv[i]=DestroyString(argv[i]); argv=(char **) RelinquishMagickMemory(argv); - if ((status == 0) || (status == -101)) - return(MagickFalse); - { - char - *message; - - message=GetExceptionMessage(errno); - (void) ThrowMagickException(exception,GetMagickModule(),DelegateError, - "`%s': %s",command,message); - message=DestroyString(message); - } - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Ghostscript returns status %d, exit code %d",status,code); + if ((status != 0) && (status != -101)) + { + char + *message; + + message=GetExceptionMessage(errno); + (void) ThrowMagickException(exception,GetMagickModule(),DelegateError, + "`%s': %s",command,message); + message=DestroyString(message); + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Ghostscript returns status %d, exit code %d",status,code); + return(MagickFalse); + } return(MagickTrue); #else status=SystemCommand(verbose,command,exception); - return(status != 0 ? MagickTrue : MagickFalse); + return(status == 0 ? MagickTrue : MagickFalse); #endif } @@ -235,7 +235,7 @@ static MagickBooleanType IsPDF(const unsigned char *magick,const size_t offset) { if (offset < 5) return(MagickFalse); - if (LocaleNCompare((char *) magick,"%PDF-",5) == 0) + if (LocaleNCompare((const char *) magick,"%PDF-",5) == 0) return(MagickTrue); return(MagickFalse); } @@ -620,7 +620,7 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception) read_info->filename,postscript_filename,input_filename); status=InvokePostscriptDelegate(read_info->verbose,command,exception); pdf_image=(Image *) NULL; - if ((status == MagickFalse) && + if ((status != MagickFalse) && (IsPDFRendered(read_info->filename) != MagickFalse)) pdf_image=ReadImage(read_info,exception); (void) RelinquishUniqueFileResource(postscript_filename); diff --git a/coders/ps.c b/coders/ps.c index c351b93ea..948bcce6d 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -154,7 +154,7 @@ static MagickBooleanType InvokePostscriptDelegate( if (gs_func == (GhostscriptVectors *) NULL) { status=SystemCommand(verbose,command,exception); - return(status != 0 ? MagickTrue : MagickFalse); + return(status == 0 ? MagickTrue : MagickFalse); } if (verbose != MagickFalse) { @@ -165,7 +165,7 @@ static MagickBooleanType InvokePostscriptDelegate( if (status < 0) { status=SystemCommand(verbose,command,exception); - return(status != 0 ? MagickTrue : MagickFalse); + return(status == 0 ? MagickTrue : MagickFalse); } argv=StringToArgv(command,&argc); status=(gs_func->init_with_args)(interpreter,argc-1,argv+1); @@ -180,23 +180,23 @@ static MagickBooleanType InvokePostscriptDelegate( for (i=0; i < (long) argc; i++) argv[i]=DestroyString(argv[i]); argv=(char **) RelinquishMagickMemory(argv); - if ((status == 0) || (status == -101)) - return(MagickFalse); - { - char - *message; - - message=GetExceptionMessage(errno); - (void) ThrowMagickException(exception,GetMagickModule(),DelegateError, - "`%s': %s",command,message); - message=DestroyString(message); - } - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Ghostscript returns status %d, exit code %d",status,code); + if ((status != 0) && (status != -101)) + { + char + *message; + + message=GetExceptionMessage(errno); + (void) ThrowMagickException(exception,GetMagickModule(),DelegateError, + "`%s': %s",command,message); + message=DestroyString(message); + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Ghostscript returns status %d, exit code %d",status,code); + return(MagickFalse); + } return(MagickTrue); #else status=SystemCommand(verbose,command,exception); - return(status != 0 ? MagickTrue : MagickFalse); + return(status == 0 ? MagickTrue : MagickFalse); #endif } @@ -746,14 +746,14 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception) read_info->antialias != MagickFalse ? 4 : 1,density,options, read_info->filename,postscript_filename,input_filename); status=InvokePostscriptDelegate(read_info->verbose,command,exception); - if ((status != MagickFalse) || + if ((status == MagickFalse) || (IsPostscriptRendered(read_info->filename) == MagickFalse)) { (void) ConcatenateMagickString(command," -c showpage",MaxTextExtent); status=InvokePostscriptDelegate(read_info->verbose,command,exception); } postscript_image=(Image *) NULL; - if (status == MagickFalse) + if (status != MagickFalse) postscript_image=ReadImage(read_info,exception); (void) RelinquishUniqueFileResource(postscript_filename); (void) RelinquishUniqueFileResource(read_info->filename);