2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % M M AAA GGGG IIIII CCCC K K %
7 % MM MM A A G I C K K %
8 % M M M AAAAA G GGG I C KKK %
9 % M M A A G G I C K K %
10 % M M A A GGGG IIIII CCCC K K %
12 % PPPP RRRR OOO PPPP EEEEE RRRR TTTTT Y Y %
13 % P P R R O O P P E R R T Y Y %
14 % PPPP RRRR O O PPPP EEE RRRR T Y %
15 % P R R O O P E R R T Y %
16 % P R R OOO P EEEEE R R T Y %
19 % Set or Get MagickWand Properties, Options, or Profiles %
26 % Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization %
27 % dedicated to making software imaging solutions freely available. %
29 % You may not use this file except in compliance with the License. You may %
30 % obtain a copy of the License at %
32 % http://www.imagemagick.org/script/license.php %
34 % Unless required by applicable law or agreed to in writing, software %
35 % distributed under the License is distributed on an "AS IS" BASIS, %
36 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37 % See the License for the specific language governing permissions and %
38 % limitations under the License. %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 #include "wand/studio.h"
50 #include "wand/MagickWand.h"
51 #include "wand/magick-wand-private.h"
52 #include "wand/wand.h"
57 #define ThrowWandException(severity,tag,context) \
59 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
60 tag,"`%s'",context); \
61 return(MagickFalse); \
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69 % M a g i c k D e l e t e I m a g e A r t i f a c t %
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 % MagickDeleteImageArtifact() deletes a wand artifact.
77 % The format of the MagickDeleteImageArtifact method is:
79 % MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
80 % const char *artifact)
82 % A description of each parameter follows:
86 % o artifact: the image artifact.
89 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
92 assert(wand != (MagickWand *) NULL);
93 assert(wand->signature == WandSignature);
94 if (wand->debug != MagickFalse)
95 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
96 if (wand->images == (Image *) NULL)
98 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
99 "ContainsNoImages","`%s'",wand->name);
102 return(DeleteImageArtifact(wand->images,artifact));
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110 % M a g i c k D e l e t e I m a g e P r o p e r t y %
114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116 % MagickDeleteImageProperty() deletes a wand property.
118 % The format of the MagickDeleteImageProperty method is:
120 % MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
121 % const char *property)
123 % A description of each parameter follows:
125 % o image: the image.
127 % o property: the image property.
130 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
131 const char *property)
133 assert(wand != (MagickWand *) NULL);
134 assert(wand->signature == WandSignature);
135 if (wand->debug != MagickFalse)
136 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
137 if (wand->images == (Image *) NULL)
139 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
140 "ContainsNoImages","`%s'",wand->name);
143 return(DeleteImageProperty(wand->images,property));
147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
151 % M a g i c k D e l e t e O p t i o n %
155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
157 % MagickDeleteOption() deletes a wand option.
159 % The format of the MagickDeleteOption method is:
161 % MagickBooleanType MagickDeleteOption(MagickWand *wand,
162 % const char *option)
164 % A description of each parameter follows:
166 % o image: the image.
168 % o option: the image option.
171 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
174 assert(wand != (MagickWand *) NULL);
175 assert(wand->signature == WandSignature);
176 if (wand->debug != MagickFalse)
177 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
178 return(DeleteImageOption(wand->image_info,option));
182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186 % M a g i c k G e t A n t i a l i a s %
190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
192 % MagickGetAntialias() returns the antialias property associated with the
195 % The format of the MagickGetAntialias method is:
197 % MagickBooleanType MagickGetAntialias(const MagickWand *wand)
199 % A description of each parameter follows:
201 % o wand: the magick wand.
204 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
206 assert(wand != (const MagickWand *) NULL);
207 assert(wand->signature == WandSignature);
208 if (wand->debug != MagickFalse)
209 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
210 return(wand->image_info->antialias);
214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
218 % M a g i c k G e t B a c k g r o u n d C o l o r %
222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
224 % MagickGetBackgroundColor() returns the wand background color.
226 % The format of the MagickGetBackgroundColor method is:
228 % PixelWand *MagickGetBackgroundColor(MagickWand *wand)
230 % A description of each parameter follows:
232 % o wand: the magick wand.
235 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
240 assert(wand != (MagickWand *) NULL);
241 assert(wand->signature == WandSignature);
242 if (wand->debug != MagickFalse)
243 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
244 background_color=NewPixelWand();
245 PixelSetQuantumColor(background_color,&wand->image_info->background_color);
246 return(background_color);
250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254 % M a g i c k G e t C o l o r s p a c e %
258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 % MagickGetColorspace() gets the wand colorspace type.
262 % The format of the MagickGetColorspace method is:
264 % ColorspaceType MagickGetColorspace(MagickWand *wand)
266 % A description of each parameter follows:
268 % o wand: the magick wand.
271 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
273 assert(wand != (MagickWand *) NULL);
274 assert(wand->signature == WandSignature);
275 if (wand->debug != MagickFalse)
276 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
277 return(wand->image_info->colorspace);
281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
285 % M a g i c k G e t C o m p r e s s i o n %
289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 % MagickGetCompression() gets the wand compression type.
293 % The format of the MagickGetCompression method is:
295 % CompressionType MagickGetCompression(MagickWand *wand)
297 % A description of each parameter follows:
299 % o wand: the magick wand.
302 WandExport CompressionType MagickGetCompression(MagickWand *wand)
304 assert(wand != (MagickWand *) NULL);
305 assert(wand->signature == WandSignature);
306 if (wand->debug != MagickFalse)
307 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
308 return(wand->image_info->compression);
312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316 % M a g i c k G e t C o m p r e s s i o n Q u a l i t y %
320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322 % MagickGetCompressionQuality() gets the wand compression quality.
324 % The format of the MagickGetCompressionQuality method is:
326 % unsigned long MagickGetCompressionQuality(MagickWand *wand)
328 % A description of each parameter follows:
330 % o wand: the magick wand.
333 WandExport unsigned long MagickGetCompressionQuality(MagickWand *wand)
335 assert(wand != (MagickWand *) NULL);
336 assert(wand->signature == WandSignature);
337 if (wand->debug != MagickFalse)
338 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
339 return(wand->image_info->quality);
343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347 % M a g i c k G e t C o p y r i g h t %
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353 % MagickGetCopyright() returns the ImageMagick API copyright as a string
356 % The format of the MagickGetCopyright method is:
358 % const char *MagickGetCopyright(void)
361 WandExport const char *MagickGetCopyright(void)
363 return(GetMagickCopyright());
367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
371 % M a g i c k G e t F i l e n a m e %
375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
377 % MagickGetFilename() returns the filename associated with an image sequence.
379 % The format of the MagickGetFilename method is:
381 % const char *MagickGetFilename(const MagickWand *wand)
383 % A description of each parameter follows:
385 % o wand: the magick wand.
388 WandExport char *MagickGetFilename(const MagickWand *wand)
390 assert(wand != (const MagickWand *) NULL);
391 assert(wand->signature == WandSignature);
392 if (wand->debug != MagickFalse)
393 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
394 return(AcquireString(wand->image_info->filename));
398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
402 % M a g i c k G e t F o n t %
406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
408 % MagickGetFont() returns the font associated with the MagickWand.
410 % The format of the MagickGetFont method is:
412 % char *MagickGetFont(MagickWand *wand)
414 % A description of each parameter follows:
416 % o wand: the magick wand.
419 WandExport char *MagickGetFont(MagickWand *wand)
421 assert(wand != (MagickWand *) NULL);
422 assert(wand->signature == WandSignature);
423 if (wand->debug != MagickFalse)
424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
425 if (wand->image_info->font == (char *) NULL)
426 return((char *) NULL);
427 return(AcquireString(wand->image_info->font));
431 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
435 % M a g i c k G e t F o r m a t %
439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
441 % MagickGetFormat() returns the format of the magick wand.
443 % The format of the MagickGetFormat method is:
445 % const char MagickGetFormat(MagickWand *wand)
447 % A description of each parameter follows:
449 % o wand: the magick wand.
452 WandExport char *MagickGetFormat(MagickWand *wand)
454 assert(wand != (MagickWand *) NULL);
455 assert(wand->signature == WandSignature);
456 if (wand->debug != MagickFalse)
457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
458 return(AcquireString(wand->image_info->magick));
462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
466 % M a g i c k G e t G r a v i t y %
470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
472 % MagickGetGravity() gets the wand gravity.
474 % The format of the MagickGetGravity method is:
476 % GravityType MagickGetGravity(MagickWand *wand)
478 % A description of each parameter follows:
480 % o wand: the magick wand.
483 WandExport GravityType MagickGetGravity(MagickWand *wand)
491 assert(wand != (MagickWand *) NULL);
492 assert(wand->signature == WandSignature);
493 if (wand->debug != MagickFalse)
494 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
495 option=GetImageOption(wand->image_info,"gravity");
496 if (option == (const char *) NULL)
497 return(UndefinedGravity);
498 type=(GravityType) ParseMagickOption(MagickGravityOptions,MagickFalse,option);
503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
507 % M a g i c k G e t H o m e U R L %
511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
513 % MagickGetHomeURL() returns the ImageMagick home URL.
515 % The format of the MagickGetHomeURL method is:
517 % char *MagickGetHomeURL(void)
520 WandExport char *MagickGetHomeURL(void)
522 return(GetMagickHomeURL());
526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
530 % M a g i c k G e t I m a g e A r t i f a c t %
534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
536 % MagickGetImageArtifact() returns a value associated with the specified
537 % artifact. Use MagickRelinquishMemory() to free the value when you are
540 % The format of the MagickGetImageArtifact method is:
542 % char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
544 % A description of each parameter follows:
546 % o wand: the magick wand.
548 % o artifact: the artifact.
551 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
556 assert(wand != (MagickWand *) NULL);
557 assert(wand->signature == WandSignature);
558 if (wand->debug != MagickFalse)
559 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
560 if (wand->images == (Image *) NULL)
562 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
563 "ContainsNoImages","`%s'",wand->name);
564 return((char *) NULL);
566 value=GetImageArtifact(wand->images,artifact);
567 if (value == (const char *) NULL)
568 return((char *) NULL);
569 return(ConstantString(value));
573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
577 % M a g i c k G e t I m a g e P r o p e r t i e s %
581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
583 % MagickGetImageArtifacts() returns all the artifact names that match the
584 % specified pattern associated with a wand. Use MagickGetImageProperty() to
585 % return the value of a particular artifact. Use MagickRelinquishMemory() to
586 % free the value when you are finished with it.
588 % The format of the MagickGetImageArtifacts method is:
590 % char *MagickGetImageArtifacts(MagickWand *wand,
591 % const char *pattern,unsigned long *number_artifacts)
593 % A description of each parameter follows:
595 % o wand: the magick wand.
597 % o pattern: Specifies a pointer to a text string containing a pattern.
599 % o number_artifacts: the number artifacts associated with this wand.
602 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
603 const char *pattern,unsigned long *number_artifacts)
617 assert(wand != (MagickWand *) NULL);
618 assert(wand->signature == WandSignature);
619 if (wand->debug != MagickFalse)
620 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
621 if (wand->images == (Image *) NULL)
623 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
624 "ContainsNoImages","`%s'",wand->name);
625 return((char **) NULL);
627 (void) GetImageProperty(wand->images,"exif:*");
629 artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
630 if (artifacts == (char **) NULL)
631 return((char **) NULL);
632 ResetImagePropertyIterator(wand->images);
633 artifact=GetNextImageProperty(wand->images);
634 for (i=0; artifact != (const char *) NULL; )
636 if ((*artifact != '[') &&
637 (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
639 if ((i+1) >= (long) length)
642 artifacts=(char **) ResizeQuantumMemory(artifacts,length,
644 if (artifacts == (char **) NULL)
646 (void) ThrowMagickException(wand->exception,GetMagickModule(),
647 ResourceLimitError,"MemoryAllocationFailed","`%s'",
649 return((char **) NULL);
652 artifacts[i]=ConstantString(artifact);
655 artifact=GetNextImageProperty(wand->images);
657 artifacts[i]=(char *) NULL;
658 *number_artifacts=(unsigned long) i;
663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
667 % M a g i c k G e t I m a g e P r o f i l e %
671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
673 % MagickGetImageProfile() returns the named image profile.
675 % The format of the MagickGetImageProfile method is:
677 % unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
680 % A description of each parameter follows:
682 % o wand: the magick wand.
684 % o name: Name of profile to return: ICC, IPTC, or generic profile.
686 % o length: the length of the profile.
689 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
690 const char *name,size_t *length)
698 assert(wand != (MagickWand *) NULL);
699 assert(wand->signature == WandSignature);
700 if (wand->debug != MagickFalse)
701 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
702 if (wand->images == (Image *) NULL)
704 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
705 "ContainsNoImages","`%s'",wand->name);
706 return((unsigned char *) NULL);
709 if (wand->images->profiles == (SplayTreeInfo *) NULL)
710 return((unsigned char *) NULL);
711 profile=GetImageProfile(wand->images,name);
712 if (profile == (StringInfo *) NULL)
713 return((unsigned char *) NULL);
714 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
716 if (datum == (unsigned char *) NULL)
717 return((unsigned char *) NULL);
718 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
719 GetStringInfoLength(profile));
720 *length=(unsigned long) GetStringInfoLength(profile);
725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
729 % M a g i c k G e t I m a g e P r o f i l e s %
733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
735 % MagickGetImageProfiles() returns all the profile names that match the
736 % specified pattern associated with a wand. Use MagickGetImageProfile() to
737 % return the value of a particular property. Use MagickRelinquishMemory() to
738 % free the value when you are finished with it.
740 % The format of the MagickGetImageProfiles method is:
742 % char *MagickGetImageProfiles(MagickWand *wand,
743 % unsigned long *number_profiles)
745 % A description of each parameter follows:
747 % o wand: the magick wand.
749 % o pattern: Specifies a pointer to a text string containing a pattern.
751 % o number_profiles: the number profiles associated with this wand.
754 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
755 unsigned long *number_profiles)
769 assert(wand != (MagickWand *) NULL);
770 assert(wand->signature == WandSignature);
771 if (wand->debug != MagickFalse)
772 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
773 if (wand->images == (Image *) NULL)
775 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
776 "ContainsNoImages","`%s'",wand->name);
777 return((char **) NULL);
779 (void) GetImageProfile(wand->images,"exif:*");
781 profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
782 if (profiles == (char **) NULL)
783 return((char **) NULL);
784 ResetImageProfileIterator(wand->images);
785 property=GetNextImageProfile(wand->images);
786 for (i=0; property != (const char *) NULL; )
788 if ((*property != '[') &&
789 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
791 if ((i+1) >= (long) length)
794 profiles=(char **) ResizeQuantumMemory(profiles,length,
796 if (profiles == (char **) NULL)
798 (void) ThrowMagickException(wand->exception,GetMagickModule(),
799 ResourceLimitError,"MemoryAllocationFailed","`%s'",
801 return((char **) NULL);
804 profiles[i]=ConstantString(property);
807 property=GetNextImageProfile(wand->images);
809 profiles[i]=(char *) NULL;
810 *number_profiles=(unsigned long) i;
815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
819 % M a g i c k G e t I m a g e P r o p e r t y %
823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
825 % MagickGetImageProperty() returns a value associated with the specified
826 % property. Use MagickRelinquishMemory() to free the value when you are
829 % The format of the MagickGetImageProperty method is:
831 % char *MagickGetImageProperty(MagickWand *wand,const char *property)
833 % A description of each parameter follows:
835 % o wand: the magick wand.
837 % o property: the property.
840 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
845 assert(wand != (MagickWand *) NULL);
846 assert(wand->signature == WandSignature);
847 if (wand->debug != MagickFalse)
848 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
849 if (wand->images == (Image *) NULL)
851 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
852 "ContainsNoImages","`%s'",wand->name);
853 return((char *) NULL);
855 value=GetImageProperty(wand->images,property);
856 if (value == (const char *) NULL)
857 return((char *) NULL);
858 return(ConstantString(value));
862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
866 % M a g i c k G e t I m a g e P r o p e r t i e s %
870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
872 % MagickGetImageProperties() returns all the property names that match the
873 % specified pattern associated with a wand. Use MagickGetImageProperty() to
874 % return the value of a particular property. Use MagickRelinquishMemory() to
875 % free the value when you are finished with it.
877 % The format of the MagickGetImageProperties method is:
879 % char *MagickGetImageProperties(MagickWand *wand,
880 % const char *pattern,unsigned long *number_properties)
882 % A description of each parameter follows:
884 % o wand: the magick wand.
886 % o pattern: Specifies a pointer to a text string containing a pattern.
888 % o number_properties: the number properties associated with this wand.
891 WandExport char **MagickGetImageProperties(MagickWand *wand,
892 const char *pattern,unsigned long *number_properties)
906 assert(wand != (MagickWand *) NULL);
907 assert(wand->signature == WandSignature);
908 if (wand->debug != MagickFalse)
909 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
910 if (wand->images == (Image *) NULL)
912 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
913 "ContainsNoImages","`%s'",wand->name);
914 return((char **) NULL);
916 (void) GetImageProperty(wand->images,"exif:*");
918 properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
919 if (properties == (char **) NULL)
920 return((char **) NULL);
921 ResetImagePropertyIterator(wand->images);
922 property=GetNextImageProperty(wand->images);
923 for (i=0; property != (const char *) NULL; )
925 if ((*property != '[') &&
926 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
928 if ((i+1) >= (long) length)
931 properties=(char **) ResizeQuantumMemory(properties,length,
932 sizeof(*properties));
933 if (properties == (char **) NULL)
935 (void) ThrowMagickException(wand->exception,GetMagickModule(),
936 ResourceLimitError,"MemoryAllocationFailed","`%s'",
938 return((char **) NULL);
941 properties[i]=ConstantString(property);
944 property=GetNextImageProperty(wand->images);
946 properties[i]=(char *) NULL;
947 *number_properties=(unsigned long) i;
952 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
956 % M a g i c k G e t I n t e r l a c e S c h e m e %
960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
962 % MagickGetInterlaceScheme() gets the wand interlace scheme.
964 % The format of the MagickGetInterlaceScheme method is:
966 % InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
968 % A description of each parameter follows:
970 % o wand: the magick wand.
973 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
975 assert(wand != (MagickWand *) NULL);
976 assert(wand->signature == WandSignature);
977 if (wand->debug != MagickFalse)
978 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
979 return(wand->image_info->interlace);
983 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
987 % M a g i c k G e t I n t e r p o l a t e M e t h o d %
991 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
993 % MagickGetInterpolateMethod() gets the wand compression.
995 % The format of the MagickGetInterpolateMethod method is:
997 % InterpolatePixelMethod MagickGetInterpolateMethod(MagickWand *wand)
999 % A description of each parameter follows:
1001 % o wand: the magick wand.
1004 WandExport InterpolatePixelMethod MagickGetInterpolateMethod(MagickWand *wand)
1009 InterpolatePixelMethod
1012 assert(wand != (MagickWand *) NULL);
1013 assert(wand->signature == WandSignature);
1014 if (wand->debug != MagickFalse)
1015 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1016 option=GetImageOption(wand->image_info,"interpolate");
1017 if (option == (const char *) NULL)
1018 return(UndefinedInterpolatePixel);
1019 method=(InterpolatePixelMethod) ParseMagickOption(MagickInterpolateOptions,
1020 MagickFalse,option);
1025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1029 % M a g i c k G e t O p t i o n %
1033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1035 % MagickGetOption() returns a value associated with a wand and the specified
1036 % key. Use MagickRelinquishMemory() to free the value when you are finished
1039 % The format of the MagickGetOption method is:
1041 % char *MagickGetOption(MagickWand *wand,const char *key)
1043 % A description of each parameter follows:
1045 % o wand: the magick wand.
1050 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
1055 assert(wand != (MagickWand *) NULL);
1056 assert(wand->signature == WandSignature);
1057 if (wand->debug != MagickFalse)
1058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1059 option=GetImageOption(wand->image_info,key);
1060 return(ConstantString(option));
1064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1068 % M a g i c k G e t O p t i o n %
1072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1074 % MagickGetOptions() returns all the option names that match the specified
1075 % pattern associated with a wand. Use MagickGetOption() to return the value
1076 % of a particular option. Use MagickRelinquishMemory() to free the value
1077 % when you are finished with it.
1079 % The format of the MagickGetOptions method is:
1081 % char *MagickGetOptions(MagickWand *wand,unsigned long *number_options)
1083 % A description of each parameter follows:
1085 % o wand: the magick wand.
1087 % o pattern: Specifies a pointer to a text string containing a pattern.
1089 % o number_options: the number options associated with this wand.
1092 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
1093 unsigned long *number_options)
1107 assert(wand != (MagickWand *) NULL);
1108 assert(wand->signature == WandSignature);
1109 if (wand->debug != MagickFalse)
1110 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1111 if (wand->images == (Image *) NULL)
1113 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1114 "ContainsNoImages","`%s'",wand->name);
1115 return((char **) NULL);
1118 options=(char **) AcquireQuantumMemory(length,sizeof(*options));
1119 if (options == (char **) NULL)
1120 return((char **) NULL);
1121 ResetImageOptionIterator(wand->image_info);
1122 option=GetNextImageOption(wand->image_info);
1123 for (i=0; option != (const char *) NULL; )
1125 if ((*option != '[') &&
1126 (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
1128 if ((i+1) >= (long) length)
1131 options=(char **) ResizeQuantumMemory(options,length,
1133 if (options == (char **) NULL)
1135 (void) ThrowMagickException(wand->exception,GetMagickModule(),
1136 ResourceLimitError,"MemoryAllocationFailed","`%s'",
1138 return((char **) NULL);
1141 options[i]=ConstantString(option);
1144 option=GetNextImageOption(wand->image_info);
1146 options[i]=(char *) NULL;
1147 *number_options=(unsigned long) i;
1152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1156 % M a g i c k G e t O r i e n t a t i o n %
1160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1162 % MagickGetOrientation() gets the wand orientation type.
1164 % The format of the MagickGetOrientation method is:
1166 % OrientationType MagickGetOrientation(MagickWand *wand)
1168 % A description of each parameter follows:
1170 % o wand: the magick wand.
1173 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
1175 assert(wand != (MagickWand *) NULL);
1176 assert(wand->signature == WandSignature);
1177 if (wand->debug != MagickFalse)
1178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1179 return(wand->image_info->orientation);
1183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1187 % M a g i c k G e t P a c k a g e N a m e %
1191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1193 % MagickGetPackageName() returns the ImageMagick package name as a string
1196 % The format of the MagickGetPackageName method is:
1198 % const char *MagickGetPackageName(void)
1202 WandExport const char *MagickGetPackageName(void)
1204 return(GetMagickPackageName());
1208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1212 % M a g i c k G e t P a g e %
1216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1218 % MagickGetPage() returns the page geometry associated with the magick wand.
1220 % The format of the MagickGetPage method is:
1222 % MagickBooleanType MagickGetPage(const MagickWand *wand,
1223 % unsigned long *width,unsigned long *height,long *x,long *y)
1225 % A description of each parameter follows:
1227 % o wand: the magick wand.
1229 % o width: the page width.
1231 % o height: page height.
1233 % o x: the page x-offset.
1235 % o y: the page y-offset.
1238 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
1239 unsigned long *width,unsigned long *height,long *x,long *y)
1244 assert(wand != (const MagickWand *) NULL);
1245 assert(wand->signature == WandSignature);
1246 if (wand->debug != MagickFalse)
1247 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1248 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1249 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1250 *width=geometry.width;
1251 *height=geometry.height;
1258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1262 % M a g i c k G e t P o i n t s i z e %
1266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1268 % MagickGetPointsize() returns the font pointsize associated with the
1271 % The format of the MagickGetPointsize method is:
1273 % double MagickGetPointsize(MagickWand *wand)
1275 % A description of each parameter follows:
1277 % o wand: the magick wand.
1280 WandExport double MagickGetPointsize(MagickWand *wand)
1282 assert(wand != (MagickWand *) NULL);
1283 assert(wand->signature == WandSignature);
1284 if (wand->debug != MagickFalse)
1285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1286 return(wand->image_info->pointsize);
1290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 % M a g i c k G e t Q u a n t u m D e p t h %
1298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1300 % MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
1303 % The format of the MagickGetQuantumDepth method is:
1305 % const char *MagickGetQuantumDepth(unsigned long *depth)
1307 % A description of each parameter follows:
1309 % o depth: the quantum depth is returned as a number.
1312 WandExport const char *MagickGetQuantumDepth(unsigned long *depth)
1314 return(GetMagickQuantumDepth(depth));
1318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1322 % M a g i c k G e t Q u a n t u m R a n g e %
1326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1328 % MagickGetQuantumRange() returns the ImageMagick quantum range as a string
1331 % The format of the MagickGetQuantumRange method is:
1333 % const char *MagickGetQuantumRange(unsigned long *range)
1335 % A description of each parameter follows:
1337 % o range: the quantum range is returned as a number.
1340 WandExport const char *MagickGetQuantumRange(unsigned long *range)
1342 return(GetMagickQuantumRange(range));
1346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1350 % M a g i c k G e t R e l e a s e D a t e %
1354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1356 % MagickGetReleaseDate() returns the ImageMagick release date as a string
1359 % The format of the MagickGetReleaseDate method is:
1361 % const char *MagickGetReleaseDate(void)
1364 WandExport const char *MagickGetReleaseDate(void)
1366 return(GetMagickReleaseDate());
1370 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1374 % M a g i c k G e t R e s o u r c e %
1378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1380 % MagickGetResource() returns the specified resource in megabytes.
1382 % The format of the MagickGetResource method is:
1384 % MagickSizeType MagickGetResource(const ResourceType type)
1386 % A description of each parameter follows:
1388 % o wand: the magick wand.
1391 WandExport MagickSizeType MagickGetResource(const ResourceType type)
1393 return(GetMagickResource(type));
1397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1401 % M a g i c k G e t R e s o u r c e L i m i t %
1405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1407 % MagickGetResourceLimit() returns the specified resource limit in megabytes.
1409 % The format of the MagickGetResourceLimit method is:
1411 % MagickSizeType MagickGetResourceLimit(const ResourceType type)
1413 % A description of each parameter follows:
1415 % o wand: the magick wand.
1418 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
1420 return(GetMagickResourceLimit(type));
1424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1428 % M a g i c k G e t S a m p l i n g F a c t o r s %
1432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1434 % MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
1436 % The format of the MagickGetSamplingFactors method is:
1438 % double *MagickGetSamplingFactor(MagickWand *wand,
1439 % unsigned long *number_factors)
1441 % A description of each parameter follows:
1443 % o wand: the magick wand.
1445 % o number_factors: the number of factors in the returned array.
1448 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
1449 unsigned long *number_factors)
1460 assert(wand != (MagickWand *) NULL);
1461 assert(wand->signature == WandSignature);
1462 if (wand->debug != MagickFalse)
1463 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1465 sampling_factors=(double *) NULL;
1466 if (wand->image_info->sampling_factor == (char *) NULL)
1467 return(sampling_factors);
1469 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1471 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1476 sampling_factors=(double *) AcquireQuantumMemory((size_t) i,
1477 sizeof(*sampling_factors));
1478 if (sampling_factors == (double *) NULL)
1479 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
1480 wand->image_info->filename);
1482 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1484 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1487 sampling_factors[i]=atof(p);
1490 *number_factors=(unsigned long) i;
1491 return(sampling_factors);
1495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1499 % M a g i c k G e t S i z e %
1503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1505 % MagickGetSize() returns the size associated with the magick wand.
1507 % The format of the MagickGetSize method is:
1509 % MagickBooleanType MagickGetSize(const MagickWand *wand,
1510 % unsigned long *columns,unsigned long *rows)
1512 % A description of each parameter follows:
1514 % o wand: the magick wand.
1516 % o columns: the width in pixels.
1518 % o height: the height in pixels.
1521 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
1522 unsigned long *columns,unsigned long *rows)
1527 assert(wand != (const MagickWand *) NULL);
1528 assert(wand->signature == WandSignature);
1529 if (wand->debug != MagickFalse)
1530 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1531 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1532 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1533 *columns=geometry.width;
1534 *rows=geometry.height;
1539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1543 % M a g i c k G e t S i z e O f f s e t %
1547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1549 % MagickGetSizeOffset() returns the size offset associated with the magick
1552 % The format of the MagickGetSizeOffset method is:
1554 % MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1557 % A description of each parameter follows:
1559 % o wand: the magick wand.
1561 % o offset: the image offset.
1564 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1570 assert(wand != (const MagickWand *) NULL);
1571 assert(wand->signature == WandSignature);
1572 if (wand->debug != MagickFalse)
1573 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1574 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1575 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1585 % M a g i c k G e t T y p e %
1589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1591 % MagickGetType() returns the wand type.
1593 % The format of the MagickGetType method is:
1595 % ImageType MagickGetType(MagickWand *wand)
1597 % A description of each parameter follows:
1599 % o wand: the magick wand.
1602 WandExport ImageType MagickGetType(MagickWand *wand)
1604 assert(wand != (MagickWand *) NULL);
1605 assert(wand->signature == WandSignature);
1606 if (wand->debug != MagickFalse)
1607 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1608 return(wand->image_info->type);
1612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1616 % M a g i c k G e t V e r s i o n %
1620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1622 % MagickGetVersion() returns the ImageMagick API version as a string constant
1625 % The format of the MagickGetVersion method is:
1627 % const char *MagickGetVersion(unsigned long *version)
1629 % A description of each parameter follows:
1631 % o version: the ImageMagick version is returned as a number.
1634 WandExport const char *MagickGetVersion(unsigned long *version)
1636 return(GetMagickVersion(version));
1640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1644 % M a g i c k P r o f i l e I m a g e %
1648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1650 % MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
1651 % from an image. If the profile is NULL, it is removed from the image
1652 % otherwise added. Use a name of '*' and a profile of NULL to remove all
1653 % profiles from the image.
1655 % The format of the MagickProfileImage method is:
1657 % MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
1658 % const void *profile,const size_t length)
1660 % A description of each parameter follows:
1662 % o wand: the magick wand.
1664 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
1666 % o profile: the profile.
1668 % o length: the length of the profile.
1671 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
1672 const char *name,const void *profile,const size_t length)
1677 assert(wand != (MagickWand *) NULL);
1678 assert(wand->signature == WandSignature);
1679 if (wand->debug != MagickFalse)
1680 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1681 if (wand->images == (Image *) NULL)
1682 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1683 status=ProfileImage(wand->images,name,profile,length,MagickTrue);
1684 if (status == MagickFalse)
1685 InheritException(wand->exception,&wand->images->exception);
1690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1694 % M a g i c k R e m o v e I m a g e P r o f i l e %
1698 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1700 % MagickRemoveImageProfile() removes the named image profile and returns it.
1702 % The format of the MagickRemoveImageProfile method is:
1704 % unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1705 % const char *name,size_t *length)
1707 % A description of each parameter follows:
1709 % o wand: the magick wand.
1711 % o name: Name of profile to return: ICC, IPTC, or generic profile.
1713 % o length: the length of the profile.
1716 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1717 const char *name,size_t *length)
1725 assert(wand != (MagickWand *) NULL);
1726 assert(wand->signature == WandSignature);
1727 if (wand->debug != MagickFalse)
1728 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1729 if (wand->images == (Image *) NULL)
1731 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1732 "ContainsNoImages","`%s'",wand->name);
1733 return((unsigned char *) NULL);
1736 profile=RemoveImageProfile(wand->images,name);
1737 if (profile == (StringInfo *) NULL)
1738 return((unsigned char *) NULL);
1739 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1741 if (datum == (unsigned char *) NULL)
1742 return((unsigned char *) NULL);
1743 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
1744 GetStringInfoLength(profile));
1745 *length=GetStringInfoLength(profile);
1746 profile=DestroyStringInfo(profile);
1751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1755 % M a g i c k S e t A n t i a l i a s %
1759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1761 % MagickSetAntialias() sets the antialias propery of the wand.
1763 % The format of the MagickSetAntialias method is:
1765 % MagickBooleanType MagickSetAntialias(MagickWand *wand,
1766 % const MagickBooleanType antialias)
1768 % A description of each parameter follows:
1770 % o wand: the magick wand.
1772 % o antialias: the antialias property.
1775 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
1776 const MagickBooleanType antialias)
1778 assert(wand != (MagickWand *) NULL);
1779 assert(wand->signature == WandSignature);
1780 if (wand->debug != MagickFalse)
1781 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1782 wand->image_info->antialias=antialias;
1787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1791 % M a g i c k S e t B a c k g r o u n d C o l o r %
1795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1797 % MagickSetBackgroundColor() sets the wand background color.
1799 % The format of the MagickSetBackgroundColor method is:
1801 % MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1802 % const PixelWand *background)
1804 % A description of each parameter follows:
1806 % o wand: the magick wand.
1808 % o background: the background pixel wand.
1811 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1812 const PixelWand *background)
1814 assert(wand != (MagickWand *) NULL);
1815 assert(wand->signature == WandSignature);
1816 if (wand->debug != MagickFalse)
1817 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1818 PixelGetQuantumColor(background,&wand->image_info->background_color);
1823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1827 % M a g i c k S e t C o l o r s p a c e %
1831 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1833 % MagickSetColorspace() sets the wand colorspace type.
1835 % The format of the MagickSetColorspace method is:
1837 % MagickBooleanType MagickSetColorspace(MagickWand *wand,
1838 % const ColorspaceType colorspace)
1840 % A description of each parameter follows:
1842 % o wand: the magick wand.
1844 % o colorspace: the wand colorspace.
1847 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
1848 const ColorspaceType colorspace)
1850 assert(wand != (MagickWand *) NULL);
1851 assert(wand->signature == WandSignature);
1852 if (wand->debug != MagickFalse)
1853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1854 wand->image_info->colorspace=colorspace;
1859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1863 % M a g i c k S e t C o m p r e s s i o n %
1867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1869 % MagickSetCompression() sets the wand compression type.
1871 % The format of the MagickSetCompression method is:
1873 % MagickBooleanType MagickSetCompression(MagickWand *wand,
1874 % const CompressionType compression)
1876 % A description of each parameter follows:
1878 % o wand: the magick wand.
1880 % o compression: the wand compression.
1883 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
1884 const CompressionType compression)
1886 assert(wand != (MagickWand *) NULL);
1887 assert(wand->signature == WandSignature);
1888 if (wand->debug != MagickFalse)
1889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1890 wand->image_info->compression=compression;
1895 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1899 % M a g i c k S e t C o m p r e s s i o n Q u a l i t y %
1903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1905 % MagickSetCompressionQuality() sets the wand compression quality.
1907 % The format of the MagickSetCompressionQuality method is:
1909 % MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1910 % const unsigned long quality)
1912 % A description of each parameter follows:
1914 % o wand: the magick wand.
1916 % o quality: the wand compression quality.
1919 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1920 const unsigned long quality)
1922 assert(wand != (MagickWand *) NULL);
1923 assert(wand->signature == WandSignature);
1924 if (wand->debug != MagickFalse)
1925 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1926 wand->image_info->quality=quality;
1931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1935 % M a g i c k S e t D e p t h %
1939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1941 % MagickSetDepth() sets the wand pixel depth.
1943 % The format of the MagickSetDepth method is:
1945 % MagickBooleanType MagickSetDepth(MagickWand *wand,
1946 % const unsigned long depth)
1948 % A description of each parameter follows:
1950 % o wand: the magick wand.
1952 % o depth: the wand pixel depth.
1955 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
1956 const unsigned long depth)
1958 assert(wand != (MagickWand *) NULL);
1959 assert(wand->signature == WandSignature);
1960 if (wand->debug != MagickFalse)
1961 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1962 wand->image_info->depth=depth;
1967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1971 % M a g i c k S e t E x t r a c t %
1975 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1977 % MagickSetExtract() sets the extract geometry before you read or write an
1978 % image file. Use it for inline cropping (e.g. 200x200+0+0) or resizing
1981 % The format of the MagickSetExtract method is:
1983 % MagickBooleanType MagickSetExtract(MagickWand *wand,
1984 % const char *geometry)
1986 % A description of each parameter follows:
1988 % o wand: the magick wand.
1990 % o geometry: the extract geometry.
1993 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
1994 const char *geometry)
1996 assert(wand != (MagickWand *) NULL);
1997 assert(wand->signature == WandSignature);
1998 if (wand->debug != MagickFalse)
1999 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2000 if (geometry != (const char *) NULL)
2001 (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
2006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2010 % M a g i c k S e t F i l e n a m e %
2014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2016 % MagickSetFilename() sets the filename before you read or write an image file.
2018 % The format of the MagickSetFilename method is:
2020 % MagickBooleanType MagickSetFilename(MagickWand *wand,
2021 % const char *filename)
2023 % A description of each parameter follows:
2025 % o wand: the magick wand.
2027 % o filename: the image filename.
2030 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
2031 const char *filename)
2033 assert(wand != (MagickWand *) NULL);
2034 assert(wand->signature == WandSignature);
2035 if (wand->debug != MagickFalse)
2036 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2037 if (filename != (const char *) NULL)
2038 (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
2043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2047 % M a g i c k S e t F o n t %
2051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2053 % MagickSetFont() sets the font associated with the MagickWand.
2055 % The format of the MagickSetFont method is:
2057 % MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
2059 % A description of each parameter follows:
2061 % o wand: the magick wand.
2066 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
2068 if ((font == (const char *) NULL) || (*font == '\0'))
2069 return(MagickFalse);
2070 assert(wand != (MagickWand *) NULL);
2071 assert(wand->signature == WandSignature);
2072 if (wand->debug != MagickFalse)
2073 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2074 (void) CloneString(&wand->image_info->font,font);
2079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2083 % M a g i c k S e t F o r m a t %
2087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2089 % MagickSetFormat() sets the format of the magick wand.
2091 % The format of the MagickSetFormat method is:
2093 % MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
2095 % A description of each parameter follows:
2097 % o wand: the magick wand.
2099 % o format: the image format.
2102 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
2108 assert(wand != (MagickWand *) NULL);
2109 assert(wand->signature == WandSignature);
2110 if (wand->debug != MagickFalse)
2111 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2112 if ((format == (char *) NULL) || (*format == '\0'))
2114 *wand->image_info->magick='\0';
2117 magick_info=GetMagickInfo(format,wand->exception);
2118 if (magick_info == (const MagickInfo *) NULL)
2119 return(MagickFalse);
2120 ClearMagickException(wand->exception);
2121 (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
2126 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2130 % M a g i c k S e t G r a v i t y %
2134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2136 % MagickSetGravity() sets the gravity type.
2138 % The format of the MagickSetGravity type is:
2140 % MagickBooleanType MagickSetGravity(MagickWand *wand,
2141 % const GravityType type)
2143 % A description of each parameter follows:
2145 % o wand: the magick wand.
2147 % o type: the gravity type.
2150 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
2151 const GravityType type)
2156 assert(wand != (MagickWand *) NULL);
2157 assert(wand->signature == WandSignature);
2158 if (wand->debug != MagickFalse)
2159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2160 status=SetImageOption(wand->image_info,"gravity",MagickOptionToMnemonic(
2161 MagickGravityOptions,(long) type));
2166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2170 % M a g i c k S e t I m a g e A r t i f r c t %
2174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2176 % MagickSetImageArtifact() associates a artifact with an image.
2178 % The format of the MagickSetImageArtifact method is:
2180 % MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2181 % const char *artifact,const char *value)
2183 % A description of each parameter follows:
2185 % o wand: the magick wand.
2187 % o artifact: the artifact.
2189 % o value: the value.
2192 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2193 const char *artifact,const char *value)
2198 assert(wand != (MagickWand *) NULL);
2199 assert(wand->signature == WandSignature);
2200 if (wand->debug != MagickFalse)
2201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2202 if (wand->images == (Image *) NULL)
2203 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2204 status=SetImageArtifact(wand->images,artifact,value);
2205 if (status == MagickFalse)
2206 InheritException(wand->exception,&wand->images->exception);
2211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2215 % M a g i c k S e t P r o f i l e I m a g e %
2219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2221 % MagickSetImageProfile() adds a named profile to the magick wand. If a
2222 % profile with the same name already exists, it is replaced. This method
2223 % differs from the MagickProfileImage() method in that it does not apply any
2224 % CMS color profiles.
2226 % The format of the MagickSetImageProfile method is:
2228 % MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2229 % const char *name,const void *profile,const size_t length)
2231 % A description of each parameter follows:
2233 % o wand: the magick wand.
2235 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
2237 % o profile: the profile.
2239 % o length: the length of the profile.
2242 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2243 const char *name,const void *profile,const size_t length)
2251 assert(wand != (MagickWand *) NULL);
2252 assert(wand->signature == WandSignature);
2253 if (wand->debug != MagickFalse)
2254 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2255 if (wand->images == (Image *) NULL)
2256 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2257 profile_info=AcquireStringInfo((size_t) length);
2258 SetStringInfoDatum(profile_info,(unsigned char *) profile);
2259 status=SetImageProfile(wand->images,name,profile_info);
2260 profile_info=DestroyStringInfo(profile_info);
2261 if (status == MagickFalse)
2262 InheritException(wand->exception,&wand->images->exception);
2267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2271 % M a g i c k S e t I m a g e P r o p e r t y %
2275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2277 % MagickSetImageProperty() associates a property with an image.
2279 % The format of the MagickSetImageProperty method is:
2281 % MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2282 % const char *property,const char *value)
2284 % A description of each parameter follows:
2286 % o wand: the magick wand.
2288 % o property: the property.
2290 % o value: the value.
2293 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2294 const char *property,const char *value)
2299 assert(wand != (MagickWand *) NULL);
2300 assert(wand->signature == WandSignature);
2301 if (wand->debug != MagickFalse)
2302 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2303 if (wand->images == (Image *) NULL)
2304 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2305 status=SetImageProperty(wand->images,property,value);
2306 if (status == MagickFalse)
2307 InheritException(wand->exception,&wand->images->exception);
2312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2316 % M a g i c k S e t I n t e r l a c e S c h e m e %
2320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2322 % MagickSetInterlaceScheme() sets the image compression.
2324 % The format of the MagickSetInterlaceScheme method is:
2326 % MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2327 % const InterlaceType interlace_scheme)
2329 % A description of each parameter follows:
2331 % o wand: the magick wand.
2333 % o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
2334 % PlaneInterlace, PartitionInterlace.
2337 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2338 const InterlaceType interlace_scheme)
2340 assert(wand != (MagickWand *) NULL);
2341 assert(wand->signature == WandSignature);
2342 if (wand->debug != MagickFalse)
2343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2344 wand->image_info->interlace=interlace_scheme;
2349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2353 % M a g i c k S e t I n t e r p o l a t e M e t h o d %
2357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2359 % MagickSetInterpolateMethod() sets the interpolate pixel method.
2361 % The format of the MagickSetInterpolateMethod method is:
2363 % MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2364 % const InterpolateMethodPixel method)
2366 % A description of each parameter follows:
2368 % o wand: the magick wand.
2370 % o method: the interpolate pixel method.
2373 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2374 const InterpolatePixelMethod method)
2379 assert(wand != (MagickWand *) NULL);
2380 assert(wand->signature == WandSignature);
2381 if (wand->debug != MagickFalse)
2382 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2383 status=SetImageOption(wand->image_info,"interpolate",
2384 MagickOptionToMnemonic(MagickInterpolateOptions,(long) method));
2389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2393 % M a g i c k S e t O p t i o n %
2397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2399 % MagickSetOption() associates one or options with the wand (.e.g
2400 % MagickSetOption(wand,"jpeg:perserve","yes")).
2402 % The format of the MagickSetOption method is:
2404 % MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2405 % const char *value)
2407 % A description of each parameter follows:
2409 % o wand: the magick wand.
2413 % o value: The value.
2416 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2419 assert(wand != (MagickWand *) NULL);
2420 assert(wand->signature == WandSignature);
2421 if (wand->debug != MagickFalse)
2422 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2423 return(SetImageOption(wand->image_info,key,value));
2427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2431 % M a g i c k S e t O r i e n t a t i o n %
2435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2437 % MagickSetOrientation() sets the wand orientation type.
2439 % The format of the MagickSetOrientation method is:
2441 % MagickBooleanType MagickSetOrientation(MagickWand *wand,
2442 % const OrientationType orientation)
2444 % A description of each parameter follows:
2446 % o wand: the magick wand.
2448 % o orientation: the wand orientation.
2451 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
2452 const OrientationType orientation)
2454 assert(wand != (MagickWand *) NULL);
2455 assert(wand->signature == WandSignature);
2456 if (wand->debug != MagickFalse)
2457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2458 wand->image_info->orientation=orientation;
2463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2467 % M a g i c k S e t P a g e %
2471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2473 % MagickSetPage() sets the page geometry of the magick wand.
2475 % The format of the MagickSetPage method is:
2477 % MagickBooleanType MagickSetPage(MagickWand *wand,
2478 % const unsigned long width,const unsigned long height,const long x,
2481 % A description of each parameter follows:
2483 % o wand: the magick wand.
2485 % o width: the page width.
2487 % o height: the page height.
2489 % o x: the page x-offset.
2491 % o y: the page y-offset.
2494 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
2495 const unsigned long width,const unsigned long height,const long x,
2499 geometry[MaxTextExtent];
2501 assert(wand != (MagickWand *) NULL);
2502 assert(wand->signature == WandSignature);
2503 if (wand->debug != MagickFalse)
2504 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2505 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
2507 (void) CloneString(&wand->image_info->page,geometry);
2512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2516 % M a g i c k S e t P a s s p h r a s e %
2520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2522 % MagickSetPassphrase() sets the passphrase.
2524 % The format of the MagickSetPassphrase method is:
2526 % MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2527 % const char *passphrase)
2529 % A description of each parameter follows:
2531 % o wand: the magick wand.
2533 % o passphrase: the passphrase.
2536 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2537 const char *passphrase)
2539 assert(wand != (MagickWand *) NULL);
2540 assert(wand->signature == WandSignature);
2541 if (wand->debug != MagickFalse)
2542 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2543 (void) CloneString(&wand->image_info->authenticate,passphrase);
2548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2552 % M a g i c k S e t P o i n t s i z e %
2556 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2558 % MagickSetPointsize() sets the font pointsize associated with the MagickWand.
2560 % The format of the MagickSetPointsize method is:
2562 % MagickBooleanType MagickSetPointsize(MagickWand *wand,
2563 % const double pointsize)
2565 % A description of each parameter follows:
2567 % o wand: the magick wand.
2569 % o pointsize: the size of the font
2572 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
2573 const double pointsize)
2575 assert(wand != (MagickWand *) NULL);
2576 assert(wand->signature == WandSignature);
2577 if (wand->debug != MagickFalse)
2578 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2579 wand->image_info->pointsize=pointsize;
2584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2588 % M a g i c k S e t P r o g r e s s M o n i t o r %
2592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2594 % MagickSetProgressMonitor() sets the wand progress monitor to the specified
2595 % method and returns the previous progress monitor if any. The progress
2596 % monitor method looks like this:
2598 % MagickBooleanType MagickProgressMonitor(const char *text,
2599 % const MagickOffsetType offset,const MagickSizeType span,
2600 % void *client_data)
2602 % If the progress monitor returns MagickFalse, the current operation is
2605 % The format of the MagickSetProgressMonitor method is:
2607 % MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
2608 % const MagickProgressMonitor progress_monitor,void *client_data)
2610 % A description of each parameter follows:
2612 % o wand: the magick wand.
2614 % o progress_monitor: Specifies a pointer to a method to monitor progress
2615 % of an image operation.
2617 % o client_data: Specifies a pointer to any client data.
2620 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
2621 const MagickProgressMonitor progress_monitor,void *client_data)
2623 MagickProgressMonitor
2626 assert(wand != (MagickWand *) NULL);
2627 assert(wand->signature == WandSignature);
2628 if (wand->debug != MagickFalse)
2629 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2630 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2631 progress_monitor,client_data);
2632 return(previous_monitor);
2636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2640 % M a g i c k S e t R e s o u r c e L i m i t %
2644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2646 % MagickSetResourceLimit() sets the limit for a particular resource in
2649 % The format of the MagickSetResourceLimit method is:
2651 % MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2652 % const MagickSizeType limit)
2654 % A description of each parameter follows:
2656 % o type: the type of resource: AreaResource, MemoryResource, MapResource,
2657 % DiskResource, FileResource.
2659 % o The maximum limit for the resource.
2662 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2663 const MagickSizeType limit)
2665 return(SetMagickResourceLimit(type,limit));
2669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2673 % M a g i c k S e t R e s o l u t i o n %
2677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2679 % MagickSetResolution() sets the image resolution.
2681 % The format of the MagickSetResolution method is:
2683 % MagickBooleanType MagickSetResolution(MagickWand *wand,
2684 % const double x_resolution,const doubtl y_resolution)
2686 % A description of each parameter follows:
2688 % o wand: the magick wand.
2690 % o x_resolution: the image x resolution.
2692 % o y_resolution: the image y resolution.
2695 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
2696 const double x_resolution,const double y_resolution)
2699 density[MaxTextExtent];
2701 assert(wand != (MagickWand *) NULL);
2702 assert(wand->signature == WandSignature);
2703 if (wand->debug != MagickFalse)
2704 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2705 (void) FormatMagickString(density,MaxTextExtent,"%gx%g",x_resolution,
2707 (void) CloneString(&wand->image_info->density,density);
2712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2716 % M a g i c k S e t S a m p l i n g F a c t o r s %
2720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2722 % MagickSetSamplingFactors() sets the image sampling factors.
2724 % The format of the MagickSetSamplingFactors method is:
2726 % MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2727 % const unsigned long number_factors,const double *sampling_factors)
2729 % A description of each parameter follows:
2731 % o wand: the magick wand.
2733 % o number_factoes: the number of factors.
2735 % o sampling_factors: An array of doubles representing the sampling factor
2736 % for each color component (in RGB order).
2739 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2740 const unsigned long number_factors,const double *sampling_factors)
2743 sampling_factor[MaxTextExtent];
2748 assert(wand != (MagickWand *) NULL);
2749 assert(wand->signature == WandSignature);
2750 if (wand->debug != MagickFalse)
2751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2752 if (wand->image_info->sampling_factor != (char *) NULL)
2753 wand->image_info->sampling_factor=(char *)
2754 RelinquishMagickMemory(wand->image_info->sampling_factor);
2755 if (number_factors == 0)
2757 for (i=0; i < (long) (number_factors-1); i++)
2759 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g,",
2760 sampling_factors[i]);
2761 (void) ConcatenateString(&wand->image_info->sampling_factor,
2764 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g",
2765 sampling_factors[i]);
2766 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2775 % M a g i c k S e t S i z e %
2779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2781 % MagickSetSize() sets the size of the magick wand. Set it before you
2782 % read a raw image format such as RGB, GRAY, or CMYK.
2784 % The format of the MagickSetSize method is:
2786 % MagickBooleanType MagickSetSize(MagickWand *wand,
2787 % const unsigned long columns,const unsigned long rows)
2789 % A description of each parameter follows:
2791 % o wand: the magick wand.
2793 % o columns: the width in pixels.
2795 % o rows: the rows in pixels.
2798 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
2799 const unsigned long columns,const unsigned long rows)
2802 geometry[MaxTextExtent];
2804 assert(wand != (MagickWand *) NULL);
2805 assert(wand->signature == WandSignature);
2806 if (wand->debug != MagickFalse)
2807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2808 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu",columns,rows);
2809 (void) CloneString(&wand->image_info->size,geometry);
2814 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2818 % M a g i c k S e t S i z e O f f s e t %
2822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2824 % MagickSetSizeOffset() sets the size and offset of the magick wand. Set it
2825 % before you read a raw image format such as RGB, GRAY, or CMYK.
2827 % The format of the MagickSetSizeOffset method is:
2829 % MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2830 % const unsigned long columns,const unsigned long rows,
2831 % const long offset)
2833 % A description of each parameter follows:
2835 % o wand: the magick wand.
2837 % o columns: the image width in pixels.
2839 % o rows: the image rows in pixels.
2841 % o offset: the image offset.
2844 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2845 const unsigned long columns,const unsigned long rows,const long offset)
2848 geometry[MaxTextExtent];
2850 assert(wand != (MagickWand *) NULL);
2851 assert(wand->signature == WandSignature);
2852 if (wand->debug != MagickFalse)
2853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2854 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld",columns,rows,
2856 (void) CloneString(&wand->image_info->size,geometry);
2861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2865 % M a g i c k S e t T y p e %
2869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2871 % MagickSetType() sets the image type attribute.
2873 % The format of the MagickSetType method is:
2875 % MagickBooleanType MagickSetType(MagickWand *wand,
2876 % const ImageType image_type)
2878 % A description of each parameter follows:
2880 % o wand: the magick wand.
2882 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
2883 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
2884 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
2888 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
2889 const ImageType image_type)
2891 assert(wand != (MagickWand *) NULL);
2892 assert(wand->signature == WandSignature);
2893 if (wand->debug != MagickFalse)
2894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2895 wand->image_info->type=image_type;