support setting the image registry

This commit is contained in:
Cristy 2024-02-03 16:11:12 -05:00
parent 79f137d994
commit 73e6f63264
4 changed files with 36 additions and 16 deletions

View file

@ -17,7 +17,7 @@
% March 2000 %
% %
% %
% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization %
% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %

View file

@ -17,7 +17,7 @@
% March 2000 %
% %
% %
% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization %
% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %

View file

@ -1993,6 +1993,12 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
}
break;
}
if (LocaleNCompare(attribute,"registry:",9) == 0)
{
(void) SetImageRegistry(StringRegistryType,attribute+9,SvPV(sval,na),
exception);
break;
}
if (LocaleCompare(attribute,"render") == 0)
{
sp=SvPOK(sval) ? ParseCommandOption(MagickIntentOptions,MagickFalse,
@ -2158,13 +2164,6 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
(void) SetMagickResourceLimit(TimeResource,limit);
break;
}
if (LocaleCompare(attribute,"title") == 0)
{
for ( ; image; image=image->next)
(void) CopyMagickString(image->magick_filename,SvPV(sval,na),
MaxTextExtent);
break;
}
if (LocaleCompare(attribute,"transparent-color") == 0)
{
(void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
@ -5633,6 +5632,17 @@ Get(ref,...)
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleNCompare(attribute,"registry:",9) == 0)
{
const char
*value;
value=GetImageRegistry(StringRegistryType,attribute+9,exception);
if (value != (const char *) NULL)
s=newSVpv(value,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleCompare(attribute,"rows") == 0)
{
if (image != (Image *) NULL)
@ -5717,13 +5727,6 @@ Get(ref,...)
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleCompare(attribute,"title") == 0)
{
if (image != (Image *) NULL)
s=newSVpv(image->magick_filename,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleCompare(attribute,"total-ink-density") == 0)
{
s=newSViv(MAGICKCORE_QUANTUM_DEPTH);

View file

@ -1990,6 +1990,12 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
}
break;
}
if (LocaleNCompare(attribute,"registry:",9) == 0)
{
(void) SetImageRegistry(StringRegistryType,attribute+9,SvPV(sval,na),
exception);
break;
}
if (LocaleCompare(attribute,"render") == 0)
{
sp=SvPOK(sval) ? ParseCommandOption(MagickIntentOptions,MagickFalse,
@ -5634,6 +5640,17 @@ Get(ref,...)
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleNCompare(attribute,"registry:",9) == 0)
{
const char
*value;
value=GetImageRegistry(StringRegistryType,attribute+9,exception);
if (value != (const char *) NULL)
s=newSVpv(value,0);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleCompare(attribute,"rows") == 0)
{
if (image != (Image *) NULL)