From b5b1f5d086cf33b11f5f963e724c039e906a16de Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 31 Mar 2017 16:42:35 -0400 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31677 --- MagickWand/mogrify.c | 2 +- PerlMagick/Magick.xs | 73 ++++++++++++++++---------------- PerlMagick/quantum/quantum.xs.in | 67 ++++++++++++++--------------- 3 files changed, 72 insertions(+), 70 deletions(-) diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 066d80bde..788c6ef31 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -1588,7 +1588,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) DeleteImageArtifact(*image,"identify:features"); break; } - (void) SetImageArtifact(*image,"vdentify:features",argv[i+1]); + (void) SetImageArtifact(*image,"identify:features",argv[i+1]); (void) SetImageArtifact(*image,"verbose","true"); break; } diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index cc1661358..a70b4c45e 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -1183,7 +1183,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'B': @@ -1225,7 +1225,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'C': @@ -1306,9 +1306,9 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (LocaleCompare(attribute,"comment") == 0) { for ( ; image; image=image->next) - (void) SetImageProperty(image,"Comment",InterpretImageProperties( + (void) SetImageOption(image,"Comment",InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - SvPV(sval,na),exception),exception); + SvPV(sval,na),exception)); break; } if (LocaleCompare(attribute,"compression") == 0) @@ -1330,7 +1330,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'D': @@ -1433,7 +1433,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'E': @@ -1466,7 +1466,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'F': @@ -1536,7 +1536,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'G': @@ -1580,7 +1580,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'I': @@ -1647,7 +1647,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'L': @@ -1656,9 +1656,9 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (LocaleCompare(attribute,"label") == 0) { for ( ; image; image=image->next) - (void) SetImageProperty(image,"label",InterpretImageProperties( + (void) SetImageOption(image,attribute,InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - SvPV(sval,na),exception),exception); + SvPV(sval,na),exception)); break; } if (LocaleCompare(attribute,"loop") == 0) @@ -1666,7 +1666,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'M': @@ -1675,8 +1675,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (LocaleCompare(attribute,"magick") == 0) { if (info) - (void) FormatLocaleString(info->image_info->filename,MagickPathExtent, - "%s:",SvPV(sval,na)); + (void) FormatLocaleString(info->image_info->filename, + MagickPathExtent,"%s:",SvPV(sval,na)); for ( ; image; image=image->next) (void) CopyMagickString(image->magick,SvPV(sval,na),MagickPathExtent); break; @@ -1760,7 +1760,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'O': @@ -1791,7 +1791,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'P': @@ -1878,7 +1878,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'Q': @@ -1895,7 +1895,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'R': @@ -1983,7 +1983,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'S': @@ -2033,7 +2033,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'T': @@ -2112,7 +2112,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'U': @@ -2166,7 +2166,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'V': @@ -2203,7 +2203,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } case 'W': @@ -2237,7 +2237,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } default: @@ -2245,7 +2245,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageArtifact(image,attribute,SvPV(sval,na)); break; } } @@ -4875,7 +4875,7 @@ Get(ref,...) const char *value; - value=GetImageProperty(image,attribute,exception); + value=GetImageOption(image,attribute); if (value != (const char *) NULL) s=newSVpv(value,0); PUSHs(s ? sv_2mortal(s) : &sv_undef); @@ -5259,7 +5259,7 @@ Get(ref,...) if (image == (Image *) NULL) break; - value=GetImageProperty(image,"Label",exception); + value=GetImageOption(image,"label"); if (value != (const char *) NULL) s=newSVpv(value,0); PUSHs(s ? sv_2mortal(s) : &sv_undef); @@ -7850,18 +7850,18 @@ Mogrify(ref,...) { if (attribute_flag[0] == 0) argument_list[0].string_reference=(char *) NULL; - (void) SetImageProperty(image,"comment",InterpretImageProperties( + (void) SetImageOption(image,"comment",InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - argument_list[0].string_reference,exception),exception); + argument_list[0].string_reference,exception)); break; } case 2: /* Label */ { if (attribute_flag[0] == 0) argument_list[0].string_reference=(char *) NULL; - (void) SetImageProperty(image,"label",InterpretImageProperties( + (void) SetImageOption(image,"label",InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - argument_list[0].string_reference,exception),exception); + argument_list[0].string_reference,exception)); break; } case 3: /* AddNoise */ @@ -9193,8 +9193,9 @@ Mogrify(ref,...) geometry_info.rho=argument_list[6].real_reference; SetImageArtifact(image,"modulate:colorspace","HWB"); } - (void) FormatLocaleString(modulate,MagickPathExtent,"%.20g,%.20g,%.20g", - geometry_info.rho,geometry_info.sigma,geometry_info.xi); + (void) FormatLocaleString(modulate,MagickPathExtent, + "%.20g,%.20g,%.20g",geometry_info.rho,geometry_info.sigma, + geometry_info.xi); (void) ModulateImage(image,modulate,exception); break; } @@ -11622,9 +11623,9 @@ Montage(ref,...) if (LocaleCompare(attribute,"label") == 0) { for (next=image; next; next=next->next) - (void) SetImageProperty(next,"label",InterpretImageProperties( + (void) SetImageOption(next,"label",InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,next, - SvPV(ST(i),na),exception),exception); + SvPV(ST(i),na),exception)); break; } ThrowPerlException(exception,OptionError,"UnrecognizedAttribute", diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in index 32955a8be..f2de2267b 100644 --- a/PerlMagick/quantum/quantum.xs.in +++ b/PerlMagick/quantum/quantum.xs.in @@ -1183,7 +1183,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'B': @@ -1225,7 +1225,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'C': @@ -1306,9 +1306,9 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (LocaleCompare(attribute,"comment") == 0) { for ( ; image; image=image->next) - (void) SetImageProperty(image,"Comment",InterpretImageProperties( + (void) SetImageOption(image,attribute,InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - SvPV(sval,na),exception),exception); + SvPV(sval,na),exception)); break; } if (LocaleCompare(attribute,"compression") == 0) @@ -1330,7 +1330,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'D': @@ -1433,7 +1433,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'E': @@ -1466,7 +1466,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'F': @@ -1536,7 +1536,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'G': @@ -1580,7 +1580,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'I': @@ -1647,7 +1647,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'L': @@ -1656,9 +1656,9 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (LocaleCompare(attribute,"label") == 0) { for ( ; image; image=image->next) - (void) SetImageProperty(image,"label",InterpretImageProperties( + (void) SetImageOption(image,attribute,InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - SvPV(sval,na),exception),exception); + SvPV(sval,na),exception)); break; } if (LocaleCompare(attribute,"loop") == 0) @@ -1666,7 +1666,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'M': @@ -1760,7 +1760,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'O': @@ -1791,7 +1791,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'P': @@ -1878,7 +1878,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'Q': @@ -1895,7 +1895,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'R': @@ -1983,7 +1983,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'S': @@ -2033,7 +2033,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'T': @@ -2112,7 +2112,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'U': @@ -2166,7 +2166,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'V': @@ -2203,7 +2203,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } case 'W': @@ -2237,7 +2237,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } default: @@ -2245,7 +2245,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, if (info) SetImageOption(info->image_info,attribute,SvPV(sval,na)); for ( ; image; image=image->next) - SetImageProperty(image,attribute,SvPV(sval,na),exception); + SetImageAttribute(attribute,SvPV(sval,na)); break; } } @@ -4875,7 +4875,7 @@ Get(ref,...) const char *value; - value=GetImageProperty(image,attribute,exception); + value=GetImageOption(image,attribute); if (value != (const char *) NULL) s=newSVpv(value,0); PUSHs(s ? sv_2mortal(s) : &sv_undef); @@ -5259,7 +5259,7 @@ Get(ref,...) if (image == (Image *) NULL) break; - value=GetImageProperty(image,"Label",exception); + value=GetImageOption(image,attribute); if (value != (const char *) NULL) s=newSVpv(value,0); PUSHs(s ? sv_2mortal(s) : &sv_undef); @@ -7841,7 +7841,8 @@ Mogrify(ref,...) { default: { - (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double) ix); + (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double) + ix); ThrowPerlException(exception,OptionError, "UnrecognizedPerlMagickMethod",message); goto PerlException; @@ -7850,18 +7851,18 @@ Mogrify(ref,...) { if (attribute_flag[0] == 0) argument_list[0].string_reference=(char *) NULL; - (void) SetImageProperty(image,"comment",InterpretImageProperties( + (void) SetImageOption(image,"comment",InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - argument_list[0].string_reference,exception),exception); + argument_list[0].string_reference,exception)); break; } case 2: /* Label */ { if (attribute_flag[0] == 0) argument_list[0].string_reference=(char *) NULL; - (void) SetImageProperty(image,"label",InterpretImageProperties( + (void) SetImageOption(image,"label",InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,image, - argument_list[0].string_reference,exception),exception); + argument_list[0].string_reference,exception)); break; } case 3: /* AddNoise */ @@ -11622,9 +11623,9 @@ Montage(ref,...) if (LocaleCompare(attribute,"label") == 0) { for (next=image; next; next=next->next) - (void) SetImageProperty(next,"label",InterpretImageProperties( + (void) SetImageOption(next,attribute,InterpretImageProperties( info ? info->image_info : (ImageInfo *) NULL,next, - SvPV(ST(i),na),exception),exception); + SvPV(ST(i),na),exception)); break; } ThrowPerlException(exception,OptionError,"UnrecognizedAttribute", -- 2.40.0