]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 13 Sep 2013 22:35:48 +0000 (22:35 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 13 Sep 2013 22:35:48 +0000 (22:35 +0000)
23 files changed:
MagickWand/compare.c
MagickWand/drawing-wand.c
MagickWand/magick-image.c
MagickWand/magick-property.c
MagickWand/mogrify-private.h
MagickWand/mogrify.c
MagickWand/operation.c
MagickWand/pixel-wand.c
MagickWand/wand-view.c
MagickWand/wandcli.c
utilities/animate.c
utilities/compare.1.in
utilities/compare.c
utilities/composite.c
utilities/conjure.c
utilities/convert.c
utilities/display.c
utilities/identify.c
utilities/import.c
utilities/magick.c
utilities/mogrify.c
utilities/montage.c
utilities/stream.c

index 5464810a927fd306ed5ece399020bdad743eb0e4..599c88ae7cf29fb35a01e647ea529b31f84e873d 100644 (file)
@@ -1224,10 +1224,10 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
       (metric == UndefinedErrorMetric))
     {
       if (fabs(distortion-1.0) > CompareEpsilon)
-        return(MagickTrue);
+        (void) SetImageOption(image_info,"compare:dissimilar","true");
     }
   else
     if (fabs(distortion) > CompareEpsilon)
-      return(MagickTrue);
+      (void) SetImageOption(image_info,"compare:dissimilar","true");
   return(status != 0 ? MagickTrue : MagickFalse);
 }
index d78a46d5c544ef149e165f70f090b53b44e5ea92..4e54909e5b87eed6a184ae3cbb726a5809611bfc 100644 (file)
@@ -4302,7 +4302,7 @@ WandExport MagickBooleanType DrawRender(DrawingWand *wand)
     ThrowDrawException(WandError,"ContainsNoImages",wand->name);
   status=DrawImage(wand->image,CurrentContext,wand->exception);
   CurrentContext->primitive=(char *) NULL;
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
index 990ff72461d86975e76b632c069af08eb621f622..845e6b3badb855e9a8a8028cd7f2090f912403c1 100644 (file)
@@ -626,7 +626,7 @@ WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
   (void) CloneString(&draw_info->geometry,geometry);
   status=AnnotateImage(wand->images,draw_info,wand->exception);
   draw_info=DestroyDrawInfo(draw_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -666,7 +666,7 @@ WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   (void) CloneString(&wand->image_info->server_name,server_name);
   status=AnimateImages(wand->image_info,wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -754,7 +754,7 @@ WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=AutoGammaImage(wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -792,7 +792,7 @@ WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=AutoLevelImage(wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -842,7 +842,7 @@ WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
     PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
     PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
   status=BlackThresholdImage(wand->images,thresholds,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1045,7 +1045,7 @@ WandExport MagickBooleanType MagickBrightnessContrastImage(
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=BrightnessContrastImage(wand->images,brightness,contrast,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1281,7 +1281,7 @@ WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ClipImage(wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1329,7 +1329,7 @@ WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ClipImagePath(wand->images,pathname,inside,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1372,7 +1372,7 @@ WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
   if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1476,7 +1476,7 @@ WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ColorDecisionListImage(wand->images,color_correction_collection,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1685,7 +1685,7 @@ WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=SetImageProperty(wand->images,"comment",comment,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1847,7 +1847,7 @@ WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=CompositeImage(wand->images,source_wand->images,compose,clip_to_self,
     x,y,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1919,7 +1919,7 @@ WandExport MagickBooleanType MagickCompositeLayers(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   CompositeLayers(wand->images,compose,source_wand->images,x,y,wand->exception);
   status=MagickTrue;  /* FUTURE: determine status from exceptions */
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1963,7 +1963,7 @@ WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ContrastImage(wand->images,sharpen,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2010,7 +2010,7 @@ WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ContrastStretchImage(wand->images,black_point,white_point,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2156,7 +2156,7 @@ WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=CycleColormapImage(wand->images,displace,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2469,7 +2469,7 @@ WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
   (void) CloneString(&wand->image_info->server_name,server_name);
   status=DisplayImages(wand->image_info,image,wand->exception);
   image=DestroyImage(image);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2509,7 +2509,7 @@ WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   (void) CloneString(&wand->image_info->server_name,server_name);
   status=DisplayImages(wand->image_info,wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2646,7 +2646,7 @@ WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
   draw_info->primitive=primitive;
   status=DrawImage(wand->images,draw_info,wand->exception);
   draw_info=DestroyDrawInfo(draw_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2859,7 +2859,7 @@ WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=EqualizeImage(wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2926,7 +2926,7 @@ WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=EvaluateImage(wand->images,op,value,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2996,7 +2996,7 @@ WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ExportImagePixels(wand->images,x,y,columns,rows,map,
     storage,pixels,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -3170,7 +3170,7 @@ WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
   status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
     wand->exception);
   draw_info=DestroyDrawInfo(draw_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -3382,7 +3382,7 @@ WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=FunctionImage(wand->images,function,number_arguments,arguments,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -3470,7 +3470,7 @@ WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=GammaImage(wand->images,gamma,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -3955,7 +3955,7 @@ WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -4001,7 +4001,7 @@ WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -4044,7 +4044,7 @@ WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=GetImageRange(wand->images,minima,maxima,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -4474,7 +4474,7 @@ WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=GetImageDistortion(wand->images,reference->images,metric,distortion,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -5813,7 +5813,7 @@ WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
   if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=HaldClutImage(wand->images,hald_wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -6066,7 +6066,7 @@ WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -6215,7 +6215,7 @@ WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=SetImageProperty(wand->images,"label",label,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -6274,7 +6274,7 @@ WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=LevelImage(wand->images,black_point,white_point,gamma,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -6321,7 +6321,7 @@ WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=LinearStretchImage(wand->images,black_point,white_point,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -6572,7 +6572,7 @@ WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
   (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
     brightness,saturation,hue);
   status=ModulateImage(wand->images,modulate,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -6883,7 +6883,7 @@ WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=NegateImage(wand->images,gray,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -7033,7 +7033,7 @@ WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=NormalizeImage(wand->images,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -7144,7 +7144,7 @@ WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
   wand->images->fuzz=fuzz;
   status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -7287,7 +7287,7 @@ WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -7537,7 +7537,7 @@ WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=PosterizeImage(wand->images,levels,dither,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -7720,7 +7720,7 @@ WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
   quantize_info->measure_error=measure_error;
   status=QuantizeImage(quantize_info,wand->images,wand->exception);
   quantize_info=DestroyQuantizeInfo(quantize_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -7798,7 +7798,7 @@ WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
   quantize_info->measure_error=measure_error;
   status=QuantizeImages(quantize_info,wand->images,wand->exception);
   quantize_info=DestroyQuantizeInfo(quantize_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -7898,7 +7898,7 @@ WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
   raise_info.x=x;
   raise_info.y=y;
   status=RaiseImage(wand->images,&raise_info,raise,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -8138,7 +8138,7 @@ WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
   status=RemapImage(quantize_info,wand->images,remap_wand->images,
     wand->exception);
   quantize_info=DestroyQuantizeInfo(quantize_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -8585,7 +8585,7 @@ MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
     smooth_threshold,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -9898,7 +9898,7 @@ WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand,
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha),
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -10713,7 +10713,7 @@ WandExport MagickBooleanType MagickSigmoidalContrastImage(
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
     wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -10920,7 +10920,7 @@ WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=SolarizeImage(wand->images,threshold,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -11432,7 +11432,7 @@ WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
     status;
 
   status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
@@ -11448,7 +11448,7 @@ WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=BilevelImage(wand->images,threshold,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -11733,7 +11733,7 @@ WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
   wand->images->fuzz=fuzz;
   status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum(
     QuantumRange*alpha),invert,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -12167,7 +12167,7 @@ WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
   status=WriteImage(write_info,image,wand->exception);
   image=DestroyImage(image);
   write_info=DestroyImageInfo(write_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -12221,7 +12221,7 @@ WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
   status=WriteImage(write_info,image,wand->exception);
   write_info=DestroyImageInfo(write_info);
   image=DestroyImage(image);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -12270,7 +12270,7 @@ WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
   write_info->adjoin=adjoin;
   status=WriteImages(write_info,wand->images,filename,wand->exception);
   write_info=DestroyImageInfo(write_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -12317,5 +12317,5 @@ WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
   status=WriteImages(write_info,wand->images,(const char *) NULL,
     wand->exception);
   write_info=DestroyImageInfo(write_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
index d0ec8c630b51124bb67a4b93d486f3bbc4dc7dd1..6135ac02fe7cec6c91cb7367a4a216ed3f96f88e 100644 (file)
@@ -2251,7 +2251,7 @@ WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
 
   status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
     MagickGravityOptions,(ssize_t) type));
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2346,7 +2346,7 @@ WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
   SetStringInfoDatum(profile_info,(unsigned char *) profile);
   status=SetImageProfile(wand->images,name,profile_info,wand->exception);
   profile_info=DestroyStringInfo(profile_info);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2390,7 +2390,7 @@ WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   status=SetImageProperty(wand->images,property,value,wand->exception);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -2469,7 +2469,7 @@ WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
 
   status=SetImageOption(wand->image_info,"interpolate",
     CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
index ee27fb02fee62c23a65fc9dd629760950d1b3887..459c9ffd59fa14a536adad482d65632a89ec786f 100644 (file)
@@ -35,6 +35,7 @@ extern "C" {
     PopImageStack(); \
   image_stack[k].image=DestroyImageList(image_stack[k].image); \
   image_stack[k].image_info=DestroyImageInfo(image_stack[k].image_info); \
+  image_info=image_stack[MaxImageStackDepth].image_info; \
 }
 #define FinalizeImageSettings(image_info,image,advance) \
 { \
@@ -63,6 +64,7 @@ extern "C" {
 #define MaxImageStackDepth  128
 #define NewImageStack() \
 { \
+  image_stack[MaxImageStackDepth].image_info=image_info; \
   image_stack[0].image_info=CloneImageInfo(image_info); \
   image_stack[0].image=NewImageList(); \
   image_info=image_stack[0].image_info; \
index 45c4303de6bf6b4f0e2c37993fb6ba91c2b036d4..99096c4fe9ad93dd2c2ee66d4b1f05fc7d685655 100644 (file)
@@ -183,7 +183,7 @@ WandExport MagickBooleanType MagickCommandGenesis(ImageInfo *image_info,
             (void) fputs(*metadata,stdout);
             *metadata=DestroyString(*metadata);
           }
-      return(status);
+      return(status == MagickFalse ? 0 : 1);
     }
   number_threads=GetOpenMPMaximumThreads();
   serial=0.0;
@@ -272,13 +272,12 @@ WandExport MagickBooleanType MagickCommandGenesis(ImageInfo *image_info,
         (double) n)))-(1.0/(double) n))/(1.0-1.0/(double) n);
     (void) FormatLocaleFile(stderr,
       "Performance[%.20g]: %.20gi %0.3fips %0.3fe %0.3fu %lu:%02lu.%03lu\n",
-      (double) n,(double) iterations,(double) iterations/parallel,e,
-      user_time,(unsigned long) (parallel/60.0),(unsigned long)
-      floor(fmod(parallel,60.0)),(unsigned long)
-      (1000.0*(parallel-floor(parallel))+0.5));
+      (double) n,(double) iterations,(double) iterations/parallel,e,user_time,
+      (unsigned long) (parallel/60.0),(unsigned long) floor(fmod(parallel,
+      60.0)),(unsigned long) (1000.0*(parallel-floor(parallel))+0.5));
     timer=DestroyTimerInfo(timer);
   }
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
index e9ab8c6c88515c1121ba4d65f90c9e14dd7dd7be..c1377e39bccd8361f45d9ff8a0bf8c6d6f6d156f 100644 (file)
@@ -4313,10 +4313,10 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
 
   /* if new image list generated, replace existing image list */
   if (new_images == (Image *) NULL)
-    return(status);
+    return(status == MagickFalse ? 0 : 1);
   _images=DestroyImageList(_images);
   _images=GetFirstImageInList(new_images);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 
 #undef _image_info
 #undef _images
index ff209a1d4ca7b69ba8241abc9ae252839250913e..29eb699a34c81ed33b3aecdb46349d54ffe844ca 100644 (file)
@@ -1699,7 +1699,7 @@ WandExport MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
   status=QueryColorCompliance(color,AllCompliance,&pixel,wand->exception);
   if (status != MagickFalse)
     wand->pixel=pixel;
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
index 5f71c10a7b8d41cfabfc9d105a5ac198839abee2..55d73867a924583d1097002de3e76811dde99ea4 100644 (file)
@@ -381,7 +381,7 @@ WandExport MagickBooleanType DuplexTransferWandViewIterator(WandView *source,
           status=MagickFalse;
       }
   }
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -588,7 +588,7 @@ WandExport MagickBooleanType GetWandViewIterator(WandView *source,
           status=MagickFalse;
       }
   }
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -998,7 +998,7 @@ WandExport MagickBooleanType SetWandViewIterator(WandView *destination,
           status=MagickFalse;
       }
   }
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1160,7 +1160,7 @@ WandExport MagickBooleanType TransferWandViewIterator(WandView *source,
           status=MagickFalse;
       }
   }
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -1293,5 +1293,5 @@ WandExport MagickBooleanType UpdateWandViewIterator(WandView *source,
           status=MagickFalse;
       }
   }
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
index fa5fc8d6fbc04aaab7043b6ae0ef9f61bb7395cb..60786e9188485cde42796e61eccb188be2843ce5 100644 (file)
@@ -253,7 +253,7 @@ WandExport MagickBooleanType CLICatchException(MagickCLI *cli_wand,
   if ( IfMagickFalse(status) || IfMagickTrue(all_exceptions) )
     CatchException(cli_wand->wand.exception); /* output and clear exceptions */
 
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -299,7 +299,7 @@ WandExport MagickBooleanType CLILogEvent(MagickCLI *cli_wand,
   va_end(operands);
 
 
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 \f
 /*
@@ -349,5 +349,5 @@ WandExport MagickBooleanType CLIThrowException(MagickCLI *cli_wand,
               module,function,line,
               severity,tag,new_format,operands);
   va_end(operands);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
index 8ff70839796508e9fc6d8db5f4b9b863aed6e4be..509b3214726928072e3cf2f0985acf9cfa1274cb 100644 (file)
@@ -86,7 +86,7 @@ static int AnimateMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -111,6 +111,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 5fba1dda8065c92a61da45d4db8365c299c07bad..b967d54fe03f537f41f5088eafb5a04e400893a7 100644 (file)
@@ -68,6 +68,9 @@ Miscellaneous Options:
   \-version             print version information
 
 By default, the image format of `file' is determined by its magic number.  To specify a particular image format, precede the filename with an image format name and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps).  Specify 'file' as '-' for standard input or output.
+
+The compare program returns 2 on error otherwise 0 if the images are similar or
+1 if they are dissimilar.
 .SH SEE ALSO
 ImageMagick(1)
 
index e6adbd54e8e0e3fece1a75667408f2a7473ec350..92134d36b14cfea044871b955a6c50e263c9c61b 100644 (file)
@@ -63,6 +63,9 @@ static int CompareMain(int argc,char **argv)
   char
     *metadata;
 
+  const char
+    *option;
+
   ExceptionInfo
     *exception;
 
@@ -70,6 +73,7 @@ static int CompareMain(int argc,char **argv)
     *image_info;
 
   MagickBooleanType
+    dissimilar,
     status;
 
   MagickCoreGenesis(*argv,MagickTrue);
@@ -80,10 +84,14 @@ static int CompareMain(int argc,char **argv)
     &metadata,exception);
   if (metadata != (char *) NULL)
     metadata=DestroyString(metadata);
+  option=GetImageOption(image_info,"compare:dissimilar");
+  dissimilar=IsStringTrue(option);
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  if (dissimilar != MagickFalse)
+    return(1);
+  return(status == MagickFalse ? 0 : 2);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -108,6 +116,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index f37c17f48bd213f0811ecdb66d573103a747c5ac..d3523571fded16dbd0c071ab3b01915e61385ea7 100644 (file)
@@ -77,7 +77,7 @@ static int CompositeMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -102,6 +102,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 9f6c1c4791e5e007cb61870c18e7d9c1a0297bfb..e9fb0d9944a936b2b5f1e75559ec935f5e92561a 100644 (file)
@@ -96,7 +96,7 @@ static int ConjureMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -121,6 +121,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 513324c5ca91d23821eb14e5499d99994f56166b..946d08e83efe97bace9049865ed89e417ce84c9a 100644 (file)
@@ -83,7 +83,7 @@ static int ConvertMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -108,6 +108,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 95b69eeb36cf6b625dc8d67bdfe3e1b5b3fcc5d8..1afdf5c19953cf23607b628d145d5efec0a522ff 100644 (file)
@@ -91,7 +91,7 @@ static int DisplayMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -116,6 +116,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index b70e1c7965c7f9672ce38f29c867e5289d703aeb..588885cde4d5aa55c3daaecf06dfbe1061ab149f 100644 (file)
@@ -84,7 +84,7 @@ static int IdentifyMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -109,6 +109,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 4dac7337451c14384cbd9d5865e96e404408ac95..6c2fb692076e385fe78622fe815d440b8a9be75b 100644 (file)
@@ -83,7 +83,7 @@ static int ImportMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -108,6 +108,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 9ae354a22dfd8f00356a7f476a306913d1896f5a..151857cf315be0741dde982d92e2a6debcdfefdb 100644 (file)
@@ -76,7 +76,7 @@ static int MagickMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -101,6 +101,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 2f49ac183c7774c0cd39842e6b4bff72cb5196ff..51731d361b51cb7c99f0f76a0290ad2b12b29df4 100644 (file)
@@ -79,7 +79,7 @@ static int MogrifyMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -104,6 +104,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 13ad8e39e2f6172334d0240512f0ccf9bc120740..1dc5ab02bafa63ba3ee1b91e98d7e5c3f42ed450 100644 (file)
@@ -79,7 +79,7 @@ static int MontageMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -104,6 +104,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif
index 324c5cf6962890ada509265ab5203319d9d9c374..c0a0c109d4927b83c3737cc7e4a7f5b3115daaa8 100644 (file)
@@ -79,7 +79,7 @@ static int StreamMain(int argc,char **argv)
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 
 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
@@ -104,6 +104,6 @@ int wmain(int argc,wchar_t *argv[])
   for (i=0; i < argc; i++)
     utf8[i]=DestroyString(utf8[i]);
   utf8=(char **) RelinquishMagickMemory(utf8);
-  return(status);
+  return(status == MagickFalse ? 0 : 1);
 }
 #endif