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-2011 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"
53 #include "magick/string-private.h"
58 #define ThrowWandException(severity,tag,context) \
60 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
61 tag,"`%s'",context); \
62 return(MagickFalse); \
66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70 % 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 %
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76 % MagickDeleteImageArtifact() deletes a wand artifact.
78 % The format of the MagickDeleteImageArtifact method is:
80 % MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
81 % const char *artifact)
83 % A description of each parameter follows:
87 % o artifact: the image artifact.
90 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
93 assert(wand != (MagickWand *) NULL);
94 assert(wand->signature == WandSignature);
95 if (wand->debug != MagickFalse)
96 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
97 if (wand->images == (Image *) NULL)
99 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
100 "ContainsNoImages","`%s'",wand->name);
103 return(DeleteImageArtifact(wand->images,artifact));
107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 % 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 %
115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117 % MagickDeleteImageProperty() deletes a wand property.
119 % The format of the MagickDeleteImageProperty method is:
121 % MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
122 % const char *property)
124 % A description of each parameter follows:
126 % o image: the image.
128 % o property: the image property.
131 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
132 const char *property)
134 assert(wand != (MagickWand *) NULL);
135 assert(wand->signature == WandSignature);
136 if (wand->debug != MagickFalse)
137 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
138 if (wand->images == (Image *) NULL)
140 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
141 "ContainsNoImages","`%s'",wand->name);
144 return(DeleteImageProperty(wand->images,property));
148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
152 % M a g i c k D e l e t e O p t i o n %
156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 % MagickDeleteOption() deletes a wand option.
160 % The format of the MagickDeleteOption method is:
162 % MagickBooleanType MagickDeleteOption(MagickWand *wand,
163 % const char *option)
165 % A description of each parameter follows:
167 % o image: the image.
169 % o option: the image option.
172 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
175 assert(wand != (MagickWand *) NULL);
176 assert(wand->signature == WandSignature);
177 if (wand->debug != MagickFalse)
178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
179 return(DeleteImageOption(wand->image_info,option));
183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
187 % M a g i c k G e t A n t i a l i a s %
191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193 % MagickGetAntialias() returns the antialias property associated with the
196 % The format of the MagickGetAntialias method is:
198 % MagickBooleanType MagickGetAntialias(const MagickWand *wand)
200 % A description of each parameter follows:
202 % o wand: the magick wand.
205 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
207 assert(wand != (const MagickWand *) NULL);
208 assert(wand->signature == WandSignature);
209 if (wand->debug != MagickFalse)
210 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
211 return(wand->image_info->antialias);
215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
219 % M a g i c k G e t B a c k g r o u n d C o l o r %
223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225 % MagickGetBackgroundColor() returns the wand background color.
227 % The format of the MagickGetBackgroundColor method is:
229 % PixelWand *MagickGetBackgroundColor(MagickWand *wand)
231 % A description of each parameter follows:
233 % o wand: the magick wand.
236 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
241 assert(wand != (MagickWand *) NULL);
242 assert(wand->signature == WandSignature);
243 if (wand->debug != MagickFalse)
244 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
245 background_color=NewPixelWand();
246 PixelSetQuantumColor(background_color,&wand->image_info->background_color);
247 return(background_color);
251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255 % M a g i c k G e t C o l o r s p a c e %
259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261 % MagickGetColorspace() gets the wand colorspace type.
263 % The format of the MagickGetColorspace method is:
265 % ColorspaceType MagickGetColorspace(MagickWand *wand)
267 % A description of each parameter follows:
269 % o wand: the magick wand.
272 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
274 assert(wand != (MagickWand *) NULL);
275 assert(wand->signature == WandSignature);
276 if (wand->debug != MagickFalse)
277 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
278 return(wand->image_info->colorspace);
282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
286 % M a g i c k G e t C o m p r e s s i o n %
290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
292 % MagickGetCompression() gets the wand compression type.
294 % The format of the MagickGetCompression method is:
296 % CompressionType MagickGetCompression(MagickWand *wand)
298 % A description of each parameter follows:
300 % o wand: the magick wand.
303 WandExport CompressionType MagickGetCompression(MagickWand *wand)
305 assert(wand != (MagickWand *) NULL);
306 assert(wand->signature == WandSignature);
307 if (wand->debug != MagickFalse)
308 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
309 return(wand->image_info->compression);
313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317 % 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 %
321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323 % MagickGetCompressionQuality() gets the wand compression quality.
325 % The format of the MagickGetCompressionQuality method is:
327 % size_t MagickGetCompressionQuality(MagickWand *wand)
329 % A description of each parameter follows:
331 % o wand: the magick wand.
334 WandExport size_t MagickGetCompressionQuality(MagickWand *wand)
336 assert(wand != (MagickWand *) NULL);
337 assert(wand->signature == WandSignature);
338 if (wand->debug != MagickFalse)
339 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
340 return(wand->image_info->quality);
344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
348 % M a g i c k G e t C o p y r i g h t %
352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354 % MagickGetCopyright() returns the ImageMagick API copyright as a string
357 % The format of the MagickGetCopyright method is:
359 % const char *MagickGetCopyright(void)
362 WandExport const char *MagickGetCopyright(void)
364 return(GetMagickCopyright());
368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
372 % M a g i c k G e t F i l e n a m e %
376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
378 % MagickGetFilename() returns the filename associated with an image sequence.
380 % The format of the MagickGetFilename method is:
382 % const char *MagickGetFilename(const MagickWand *wand)
384 % A description of each parameter follows:
386 % o wand: the magick wand.
389 WandExport char *MagickGetFilename(const MagickWand *wand)
391 assert(wand != (const MagickWand *) NULL);
392 assert(wand->signature == WandSignature);
393 if (wand->debug != MagickFalse)
394 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
395 return(AcquireString(wand->image_info->filename));
399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403 % M a g i c k G e t F o n t %
407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
409 % MagickGetFont() returns the font associated with the MagickWand.
411 % The format of the MagickGetFont method is:
413 % char *MagickGetFont(MagickWand *wand)
415 % A description of each parameter follows:
417 % o wand: the magick wand.
420 WandExport char *MagickGetFont(MagickWand *wand)
422 assert(wand != (MagickWand *) NULL);
423 assert(wand->signature == WandSignature);
424 if (wand->debug != MagickFalse)
425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
426 if (wand->image_info->font == (char *) NULL)
427 return((char *) NULL);
428 return(AcquireString(wand->image_info->font));
432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
436 % M a g i c k G e t F o r m a t %
440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
442 % MagickGetFormat() returns the format of the magick wand.
444 % The format of the MagickGetFormat method is:
446 % const char MagickGetFormat(MagickWand *wand)
448 % A description of each parameter follows:
450 % o wand: the magick wand.
453 WandExport char *MagickGetFormat(MagickWand *wand)
455 assert(wand != (MagickWand *) NULL);
456 assert(wand->signature == WandSignature);
457 if (wand->debug != MagickFalse)
458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
459 return(AcquireString(wand->image_info->magick));
463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
467 % M a g i c k G e t G r a v i t y %
471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
473 % MagickGetGravity() gets the wand gravity.
475 % The format of the MagickGetGravity method is:
477 % GravityType MagickGetGravity(MagickWand *wand)
479 % A description of each parameter follows:
481 % o wand: the magick wand.
484 WandExport GravityType MagickGetGravity(MagickWand *wand)
492 assert(wand != (MagickWand *) NULL);
493 assert(wand->signature == WandSignature);
494 if (wand->debug != MagickFalse)
495 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
496 option=GetImageOption(wand->image_info,"gravity");
497 if (option == (const char *) NULL)
498 return(UndefinedGravity);
499 type=(GravityType) ParseMagickOption(MagickGravityOptions,MagickFalse,option);
504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
508 % M a g i c k G e t H o m e U R L %
512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
514 % MagickGetHomeURL() returns the ImageMagick home URL.
516 % The format of the MagickGetHomeURL method is:
518 % char *MagickGetHomeURL(void)
521 WandExport char *MagickGetHomeURL(void)
523 return(GetMagickHomeURL());
527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
531 % M a g i c k G e t I m a g e A r t i f a c t %
535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
537 % MagickGetImageArtifact() returns a value associated with the specified
538 % artifact. Use MagickRelinquishMemory() to free the value when you are
541 % The format of the MagickGetImageArtifact method is:
543 % char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
545 % A description of each parameter follows:
547 % o wand: the magick wand.
549 % o artifact: the artifact.
552 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
557 assert(wand != (MagickWand *) NULL);
558 assert(wand->signature == WandSignature);
559 if (wand->debug != MagickFalse)
560 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
561 if (wand->images == (Image *) NULL)
563 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
564 "ContainsNoImages","`%s'",wand->name);
565 return((char *) NULL);
567 value=GetImageArtifact(wand->images,artifact);
568 if (value == (const char *) NULL)
569 return((char *) NULL);
570 return(ConstantString(value));
574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
578 % M a g i c k G e t I m a g e P r o p e r t i e s %
582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
584 % MagickGetImageArtifacts() returns all the artifact names that match the
585 % specified pattern associated with a wand. Use MagickGetImageProperty() to
586 % return the value of a particular artifact. Use MagickRelinquishMemory() to
587 % free the value when you are finished with it.
589 % The format of the MagickGetImageArtifacts method is:
591 % char *MagickGetImageArtifacts(MagickWand *wand,
592 % const char *pattern,size_t *number_artifacts)
594 % A description of each parameter follows:
596 % o wand: the magick wand.
598 % o pattern: Specifies a pointer to a text string containing a pattern.
600 % o number_artifacts: the number artifacts associated with this wand.
603 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
604 const char *pattern,size_t *number_artifacts)
618 assert(wand != (MagickWand *) NULL);
619 assert(wand->signature == WandSignature);
620 if (wand->debug != MagickFalse)
621 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
622 if (wand->images == (Image *) NULL)
624 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
625 "ContainsNoImages","`%s'",wand->name);
626 return((char **) NULL);
628 (void) GetImageProperty(wand->images,"exif:*");
630 artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
631 if (artifacts == (char **) NULL)
632 return((char **) NULL);
633 ResetImagePropertyIterator(wand->images);
634 artifact=GetNextImageProperty(wand->images);
635 for (i=0; artifact != (const char *) NULL; )
637 if ((*artifact != '[') &&
638 (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
640 if ((i+1) >= (ssize_t) length)
643 artifacts=(char **) ResizeQuantumMemory(artifacts,length,
645 if (artifacts == (char **) NULL)
647 (void) ThrowMagickException(wand->exception,GetMagickModule(),
648 ResourceLimitError,"MemoryAllocationFailed","`%s'",
650 return((char **) NULL);
653 artifacts[i]=ConstantString(artifact);
656 artifact=GetNextImageProperty(wand->images);
658 artifacts[i]=(char *) NULL;
659 *number_artifacts=(size_t) i;
664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
668 % M a g i c k G e t I m a g e P r o f i l e %
672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
674 % MagickGetImageProfile() returns the named image profile.
676 % The format of the MagickGetImageProfile method is:
678 % unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
681 % A description of each parameter follows:
683 % o wand: the magick wand.
685 % o name: Name of profile to return: ICC, IPTC, or generic profile.
687 % o length: the length of the profile.
690 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
691 const char *name,size_t *length)
699 assert(wand != (MagickWand *) NULL);
700 assert(wand->signature == WandSignature);
701 if (wand->debug != MagickFalse)
702 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
703 if (wand->images == (Image *) NULL)
705 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
706 "ContainsNoImages","`%s'",wand->name);
707 return((unsigned char *) NULL);
710 if (wand->images->profiles == (SplayTreeInfo *) NULL)
711 return((unsigned char *) NULL);
712 profile=GetImageProfile(wand->images,name);
713 if (profile == (StringInfo *) NULL)
714 return((unsigned char *) NULL);
715 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
717 if (datum == (unsigned char *) NULL)
718 return((unsigned char *) NULL);
719 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
720 GetStringInfoLength(profile));
721 *length=(size_t) GetStringInfoLength(profile);
726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
730 % M a g i c k G e t I m a g e P r o f i l e s %
734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
736 % MagickGetImageProfiles() returns all the profile names that match the
737 % specified pattern associated with a wand. Use MagickGetImageProfile() to
738 % return the value of a particular property. Use MagickRelinquishMemory() to
739 % free the value when you are finished with it.
741 % The format of the MagickGetImageProfiles method is:
743 % char *MagickGetImageProfiles(MagickWand *wand,
744 % size_t *number_profiles)
746 % A description of each parameter follows:
748 % o wand: the magick wand.
750 % o pattern: Specifies a pointer to a text string containing a pattern.
752 % o number_profiles: the number profiles associated with this wand.
755 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
756 size_t *number_profiles)
770 assert(wand != (MagickWand *) NULL);
771 assert(wand->signature == WandSignature);
772 if (wand->debug != MagickFalse)
773 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
774 if (wand->images == (Image *) NULL)
776 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
777 "ContainsNoImages","`%s'",wand->name);
778 return((char **) NULL);
780 (void) GetImageProfile(wand->images,"exif:*");
782 profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
783 if (profiles == (char **) NULL)
784 return((char **) NULL);
785 ResetImageProfileIterator(wand->images);
786 property=GetNextImageProfile(wand->images);
787 for (i=0; property != (const char *) NULL; )
789 if ((*property != '[') &&
790 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
792 if ((i+1) >= (ssize_t) length)
795 profiles=(char **) ResizeQuantumMemory(profiles,length,
797 if (profiles == (char **) NULL)
799 (void) ThrowMagickException(wand->exception,GetMagickModule(),
800 ResourceLimitError,"MemoryAllocationFailed","`%s'",
802 return((char **) NULL);
805 profiles[i]=ConstantString(property);
808 property=GetNextImageProfile(wand->images);
810 profiles[i]=(char *) NULL;
811 *number_profiles=(size_t) i;
816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
820 % M a g i c k G e t I m a g e P r o p e r t y %
824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
826 % MagickGetImageProperty() returns a value associated with the specified
827 % property. Use MagickRelinquishMemory() to free the value when you are
830 % The format of the MagickGetImageProperty method is:
832 % char *MagickGetImageProperty(MagickWand *wand,const char *property)
834 % A description of each parameter follows:
836 % o wand: the magick wand.
838 % o property: the property.
841 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
846 assert(wand != (MagickWand *) NULL);
847 assert(wand->signature == WandSignature);
848 if (wand->debug != MagickFalse)
849 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
850 if (wand->images == (Image *) NULL)
852 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
853 "ContainsNoImages","`%s'",wand->name);
854 return((char *) NULL);
856 value=GetImageProperty(wand->images,property);
857 if (value == (const char *) NULL)
858 return((char *) NULL);
859 return(ConstantString(value));
863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
867 % M a g i c k G e t I m a g e P r o p e r t i e s %
871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
873 % MagickGetImageProperties() returns all the property names that match the
874 % specified pattern associated with a wand. Use MagickGetImageProperty() to
875 % return the value of a particular property. Use MagickRelinquishMemory() to
876 % free the value when you are finished with it.
878 % The format of the MagickGetImageProperties method is:
880 % char *MagickGetImageProperties(MagickWand *wand,
881 % const char *pattern,size_t *number_properties)
883 % A description of each parameter follows:
885 % o wand: the magick wand.
887 % o pattern: Specifies a pointer to a text string containing a pattern.
889 % o number_properties: the number properties associated with this wand.
892 WandExport char **MagickGetImageProperties(MagickWand *wand,
893 const char *pattern,size_t *number_properties)
907 assert(wand != (MagickWand *) NULL);
908 assert(wand->signature == WandSignature);
909 if (wand->debug != MagickFalse)
910 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
911 if (wand->images == (Image *) NULL)
913 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
914 "ContainsNoImages","`%s'",wand->name);
915 return((char **) NULL);
917 (void) GetImageProperty(wand->images,"exif:*");
919 properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
920 if (properties == (char **) NULL)
921 return((char **) NULL);
922 ResetImagePropertyIterator(wand->images);
923 property=GetNextImageProperty(wand->images);
924 for (i=0; property != (const char *) NULL; )
926 if ((*property != '[') &&
927 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
929 if ((i+1) >= (ssize_t) length)
932 properties=(char **) ResizeQuantumMemory(properties,length,
933 sizeof(*properties));
934 if (properties == (char **) NULL)
936 (void) ThrowMagickException(wand->exception,GetMagickModule(),
937 ResourceLimitError,"MemoryAllocationFailed","`%s'",
939 return((char **) NULL);
942 properties[i]=ConstantString(property);
945 property=GetNextImageProperty(wand->images);
947 properties[i]=(char *) NULL;
948 *number_properties=(size_t) i;
953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
957 % M a g i c k G e t I n t e r l a c e S c h e m e %
961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
963 % MagickGetInterlaceScheme() gets the wand interlace scheme.
965 % The format of the MagickGetInterlaceScheme method is:
967 % InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
969 % A description of each parameter follows:
971 % o wand: the magick wand.
974 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
976 assert(wand != (MagickWand *) NULL);
977 assert(wand->signature == WandSignature);
978 if (wand->debug != MagickFalse)
979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
980 return(wand->image_info->interlace);
984 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
988 % 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 %
992 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
994 % MagickGetInterpolateMethod() gets the wand compression.
996 % The format of the MagickGetInterpolateMethod method is:
998 % InterpolatePixelMethod MagickGetInterpolateMethod(MagickWand *wand)
1000 % A description of each parameter follows:
1002 % o wand: the magick wand.
1005 WandExport InterpolatePixelMethod MagickGetInterpolateMethod(MagickWand *wand)
1010 InterpolatePixelMethod
1013 assert(wand != (MagickWand *) NULL);
1014 assert(wand->signature == WandSignature);
1015 if (wand->debug != MagickFalse)
1016 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1017 option=GetImageOption(wand->image_info,"interpolate");
1018 if (option == (const char *) NULL)
1019 return(UndefinedInterpolatePixel);
1020 method=(InterpolatePixelMethod) ParseMagickOption(MagickInterpolateOptions,
1021 MagickFalse,option);
1026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1030 % M a g i c k G e t O p t i o n %
1034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1036 % MagickGetOption() returns a value associated with a wand and the specified
1037 % key. Use MagickRelinquishMemory() to free the value when you are finished
1040 % The format of the MagickGetOption method is:
1042 % char *MagickGetOption(MagickWand *wand,const char *key)
1044 % A description of each parameter follows:
1046 % o wand: the magick wand.
1051 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
1056 assert(wand != (MagickWand *) NULL);
1057 assert(wand->signature == WandSignature);
1058 if (wand->debug != MagickFalse)
1059 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1060 option=GetImageOption(wand->image_info,key);
1061 return(ConstantString(option));
1065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1069 % M a g i c k G e t O p t i o n %
1073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1075 % MagickGetOptions() returns all the option names that match the specified
1076 % pattern associated with a wand. Use MagickGetOption() to return the value
1077 % of a particular option. Use MagickRelinquishMemory() to free the value
1078 % when you are finished with it.
1080 % The format of the MagickGetOptions method is:
1082 % char *MagickGetOptions(MagickWand *wand,size_t *number_options)
1084 % A description of each parameter follows:
1086 % o wand: the magick wand.
1088 % o pattern: Specifies a pointer to a text string containing a pattern.
1090 % o number_options: the number options associated with this wand.
1093 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
1094 size_t *number_options)
1108 assert(wand != (MagickWand *) NULL);
1109 assert(wand->signature == WandSignature);
1110 if (wand->debug != MagickFalse)
1111 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1112 if (wand->images == (Image *) NULL)
1114 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1115 "ContainsNoImages","`%s'",wand->name);
1116 return((char **) NULL);
1119 options=(char **) AcquireQuantumMemory(length,sizeof(*options));
1120 if (options == (char **) NULL)
1121 return((char **) NULL);
1122 ResetImageOptionIterator(wand->image_info);
1123 option=GetNextImageOption(wand->image_info);
1124 for (i=0; option != (const char *) NULL; )
1126 if ((*option != '[') &&
1127 (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
1129 if ((i+1) >= (ssize_t) length)
1132 options=(char **) ResizeQuantumMemory(options,length,
1134 if (options == (char **) NULL)
1136 (void) ThrowMagickException(wand->exception,GetMagickModule(),
1137 ResourceLimitError,"MemoryAllocationFailed","`%s'",
1139 return((char **) NULL);
1142 options[i]=ConstantString(option);
1145 option=GetNextImageOption(wand->image_info);
1147 options[i]=(char *) NULL;
1148 *number_options=(size_t) i;
1153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1157 % M a g i c k G e t O r i e n t a t i o n %
1161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1163 % MagickGetOrientation() gets the wand orientation type.
1165 % The format of the MagickGetOrientation method is:
1167 % OrientationType MagickGetOrientation(MagickWand *wand)
1169 % A description of each parameter follows:
1171 % o wand: the magick wand.
1174 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
1176 assert(wand != (MagickWand *) NULL);
1177 assert(wand->signature == WandSignature);
1178 if (wand->debug != MagickFalse)
1179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1180 return(wand->image_info->orientation);
1184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1188 % M a g i c k G e t P a c k a g e N a m e %
1192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1194 % MagickGetPackageName() returns the ImageMagick package name as a string
1197 % The format of the MagickGetPackageName method is:
1199 % const char *MagickGetPackageName(void)
1203 WandExport const char *MagickGetPackageName(void)
1205 return(GetMagickPackageName());
1209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1213 % M a g i c k G e t P a g e %
1217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1219 % MagickGetPage() returns the page geometry associated with the magick wand.
1221 % The format of the MagickGetPage method is:
1223 % MagickBooleanType MagickGetPage(const MagickWand *wand,
1224 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1226 % A description of each parameter follows:
1228 % o wand: the magick wand.
1230 % o width: the page width.
1232 % o height: page height.
1234 % o x: the page x-offset.
1236 % o y: the page y-offset.
1239 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
1240 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1245 assert(wand != (const MagickWand *) NULL);
1246 assert(wand->signature == WandSignature);
1247 if (wand->debug != MagickFalse)
1248 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1249 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1250 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1251 *width=geometry.width;
1252 *height=geometry.height;
1259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1263 % M a g i c k G e t P o i n t s i z e %
1267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1269 % MagickGetPointsize() returns the font pointsize associated with the
1272 % The format of the MagickGetPointsize method is:
1274 % double MagickGetPointsize(MagickWand *wand)
1276 % A description of each parameter follows:
1278 % o wand: the magick wand.
1281 WandExport double MagickGetPointsize(MagickWand *wand)
1283 assert(wand != (MagickWand *) NULL);
1284 assert(wand->signature == WandSignature);
1285 if (wand->debug != MagickFalse)
1286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1287 return(wand->image_info->pointsize);
1291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1295 % M a g i c k G e t Q u a n t u m D e p t h %
1299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1301 % MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
1304 % The format of the MagickGetQuantumDepth method is:
1306 % const char *MagickGetQuantumDepth(size_t *depth)
1308 % A description of each parameter follows:
1310 % o depth: the quantum depth is returned as a number.
1313 WandExport const char *MagickGetQuantumDepth(size_t *depth)
1315 return(GetMagickQuantumDepth(depth));
1319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1323 % M a g i c k G e t Q u a n t u m R a n g e %
1327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1329 % MagickGetQuantumRange() returns the ImageMagick quantum range as a string
1332 % The format of the MagickGetQuantumRange method is:
1334 % const char *MagickGetQuantumRange(size_t *range)
1336 % A description of each parameter follows:
1338 % o range: the quantum range is returned as a number.
1341 WandExport const char *MagickGetQuantumRange(size_t *range)
1343 return(GetMagickQuantumRange(range));
1347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1351 % M a g i c k G e t R e l e a s e D a t e %
1355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1357 % MagickGetReleaseDate() returns the ImageMagick release date as a string
1360 % The format of the MagickGetReleaseDate method is:
1362 % const char *MagickGetReleaseDate(void)
1365 WandExport const char *MagickGetReleaseDate(void)
1367 return(GetMagickReleaseDate());
1371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1375 % M a g i c k G e t R e s o l u t i o n %
1379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1381 % MagickGetResolution() gets the image X and Y resolution.
1383 % The format of the MagickGetResolution method is:
1385 % MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
1388 % A description of each parameter follows:
1390 % o wand: the magick wand.
1392 % o x: the x-resolution.
1394 % o y: the y-resolution.
1397 WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
1398 double *x,double *y)
1400 assert(wand != (MagickWand *) NULL);
1401 assert(wand->signature == WandSignature);
1402 if (wand->debug != MagickFalse)
1403 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1406 if (wand->image_info->density != (char *) NULL)
1414 flags=ParseGeometry(wand->image_info->density,&geometry_info);
1415 *x=geometry_info.rho;
1416 *y=geometry_info.sigma;
1417 if ((flags & SigmaValue) == MagickFalse)
1424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1428 % M a g i c k G e t R e s o u r c e %
1432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1434 % MagickGetResource() returns the specified resource in megabytes.
1436 % The format of the MagickGetResource method is:
1438 % MagickSizeType MagickGetResource(const ResourceType type)
1440 % A description of each parameter follows:
1442 % o wand: the magick wand.
1445 WandExport MagickSizeType MagickGetResource(const ResourceType type)
1447 return(GetMagickResource(type));
1451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1455 % M a g i c k G e t R e s o u r c e L i m i t %
1459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1461 % MagickGetResourceLimit() returns the specified resource limit in megabytes.
1463 % The format of the MagickGetResourceLimit method is:
1465 % MagickSizeType MagickGetResourceLimit(const ResourceType type)
1467 % A description of each parameter follows:
1469 % o wand: the magick wand.
1472 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
1474 return(GetMagickResourceLimit(type));
1478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1482 % M a g i c k G e t S a m p l i n g F a c t o r s %
1486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1488 % MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
1490 % The format of the MagickGetSamplingFactors method is:
1492 % double *MagickGetSamplingFactor(MagickWand *wand,
1493 % size_t *number_factors)
1495 % A description of each parameter follows:
1497 % o wand: the magick wand.
1499 % o number_factors: the number of factors in the returned array.
1502 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
1503 size_t *number_factors)
1514 assert(wand != (MagickWand *) NULL);
1515 assert(wand->signature == WandSignature);
1516 if (wand->debug != MagickFalse)
1517 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1519 sampling_factors=(double *) NULL;
1520 if (wand->image_info->sampling_factor == (char *) NULL)
1521 return(sampling_factors);
1523 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1525 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1530 sampling_factors=(double *) AcquireQuantumMemory((size_t) i,
1531 sizeof(*sampling_factors));
1532 if (sampling_factors == (double *) NULL)
1533 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
1534 wand->image_info->filename);
1536 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1538 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1541 sampling_factors[i]=StringToDouble(p);
1544 *number_factors=(size_t) i;
1545 return(sampling_factors);
1549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1553 % M a g i c k G e t S i z e %
1557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1559 % MagickGetSize() returns the size associated with the magick wand.
1561 % The format of the MagickGetSize method is:
1563 % MagickBooleanType MagickGetSize(const MagickWand *wand,
1564 % size_t *columns,size_t *rows)
1566 % A description of each parameter follows:
1568 % o wand: the magick wand.
1570 % o columns: the width in pixels.
1572 % o height: the height in pixels.
1575 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
1576 size_t *columns,size_t *rows)
1581 assert(wand != (const MagickWand *) NULL);
1582 assert(wand->signature == WandSignature);
1583 if (wand->debug != MagickFalse)
1584 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1585 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1586 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1587 *columns=geometry.width;
1588 *rows=geometry.height;
1593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1597 % M a g i c k G e t S i z e O f f s e t %
1601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1603 % MagickGetSizeOffset() returns the size offset associated with the magick
1606 % The format of the MagickGetSizeOffset method is:
1608 % MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1611 % A description of each parameter follows:
1613 % o wand: the magick wand.
1615 % o offset: the image offset.
1618 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1624 assert(wand != (const MagickWand *) NULL);
1625 assert(wand->signature == WandSignature);
1626 if (wand->debug != MagickFalse)
1627 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1628 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1629 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1635 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1639 % M a g i c k G e t T y p e %
1643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1645 % MagickGetType() returns the wand type.
1647 % The format of the MagickGetType method is:
1649 % ImageType MagickGetType(MagickWand *wand)
1651 % A description of each parameter follows:
1653 % o wand: the magick wand.
1656 WandExport ImageType MagickGetType(MagickWand *wand)
1658 assert(wand != (MagickWand *) NULL);
1659 assert(wand->signature == WandSignature);
1660 if (wand->debug != MagickFalse)
1661 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1662 return(wand->image_info->type);
1666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1670 % M a g i c k G e t V e r s i o n %
1674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1676 % MagickGetVersion() returns the ImageMagick API version as a string constant
1679 % The format of the MagickGetVersion method is:
1681 % const char *MagickGetVersion(size_t *version)
1683 % A description of each parameter follows:
1685 % o version: the ImageMagick version is returned as a number.
1688 WandExport const char *MagickGetVersion(size_t *version)
1690 return(GetMagickVersion(version));
1694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1698 % M a g i c k P r o f i l e I m a g e %
1702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1704 % MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
1705 % from an image. If the profile is NULL, it is removed from the image
1706 % otherwise added. Use a name of '*' and a profile of NULL to remove all
1707 % profiles from the image.
1709 % The format of the MagickProfileImage method is:
1711 % MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
1712 % const void *profile,const size_t length)
1714 % A description of each parameter follows:
1716 % o wand: the magick wand.
1718 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
1720 % o profile: the profile.
1722 % o length: the length of the profile.
1725 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
1726 const char *name,const void *profile,const size_t length)
1731 assert(wand != (MagickWand *) NULL);
1732 assert(wand->signature == WandSignature);
1733 if (wand->debug != MagickFalse)
1734 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1735 if (wand->images == (Image *) NULL)
1736 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1737 status=ProfileImage(wand->images,name,profile,length,MagickTrue);
1738 if (status == MagickFalse)
1739 InheritException(wand->exception,&wand->images->exception);
1744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1748 % M a g i c k R e m o v e I m a g e P r o f i l e %
1752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1754 % MagickRemoveImageProfile() removes the named image profile and returns it.
1756 % The format of the MagickRemoveImageProfile method is:
1758 % unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1759 % const char *name,size_t *length)
1761 % A description of each parameter follows:
1763 % o wand: the magick wand.
1765 % o name: Name of profile to return: ICC, IPTC, or generic profile.
1767 % o length: the length of the profile.
1770 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1771 const char *name,size_t *length)
1779 assert(wand != (MagickWand *) NULL);
1780 assert(wand->signature == WandSignature);
1781 if (wand->debug != MagickFalse)
1782 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1783 if (wand->images == (Image *) NULL)
1785 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1786 "ContainsNoImages","`%s'",wand->name);
1787 return((unsigned char *) NULL);
1790 profile=RemoveImageProfile(wand->images,name);
1791 if (profile == (StringInfo *) NULL)
1792 return((unsigned char *) NULL);
1793 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1795 if (datum == (unsigned char *) NULL)
1796 return((unsigned char *) NULL);
1797 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
1798 GetStringInfoLength(profile));
1799 *length=GetStringInfoLength(profile);
1800 profile=DestroyStringInfo(profile);
1805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1809 % M a g i c k S e t A n t i a l i a s %
1813 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1815 % MagickSetAntialias() sets the antialias propery of the wand.
1817 % The format of the MagickSetAntialias method is:
1819 % MagickBooleanType MagickSetAntialias(MagickWand *wand,
1820 % const MagickBooleanType antialias)
1822 % A description of each parameter follows:
1824 % o wand: the magick wand.
1826 % o antialias: the antialias property.
1829 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
1830 const MagickBooleanType antialias)
1832 assert(wand != (MagickWand *) NULL);
1833 assert(wand->signature == WandSignature);
1834 if (wand->debug != MagickFalse)
1835 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1836 wand->image_info->antialias=antialias;
1841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1845 % M a g i c k S e t B a c k g r o u n d C o l o r %
1849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1851 % MagickSetBackgroundColor() sets the wand background color.
1853 % The format of the MagickSetBackgroundColor method is:
1855 % MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1856 % const PixelWand *background)
1858 % A description of each parameter follows:
1860 % o wand: the magick wand.
1862 % o background: the background pixel wand.
1865 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1866 const PixelWand *background)
1868 assert(wand != (MagickWand *) NULL);
1869 assert(wand->signature == WandSignature);
1870 if (wand->debug != MagickFalse)
1871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1872 PixelGetQuantumColor(background,&wand->image_info->background_color);
1877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1881 % M a g i c k S e t C o l o r s p a c e %
1885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1887 % MagickSetColorspace() sets the wand colorspace type.
1889 % The format of the MagickSetColorspace method is:
1891 % MagickBooleanType MagickSetColorspace(MagickWand *wand,
1892 % const ColorspaceType colorspace)
1894 % A description of each parameter follows:
1896 % o wand: the magick wand.
1898 % o colorspace: the wand colorspace.
1901 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
1902 const ColorspaceType colorspace)
1904 assert(wand != (MagickWand *) NULL);
1905 assert(wand->signature == WandSignature);
1906 if (wand->debug != MagickFalse)
1907 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1908 wand->image_info->colorspace=colorspace;
1913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1917 % M a g i c k S e t C o m p r e s s i o n %
1921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1923 % MagickSetCompression() sets the wand compression type.
1925 % The format of the MagickSetCompression method is:
1927 % MagickBooleanType MagickSetCompression(MagickWand *wand,
1928 % const CompressionType compression)
1930 % A description of each parameter follows:
1932 % o wand: the magick wand.
1934 % o compression: the wand compression.
1937 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
1938 const CompressionType compression)
1940 assert(wand != (MagickWand *) NULL);
1941 assert(wand->signature == WandSignature);
1942 if (wand->debug != MagickFalse)
1943 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1944 wand->image_info->compression=compression;
1949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1953 % 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 %
1957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1959 % MagickSetCompressionQuality() sets the wand compression quality.
1961 % The format of the MagickSetCompressionQuality method is:
1963 % MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1964 % const size_t quality)
1966 % A description of each parameter follows:
1968 % o wand: the magick wand.
1970 % o quality: the wand compression quality.
1973 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1974 const size_t quality)
1976 assert(wand != (MagickWand *) NULL);
1977 assert(wand->signature == WandSignature);
1978 if (wand->debug != MagickFalse)
1979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1980 wand->image_info->quality=quality;
1985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1989 % M a g i c k S e t D e p t h %
1993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1995 % MagickSetDepth() sets the wand pixel depth.
1997 % The format of the MagickSetDepth method is:
1999 % MagickBooleanType MagickSetDepth(MagickWand *wand,
2000 % const size_t depth)
2002 % A description of each parameter follows:
2004 % o wand: the magick wand.
2006 % o depth: the wand pixel depth.
2009 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
2012 assert(wand != (MagickWand *) NULL);
2013 assert(wand->signature == WandSignature);
2014 if (wand->debug != MagickFalse)
2015 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2016 wand->image_info->depth=depth;
2021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2025 % M a g i c k S e t E x t r a c t %
2029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2031 % MagickSetExtract() sets the extract geometry before you read or write an
2032 % image file. Use it for inline cropping (e.g. 200x200+0+0) or resizing
2035 % The format of the MagickSetExtract method is:
2037 % MagickBooleanType MagickSetExtract(MagickWand *wand,
2038 % const char *geometry)
2040 % A description of each parameter follows:
2042 % o wand: the magick wand.
2044 % o geometry: the extract geometry.
2047 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
2048 const char *geometry)
2050 assert(wand != (MagickWand *) NULL);
2051 assert(wand->signature == WandSignature);
2052 if (wand->debug != MagickFalse)
2053 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2054 if (geometry != (const char *) NULL)
2055 (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
2060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2064 % M a g i c k S e t F i l e n a m e %
2068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2070 % MagickSetFilename() sets the filename before you read or write an image file.
2072 % The format of the MagickSetFilename method is:
2074 % MagickBooleanType MagickSetFilename(MagickWand *wand,
2075 % const char *filename)
2077 % A description of each parameter follows:
2079 % o wand: the magick wand.
2081 % o filename: the image filename.
2084 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
2085 const char *filename)
2087 assert(wand != (MagickWand *) NULL);
2088 assert(wand->signature == WandSignature);
2089 if (wand->debug != MagickFalse)
2090 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2091 if (filename != (const char *) NULL)
2092 (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
2097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2101 % M a g i c k S e t F o n t %
2105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2107 % MagickSetFont() sets the font associated with the MagickWand.
2109 % The format of the MagickSetFont method is:
2111 % MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
2113 % A description of each parameter follows:
2115 % o wand: the magick wand.
2120 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
2122 if ((font == (const char *) NULL) || (*font == '\0'))
2123 return(MagickFalse);
2124 assert(wand != (MagickWand *) NULL);
2125 assert(wand->signature == WandSignature);
2126 if (wand->debug != MagickFalse)
2127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2128 (void) CloneString(&wand->image_info->font,font);
2133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2137 % M a g i c k S e t F o r m a t %
2141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2143 % MagickSetFormat() sets the format of the magick wand.
2145 % The format of the MagickSetFormat method is:
2147 % MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
2149 % A description of each parameter follows:
2151 % o wand: the magick wand.
2153 % o format: the image format.
2156 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
2162 assert(wand != (MagickWand *) NULL);
2163 assert(wand->signature == WandSignature);
2164 if (wand->debug != MagickFalse)
2165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2166 if ((format == (char *) NULL) || (*format == '\0'))
2168 *wand->image_info->magick='\0';
2171 magick_info=GetMagickInfo(format,wand->exception);
2172 if (magick_info == (const MagickInfo *) NULL)
2173 return(MagickFalse);
2174 ClearMagickException(wand->exception);
2175 (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
2180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2184 % M a g i c k S e t G r a v i t y %
2188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2190 % MagickSetGravity() sets the gravity type.
2192 % The format of the MagickSetGravity type is:
2194 % MagickBooleanType MagickSetGravity(MagickWand *wand,
2195 % const GravityType type)
2197 % A description of each parameter follows:
2199 % o wand: the magick wand.
2201 % o type: the gravity type.
2204 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
2205 const GravityType type)
2210 assert(wand != (MagickWand *) NULL);
2211 assert(wand->signature == WandSignature);
2212 if (wand->debug != MagickFalse)
2213 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2214 status=SetImageOption(wand->image_info,"gravity",MagickOptionToMnemonic(
2215 MagickGravityOptions,(ssize_t) type));
2220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2224 % M a g i c k S e t I m a g e A r t i f r c t %
2228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2230 % MagickSetImageArtifact() associates a artifact with an image.
2232 % The format of the MagickSetImageArtifact method is:
2234 % MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2235 % const char *artifact,const char *value)
2237 % A description of each parameter follows:
2239 % o wand: the magick wand.
2241 % o artifact: the artifact.
2243 % o value: the value.
2246 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2247 const char *artifact,const char *value)
2252 assert(wand != (MagickWand *) NULL);
2253 assert(wand->signature == WandSignature);
2254 if (wand->debug != MagickFalse)
2255 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2256 if (wand->images == (Image *) NULL)
2257 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2258 status=SetImageArtifact(wand->images,artifact,value);
2259 if (status == MagickFalse)
2260 InheritException(wand->exception,&wand->images->exception);
2265 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2269 % M a g i c k S e t P r o f i l e I m a g e %
2273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2275 % MagickSetImageProfile() adds a named profile to the magick wand. If a
2276 % profile with the same name already exists, it is replaced. This method
2277 % differs from the MagickProfileImage() method in that it does not apply any
2278 % CMS color profiles.
2280 % The format of the MagickSetImageProfile method is:
2282 % MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2283 % const char *name,const void *profile,const size_t length)
2285 % A description of each parameter follows:
2287 % o wand: the magick wand.
2289 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
2291 % o profile: the profile.
2293 % o length: the length of the profile.
2296 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2297 const char *name,const void *profile,const size_t length)
2305 assert(wand != (MagickWand *) NULL);
2306 assert(wand->signature == WandSignature);
2307 if (wand->debug != MagickFalse)
2308 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2309 if (wand->images == (Image *) NULL)
2310 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2311 profile_info=AcquireStringInfo((size_t) length);
2312 SetStringInfoDatum(profile_info,(unsigned char *) profile);
2313 status=SetImageProfile(wand->images,name,profile_info);
2314 profile_info=DestroyStringInfo(profile_info);
2315 if (status == MagickFalse)
2316 InheritException(wand->exception,&wand->images->exception);
2321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2325 % M a g i c k S e t I m a g e P r o p e r t y %
2329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2331 % MagickSetImageProperty() associates a property with an image.
2333 % The format of the MagickSetImageProperty method is:
2335 % MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2336 % const char *property,const char *value)
2338 % A description of each parameter follows:
2340 % o wand: the magick wand.
2342 % o property: the property.
2344 % o value: the value.
2347 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2348 const char *property,const char *value)
2353 assert(wand != (MagickWand *) NULL);
2354 assert(wand->signature == WandSignature);
2355 if (wand->debug != MagickFalse)
2356 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2357 if (wand->images == (Image *) NULL)
2358 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2359 status=SetImageProperty(wand->images,property,value);
2360 if (status == MagickFalse)
2361 InheritException(wand->exception,&wand->images->exception);
2366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2370 % M a g i c k S e t I n t e r l a c e S c h e m e %
2374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2376 % MagickSetInterlaceScheme() sets the image compression.
2378 % The format of the MagickSetInterlaceScheme method is:
2380 % MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2381 % const InterlaceType interlace_scheme)
2383 % A description of each parameter follows:
2385 % o wand: the magick wand.
2387 % o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
2388 % PlaneInterlace, PartitionInterlace.
2391 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2392 const InterlaceType interlace_scheme)
2394 assert(wand != (MagickWand *) NULL);
2395 assert(wand->signature == WandSignature);
2396 if (wand->debug != MagickFalse)
2397 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2398 wand->image_info->interlace=interlace_scheme;
2403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2407 % 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 %
2411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2413 % MagickSetInterpolateMethod() sets the interpolate pixel method.
2415 % The format of the MagickSetInterpolateMethod method is:
2417 % MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2418 % const InterpolateMethodPixel method)
2420 % A description of each parameter follows:
2422 % o wand: the magick wand.
2424 % o method: the interpolate pixel method.
2427 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2428 const InterpolatePixelMethod method)
2433 assert(wand != (MagickWand *) NULL);
2434 assert(wand->signature == WandSignature);
2435 if (wand->debug != MagickFalse)
2436 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2437 status=SetImageOption(wand->image_info,"interpolate",
2438 MagickOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
2443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2447 % M a g i c k S e t O p t i o n %
2451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2453 % MagickSetOption() associates one or options with the wand (.e.g
2454 % MagickSetOption(wand,"jpeg:perserve","yes")).
2456 % The format of the MagickSetOption method is:
2458 % MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2459 % const char *value)
2461 % A description of each parameter follows:
2463 % o wand: the magick wand.
2467 % o value: The value.
2470 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2473 assert(wand != (MagickWand *) NULL);
2474 assert(wand->signature == WandSignature);
2475 if (wand->debug != MagickFalse)
2476 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2477 return(SetImageOption(wand->image_info,key,value));
2481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2485 % M a g i c k S e t O r i e n t a t i o n %
2489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2491 % MagickSetOrientation() sets the wand orientation type.
2493 % The format of the MagickSetOrientation method is:
2495 % MagickBooleanType MagickSetOrientation(MagickWand *wand,
2496 % const OrientationType orientation)
2498 % A description of each parameter follows:
2500 % o wand: the magick wand.
2502 % o orientation: the wand orientation.
2505 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
2506 const OrientationType orientation)
2508 assert(wand != (MagickWand *) NULL);
2509 assert(wand->signature == WandSignature);
2510 if (wand->debug != MagickFalse)
2511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2512 wand->image_info->orientation=orientation;
2517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2521 % M a g i c k S e t P a g e %
2525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2527 % MagickSetPage() sets the page geometry of the magick wand.
2529 % The format of the MagickSetPage method is:
2531 % MagickBooleanType MagickSetPage(MagickWand *wand,
2532 % const size_t width,const size_t height,const ssize_t x,
2535 % A description of each parameter follows:
2537 % o wand: the magick wand.
2539 % o width: the page width.
2541 % o height: the page height.
2543 % o x: the page x-offset.
2545 % o y: the page y-offset.
2548 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
2549 const size_t width,const size_t height,const ssize_t x,
2553 geometry[MaxTextExtent];
2555 assert(wand != (MagickWand *) NULL);
2556 assert(wand->signature == WandSignature);
2557 if (wand->debug != MagickFalse)
2558 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2559 (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
2560 (double) width,(double) height,(double) x,(double) y);
2561 (void) CloneString(&wand->image_info->page,geometry);
2566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2570 % M a g i c k S e t P a s s p h r a s e %
2574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2576 % MagickSetPassphrase() sets the passphrase.
2578 % The format of the MagickSetPassphrase method is:
2580 % MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2581 % const char *passphrase)
2583 % A description of each parameter follows:
2585 % o wand: the magick wand.
2587 % o passphrase: the passphrase.
2590 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2591 const char *passphrase)
2593 assert(wand != (MagickWand *) NULL);
2594 assert(wand->signature == WandSignature);
2595 if (wand->debug != MagickFalse)
2596 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2597 (void) CloneString(&wand->image_info->authenticate,passphrase);
2602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2606 % M a g i c k S e t P o i n t s i z e %
2610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2612 % MagickSetPointsize() sets the font pointsize associated with the MagickWand.
2614 % The format of the MagickSetPointsize method is:
2616 % MagickBooleanType MagickSetPointsize(MagickWand *wand,
2617 % const double pointsize)
2619 % A description of each parameter follows:
2621 % o wand: the magick wand.
2623 % o pointsize: the size of the font
2626 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
2627 const double pointsize)
2629 assert(wand != (MagickWand *) NULL);
2630 assert(wand->signature == WandSignature);
2631 if (wand->debug != MagickFalse)
2632 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2633 wand->image_info->pointsize=pointsize;
2638 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2642 % M a g i c k S e t P r o g r e s s M o n i t o r %
2646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2648 % MagickSetProgressMonitor() sets the wand progress monitor to the specified
2649 % method and returns the previous progress monitor if any. The progress
2650 % monitor method looks like this:
2652 % MagickBooleanType MagickProgressMonitor(const char *text,
2653 % const MagickOffsetType offset,const MagickSizeType span,
2654 % void *client_data)
2656 % If the progress monitor returns MagickFalse, the current operation is
2659 % The format of the MagickSetProgressMonitor method is:
2661 % MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
2662 % const MagickProgressMonitor progress_monitor,void *client_data)
2664 % A description of each parameter follows:
2666 % o wand: the magick wand.
2668 % o progress_monitor: Specifies a pointer to a method to monitor progress
2669 % of an image operation.
2671 % o client_data: Specifies a pointer to any client data.
2674 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
2675 const MagickProgressMonitor progress_monitor,void *client_data)
2677 MagickProgressMonitor
2680 assert(wand != (MagickWand *) NULL);
2681 assert(wand->signature == WandSignature);
2682 if (wand->debug != MagickFalse)
2683 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2684 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2685 progress_monitor,client_data);
2686 return(previous_monitor);
2690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2694 % M a g i c k S e t R e s o u r c e L i m i t %
2698 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2700 % MagickSetResourceLimit() sets the limit for a particular resource in
2703 % The format of the MagickSetResourceLimit method is:
2705 % MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2706 % const MagickSizeType limit)
2708 % A description of each parameter follows:
2710 % o type: the type of resource: AreaResource, MemoryResource, MapResource,
2711 % DiskResource, FileResource.
2713 % o The maximum limit for the resource.
2716 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2717 const MagickSizeType limit)
2719 return(SetMagickResourceLimit(type,limit));
2723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2727 % M a g i c k S e t R e s o l u t i o n %
2731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2733 % MagickSetResolution() sets the image resolution.
2735 % The format of the MagickSetResolution method is:
2737 % MagickBooleanType MagickSetResolution(MagickWand *wand,
2738 % const double x_resolution,const doubtl y_resolution)
2740 % A description of each parameter follows:
2742 % o wand: the magick wand.
2744 % o x_resolution: the image x resolution.
2746 % o y_resolution: the image y resolution.
2749 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
2750 const double x_resolution,const double y_resolution)
2753 density[MaxTextExtent];
2755 assert(wand != (MagickWand *) NULL);
2756 assert(wand->signature == WandSignature);
2757 if (wand->debug != MagickFalse)
2758 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2759 (void) FormatMagickString(density,MaxTextExtent,"%gx%g",x_resolution,
2761 (void) CloneString(&wand->image_info->density,density);
2766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2770 % M a g i c k S e t S a m p l i n g F a c t o r s %
2774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2776 % MagickSetSamplingFactors() sets the image sampling factors.
2778 % The format of the MagickSetSamplingFactors method is:
2780 % MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2781 % const size_t number_factors,const double *sampling_factors)
2783 % A description of each parameter follows:
2785 % o wand: the magick wand.
2787 % o number_factoes: the number of factors.
2789 % o sampling_factors: An array of doubles representing the sampling factor
2790 % for each color component (in RGB order).
2793 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2794 const size_t number_factors,const double *sampling_factors)
2797 sampling_factor[MaxTextExtent];
2802 assert(wand != (MagickWand *) NULL);
2803 assert(wand->signature == WandSignature);
2804 if (wand->debug != MagickFalse)
2805 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2806 if (wand->image_info->sampling_factor != (char *) NULL)
2807 wand->image_info->sampling_factor=(char *)
2808 RelinquishMagickMemory(wand->image_info->sampling_factor);
2809 if (number_factors == 0)
2811 for (i=0; i < (ssize_t) (number_factors-1); i++)
2813 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g,",
2814 sampling_factors[i]);
2815 (void) ConcatenateString(&wand->image_info->sampling_factor,
2818 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g",
2819 sampling_factors[i]);
2820 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2829 % M a g i c k S e t S i z e %
2833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2835 % MagickSetSize() sets the size of the magick wand. Set it before you
2836 % read a raw image format such as RGB, GRAY, or CMYK.
2838 % The format of the MagickSetSize method is:
2840 % MagickBooleanType MagickSetSize(MagickWand *wand,
2841 % const size_t columns,const size_t rows)
2843 % A description of each parameter follows:
2845 % o wand: the magick wand.
2847 % o columns: the width in pixels.
2849 % o rows: the rows in pixels.
2852 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
2853 const size_t columns,const size_t rows)
2856 geometry[MaxTextExtent];
2858 assert(wand != (MagickWand *) NULL);
2859 assert(wand->signature == WandSignature);
2860 if (wand->debug != MagickFalse)
2861 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2862 (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
2863 columns,(double) rows);
2864 (void) CloneString(&wand->image_info->size,geometry);
2869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2873 % M a g i c k S e t S i z e O f f s e t %
2877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2879 % MagickSetSizeOffset() sets the size and offset of the magick wand. Set it
2880 % before you read a raw image format such as RGB, GRAY, or CMYK.
2882 % The format of the MagickSetSizeOffset method is:
2884 % MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2885 % const size_t columns,const size_t rows,
2886 % const ssize_t offset)
2888 % A description of each parameter follows:
2890 % o wand: the magick wand.
2892 % o columns: the image width in pixels.
2894 % o rows: the image rows in pixels.
2896 % o offset: the image offset.
2899 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2900 const size_t columns,const size_t rows,const ssize_t offset)
2903 geometry[MaxTextExtent];
2905 assert(wand != (MagickWand *) NULL);
2906 assert(wand->signature == WandSignature);
2907 if (wand->debug != MagickFalse)
2908 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2909 (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g",
2910 (double) columns,(double) rows,(double) offset);
2911 (void) CloneString(&wand->image_info->size,geometry);
2916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2920 % M a g i c k S e t T y p e %
2924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2926 % MagickSetType() sets the image type attribute.
2928 % The format of the MagickSetType method is:
2930 % MagickBooleanType MagickSetType(MagickWand *wand,
2931 % const ImageType image_type)
2933 % A description of each parameter follows:
2935 % o wand: the magick wand.
2937 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
2938 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
2939 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
2943 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
2944 const ImageType image_type)
2946 assert(wand != (MagickWand *) NULL);
2947 assert(wand->signature == WandSignature);
2948 if (wand->debug != MagickFalse)
2949 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2950 wand->image_info->type=image_type;