Skip to content

Commit

Permalink
check external delegate exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Nov 23, 2023
1 parent c8dafdc commit fc45ce6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions coders/pcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
*read_info;

int
c;
c,
exit_code;

MagickBooleanType
cmyk,
Expand Down Expand Up @@ -334,10 +335,10 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
image->x_resolution,image->y_resolution);
if (image_info->ping != MagickFalse)
(void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0");
page.width=CastDoubleToUnsigned((double) page.width*image->x_resolution/delta.x+
0.5);
page.height=CastDoubleToUnsigned((double) page.height*image->y_resolution/delta.y+
0.5);
page.width=CastDoubleToUnsigned((double) page.width*image->x_resolution/
delta.x+0.5);
page.height=CastDoubleToUnsigned((double) page.height*image->y_resolution/
delta.y+0.5);
(void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
page.width,(double) page.height);
image=DestroyImage(image);
Expand Down Expand Up @@ -365,8 +366,13 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
read_info->filename,input_filename);
options=DestroyString(options);
density=DestroyString(density);
status=ExternalDelegateCommand(MagickFalse,read_info->verbose,command,
(char *) NULL,exception) != 0 ? MagickTrue : MagickFalse;
exit_code=ExternalDelegateCommand(MagickFalse,read_info->verbose,command,
(char *) NULL,exception);
if (exit_code != 0)
{
read_info=DestroyImageInfo(read_info);
ThrowReaderException(DelegateError,"PCLDelegateFailed");
}
image=ReadImage(read_info,exception);
(void) RelinquishUniqueFileResource(read_info->filename);
(void) RelinquishUniqueFileResource(input_filename);
Expand Down

0 comments on commit fc45ce6

Please sign in to comment.