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-2018 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 % https://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 "MagickWand/studio.h"
50 #include "MagickWand/MagickWand.h"
51 #include "MagickWand/magick-wand-private.h"
52 #include "MagickWand/wand.h"
53 #include "MagickCore/string-private.h"
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 % 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 %
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 % MagickDeleteImageArtifact() deletes a wand artifact.
68 % The format of the MagickDeleteImageArtifact method is:
70 % MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
71 % const char *artifact)
73 % A description of each parameter follows:
77 % o artifact: the image artifact.
80 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
83 assert(wand != (MagickWand *) NULL);
84 assert(wand->signature == MagickWandSignature);
85 if (wand->debug != MagickFalse)
86 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
88 if (wand->images == (Image *) NULL)
90 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
91 "ContainsNoImages","`%s'",wand->name);
94 return(DeleteImageArtifact(wand->images,artifact));
98 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102 % 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 %
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
108 % MagickDeleteImageProperty() deletes a wand property.
110 % The format of the MagickDeleteImageProperty method is:
112 % MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
113 % const char *property)
115 % A description of each parameter follows:
117 % o image: the image.
119 % o property: the image property.
122 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
123 const char *property)
125 assert(wand != (MagickWand *) NULL);
126 assert(wand->signature == MagickWandSignature);
127 if (wand->debug != MagickFalse)
128 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
130 if (wand->images == (Image *) NULL)
132 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
133 "ContainsNoImages","`%s'",wand->name);
136 return(DeleteImageProperty(wand->images,property));
140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 % M a g i c k D e l e t e O p t i o n %
148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150 % MagickDeleteOption() deletes a wand option.
152 % The format of the MagickDeleteOption method is:
154 % MagickBooleanType MagickDeleteOption(MagickWand *wand,
155 % const char *option)
157 % A description of each parameter follows:
159 % o image: the image.
161 % o option: the image option.
164 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
167 assert(wand != (MagickWand *) NULL);
168 assert(wand->signature == MagickWandSignature);
169 if (wand->debug != MagickFalse)
170 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
172 return(DeleteImageOption(wand->image_info,option));
176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180 % M a g i c k G e t A n t i a l i a s %
184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186 % MagickGetAntialias() returns the antialias property associated with the
189 % The format of the MagickGetAntialias method is:
191 % MagickBooleanType MagickGetAntialias(const MagickWand *wand)
193 % A description of each parameter follows:
195 % o wand: the magick wand.
198 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
200 assert(wand != (const MagickWand *) NULL);
201 assert(wand->signature == MagickWandSignature);
202 if (wand->debug != MagickFalse)
203 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
205 return(wand->image_info->antialias);
209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213 % M a g i c k G e t B a c k g r o u n d C o l o r %
217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
219 % MagickGetBackgroundColor() returns the wand background color.
221 % The format of the MagickGetBackgroundColor method is:
223 % PixelWand *MagickGetBackgroundColor(MagickWand *wand)
225 % A description of each parameter follows:
227 % o wand: the magick wand.
230 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
235 assert(wand != (MagickWand *) NULL);
236 assert(wand->signature == MagickWandSignature);
237 if (wand->debug != MagickFalse)
238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
240 background_color=NewPixelWand();
241 PixelSetPixelColor(background_color,&wand->image_info->background_color);
242 return(background_color);
246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
250 % M a g i c k G e t C o l o r s p a c e %
254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256 % MagickGetColorspace() gets the wand colorspace type.
258 % The format of the MagickGetColorspace method is:
260 % ColorspaceType MagickGetColorspace(MagickWand *wand)
262 % A description of each parameter follows:
264 % o wand: the magick wand.
267 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
269 assert(wand != (MagickWand *) NULL);
270 assert(wand->signature == MagickWandSignature);
271 if (wand->debug != MagickFalse)
272 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
274 return(wand->image_info->colorspace);
278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
282 % M a g i c k G e t C o m p r e s s i o n %
286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288 % MagickGetCompression() gets the wand compression type.
290 % The format of the MagickGetCompression method is:
292 % CompressionType MagickGetCompression(MagickWand *wand)
294 % A description of each parameter follows:
296 % o wand: the magick wand.
299 WandExport CompressionType MagickGetCompression(MagickWand *wand)
301 assert(wand != (MagickWand *) NULL);
302 assert(wand->signature == MagickWandSignature);
303 if (wand->debug != MagickFalse)
304 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
306 return(wand->image_info->compression);
310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
314 % 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 %
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320 % MagickGetCompressionQuality() gets the wand compression quality.
322 % The format of the MagickGetCompressionQuality method is:
324 % size_t MagickGetCompressionQuality(MagickWand *wand)
326 % A description of each parameter follows:
328 % o wand: the magick wand.
331 WandExport size_t MagickGetCompressionQuality(MagickWand *wand)
333 assert(wand != (MagickWand *) NULL);
334 assert(wand->signature == MagickWandSignature);
335 if (wand->debug != MagickFalse)
336 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
338 return(wand->image_info->quality);
342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
346 % M a g i c k G e t C o p y r i g h t %
350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
352 % MagickGetCopyright() returns the ImageMagick API copyright as a string
355 % The format of the MagickGetCopyright method is:
357 % const char *MagickGetCopyright(void)
360 WandExport const char *MagickGetCopyright(void)
362 return(GetMagickCopyright());
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
370 % M a g i c k G e t F i l e n a m e %
374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
376 % MagickGetFilename() returns the filename associated with an image sequence.
378 % The format of the MagickGetFilename method is:
380 % const char *MagickGetFilename(const MagickWand *wand)
382 % A description of each parameter follows:
384 % o wand: the magick wand.
387 WandExport char *MagickGetFilename(const MagickWand *wand)
389 assert(wand != (const MagickWand *) NULL);
390 assert(wand->signature == MagickWandSignature);
391 if (wand->debug != MagickFalse)
392 (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 == MagickWandSignature);
423 if (wand->debug != MagickFalse)
424 (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 == MagickWandSignature);
457 if (wand->debug != MagickFalse)
458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
460 return(AcquireString(wand->image_info->magick));
464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
468 % M a g i c k G e t G r a v i t y %
472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
474 % MagickGetGravity() gets the wand gravity.
476 % The format of the MagickGetGravity method is:
478 % GravityType MagickGetGravity(MagickWand *wand)
480 % A description of each parameter follows:
482 % o wand: the magick wand.
485 WandExport GravityType MagickGetGravity(MagickWand *wand)
493 assert(wand != (MagickWand *) NULL);
494 assert(wand->signature == MagickWandSignature);
495 if (wand->debug != MagickFalse)
496 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
498 option=GetImageOption(wand->image_info,"gravity");
499 if (option == (const char *) NULL)
500 return(UndefinedGravity);
501 type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,option);
506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
510 % M a g i c k G e t H o m e U R L %
514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
516 % MagickGetHomeURL() returns the ImageMagick home URL.
518 % The format of the MagickGetHomeURL method is:
520 % char *MagickGetHomeURL(void)
523 WandExport char *MagickGetHomeURL(void)
525 return(GetMagickHomeURL());
529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
533 % M a g i c k G e t I m a g e A r t i f a c t %
537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
539 % MagickGetImageArtifact() returns a value associated with the specified
540 % artifact. Use MagickRelinquishMemory() to free the value when you are
543 % The format of the MagickGetImageArtifact method is:
545 % char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
547 % A description of each parameter follows:
549 % o wand: the magick wand.
551 % o artifact: the artifact.
554 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
559 assert(wand != (MagickWand *) NULL);
560 assert(wand->signature == MagickWandSignature);
561 if (wand->debug != MagickFalse)
562 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
564 if (wand->images == (Image *) NULL)
566 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
567 "ContainsNoImages","`%s'",wand->name);
568 return((char *) NULL);
570 value=GetImageArtifact(wand->images,artifact);
571 if (value == (const char *) NULL)
572 return((char *) NULL);
573 return(ConstantString(value));
577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
581 % M a g i c k G e t I m a g e P r o p e r t i e s %
585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
587 % MagickGetImageArtifacts() returns all the artifact names that match the
588 % specified pattern associated with a wand. Use MagickGetImageProperty() to
589 % return the value of a particular artifact. Use MagickRelinquishMemory() to
590 % free the value when you are finished with it.
592 % The format of the MagickGetImageArtifacts method is:
594 % char *MagickGetImageArtifacts(MagickWand *wand,
595 % const char *pattern,size_t *number_artifacts)
597 % A description of each parameter follows:
599 % o wand: the magick wand.
601 % o pattern: Specifies a pointer to a text string containing a pattern.
603 % o number_artifacts: the number artifacts associated with this wand.
606 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
607 const char *pattern,size_t *number_artifacts)
621 assert(wand != (MagickWand *) NULL);
622 assert(wand->signature == MagickWandSignature);
623 if (wand->debug != MagickFalse)
624 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
626 if (wand->images == (Image *) NULL)
628 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
629 "ContainsNoImages","`%s'",wand->name);
630 return((char **) NULL);
632 (void) GetImageProperty(wand->images,"exif:*",wand->exception);
634 artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
635 if (artifacts == (char **) NULL)
636 return((char **) NULL);
637 ResetImagePropertyIterator(wand->images);
638 artifact=GetNextImageProperty(wand->images);
639 for (i=0; artifact != (const char *) NULL; )
641 if ((*artifact != '[') &&
642 (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
644 if ((i+1) >= (ssize_t) length)
647 artifacts=(char **) ResizeQuantumMemory(artifacts,length,
649 if (artifacts == (char **) NULL)
651 (void) ThrowMagickException(wand->exception,GetMagickModule(),
652 ResourceLimitError,"MemoryAllocationFailed","`%s'",
654 return((char **) NULL);
657 artifacts[i]=ConstantString(artifact);
660 artifact=GetNextImageProperty(wand->images);
662 artifacts[i]=(char *) NULL;
663 *number_artifacts=(size_t) i;
668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
672 % M a g i c k G e t I m a g e P r o f i l e %
676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
678 % MagickGetImageProfile() returns the named image profile.
680 % The format of the MagickGetImageProfile method is:
682 % unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
685 % A description of each parameter follows:
687 % o wand: the magick wand.
689 % o name: Name of profile to return: ICC, IPTC, or generic profile.
691 % o length: the length of the profile.
694 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
695 const char *name,size_t *length)
703 assert(wand != (MagickWand *) NULL);
704 assert(wand->signature == MagickWandSignature);
705 if (wand->debug != MagickFalse)
706 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
708 if (wand->images == (Image *) NULL)
710 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
711 "ContainsNoImages","`%s'",wand->name);
712 return((unsigned char *) NULL);
715 if (wand->images->profiles == (SplayTreeInfo *) NULL)
716 return((unsigned char *) NULL);
717 profile=GetImageProfile(wand->images,name);
718 if (profile == (StringInfo *) NULL)
719 return((unsigned char *) NULL);
720 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
722 if (datum == (unsigned char *) NULL)
723 return((unsigned char *) NULL);
724 (void) memcpy(datum,GetStringInfoDatum(profile),
725 GetStringInfoLength(profile));
726 *length=(size_t) GetStringInfoLength(profile);
731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
735 % M a g i c k G e t I m a g e P r o f i l e s %
739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
741 % MagickGetImageProfiles() returns all the profile names that match the
742 % specified pattern associated with a wand. Use MagickGetImageProfile() to
743 % return the value of a particular property. Use MagickRelinquishMemory() to
744 % free the value when you are finished with it.
746 % The format of the MagickGetImageProfiles method is:
748 % char *MagickGetImageProfiles(MagickWand *wand,const char *pattern,
749 % size_t *number_profiles)
751 % A description of each parameter follows:
753 % o wand: the magick wand.
755 % o pattern: Specifies a pointer to a text string containing a pattern.
757 % o number_profiles: the number profiles associated with this wand.
760 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
761 size_t *number_profiles)
775 assert(wand != (MagickWand *) NULL);
776 assert(wand->signature == MagickWandSignature);
777 if (wand->debug != MagickFalse)
778 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
780 if (wand->images == (Image *) NULL)
782 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
783 "ContainsNoImages","`%s'",wand->name);
784 return((char **) NULL);
786 (void) GetImageProfile(wand->images,"exif:*");
788 profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
789 if (profiles == (char **) NULL)
790 return((char **) NULL);
791 ResetImageProfileIterator(wand->images);
792 property=GetNextImageProfile(wand->images);
793 for (i=0; property != (const char *) NULL; )
795 if ((*property != '[') &&
796 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
798 if ((i+1) >= (ssize_t) length)
801 profiles=(char **) ResizeQuantumMemory(profiles,length,
803 if (profiles == (char **) NULL)
805 (void) ThrowMagickException(wand->exception,GetMagickModule(),
806 ResourceLimitError,"MemoryAllocationFailed","`%s'",
808 return((char **) NULL);
811 profiles[i]=ConstantString(property);
814 property=GetNextImageProfile(wand->images);
816 profiles[i]=(char *) NULL;
817 *number_profiles=(size_t) i;
822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
826 % M a g i c k G e t I m a g e P r o p e r t y %
830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
832 % MagickGetImageProperty() returns a value associated with the specified
833 % property. Use MagickRelinquishMemory() to free the value when you are
836 % The format of the MagickGetImageProperty method is:
838 % char *MagickGetImageProperty(MagickWand *wand,const char *property)
840 % A description of each parameter follows:
842 % o wand: the magick wand.
844 % o property: the property.
847 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
852 assert(wand != (MagickWand *) NULL);
853 assert(wand->signature == MagickWandSignature);
854 if (wand->debug != MagickFalse)
855 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
857 if (wand->images == (Image *) NULL)
859 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
860 "ContainsNoImages","`%s'",wand->name);
861 return((char *) NULL);
863 value=GetImageProperty(wand->images,property,wand->exception);
864 if (value == (const char *) NULL)
865 return((char *) NULL);
866 return(ConstantString(value));
870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
874 % M a g i c k G e t I m a g e P r o p e r t i e s %
878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
880 % MagickGetImageProperties() returns all the property names that match the
881 % specified pattern associated with a wand. Use MagickGetImageProperty() to
882 % return the value of a particular property. Use MagickRelinquishMemory() to
883 % free the value when you are finished with it.
885 % The format of the MagickGetImageProperties method is:
887 % char *MagickGetImageProperties(MagickWand *wand,
888 % const char *pattern,size_t *number_properties)
890 % A description of each parameter follows:
892 % o wand: the magick wand.
894 % o pattern: Specifies a pointer to a text string containing a pattern.
896 % o number_properties: the number properties associated with this wand.
899 WandExport char **MagickGetImageProperties(MagickWand *wand,
900 const char *pattern,size_t *number_properties)
914 assert(wand != (MagickWand *) NULL);
915 assert(wand->signature == MagickWandSignature);
916 if (wand->debug != MagickFalse)
917 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
919 if (wand->images == (Image *) NULL)
921 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
922 "ContainsNoImages","`%s'",wand->name);
923 return((char **) NULL);
925 (void) GetImageProperty(wand->images,"exif:*",wand->exception);
927 properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
928 if (properties == (char **) NULL)
929 return((char **) NULL);
930 ResetImagePropertyIterator(wand->images);
931 property=GetNextImageProperty(wand->images);
932 for (i=0; property != (const char *) NULL; )
934 if ((*property != '[') &&
935 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
937 if ((i+1) >= (ssize_t) length)
940 properties=(char **) ResizeQuantumMemory(properties,length,
941 sizeof(*properties));
942 if (properties == (char **) NULL)
944 (void) ThrowMagickException(wand->exception,GetMagickModule(),
945 ResourceLimitError,"MemoryAllocationFailed","`%s'",
947 return((char **) NULL);
950 properties[i]=ConstantString(property);
953 property=GetNextImageProperty(wand->images);
955 properties[i]=(char *) NULL;
956 *number_properties=(size_t) i;
961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
965 % M a g i c k G e t I n t e r l a c e S c h e m e %
969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
971 % MagickGetInterlaceScheme() gets the wand interlace scheme.
973 % The format of the MagickGetInterlaceScheme method is:
975 % InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
977 % A description of each parameter follows:
979 % o wand: the magick wand.
982 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
984 assert(wand != (MagickWand *) NULL);
985 assert(wand->signature == MagickWandSignature);
986 if (wand->debug != MagickFalse)
987 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
989 return(wand->image_info->interlace);
993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
997 % 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 %
1001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1003 % MagickGetInterpolateMethod() gets the wand compression.
1005 % The format of the MagickGetInterpolateMethod method is:
1007 % PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
1009 % A description of each parameter follows:
1011 % o wand: the magick wand.
1014 WandExport PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
1019 PixelInterpolateMethod
1022 assert(wand != (MagickWand *) NULL);
1023 assert(wand->signature == MagickWandSignature);
1024 if (wand->debug != MagickFalse)
1025 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1027 option=GetImageOption(wand->image_info,"interpolate");
1028 if (option == (const char *) NULL)
1029 return(UndefinedInterpolatePixel);
1030 method=(PixelInterpolateMethod) ParseCommandOption(MagickInterpolateOptions,
1031 MagickFalse,option);
1036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1040 % M a g i c k G e t O p t i o n %
1044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1046 % MagickGetOption() returns a value associated with a wand and the specified
1047 % key. Use MagickRelinquishMemory() to free the value when you are finished
1050 % The format of the MagickGetOption method is:
1052 % char *MagickGetOption(MagickWand *wand,const char *key)
1054 % A description of each parameter follows:
1056 % o wand: the magick wand.
1061 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
1066 assert(wand != (MagickWand *) NULL);
1067 assert(wand->signature == MagickWandSignature);
1068 if (wand->debug != MagickFalse)
1069 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1071 option=GetImageOption(wand->image_info,key);
1072 return(ConstantString(option));
1076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1080 % M a g i c k G e t O p t i o n s %
1084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1086 % MagickGetOptions() returns all the option names that match the specified
1087 % pattern associated with a wand. Use MagickGetOption() to return the value
1088 % of a particular option. Use MagickRelinquishMemory() to free the value
1089 % when you are finished with it.
1091 % The format of the MagickGetOptions method is:
1093 % char *MagickGetOptions(MagickWand *wand,const char *pattern,
1094 % size_t *number_options)
1096 % A description of each parameter follows:
1098 % o wand: the magick wand.
1100 % o pattern: Specifies a pointer to a text string containing a pattern.
1102 % o number_options: the number options associated with this wand.
1105 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
1106 size_t *number_options)
1120 assert(wand != (MagickWand *) NULL);
1121 assert(wand->signature == MagickWandSignature);
1122 if (wand->debug != MagickFalse)
1123 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1125 if (wand->images == (Image *) NULL)
1127 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1128 "ContainsNoImages","`%s'",wand->name);
1129 return((char **) NULL);
1132 options=(char **) AcquireQuantumMemory(length,sizeof(*options));
1133 if (options == (char **) NULL)
1134 return((char **) NULL);
1135 ResetImageOptionIterator(wand->image_info);
1136 option=GetNextImageOption(wand->image_info);
1137 for (i=0; option != (const char *) NULL; )
1139 if ((*option != '[') &&
1140 (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
1142 if ((i+1) >= (ssize_t) length)
1145 options=(char **) ResizeQuantumMemory(options,length,
1147 if (options == (char **) NULL)
1149 (void) ThrowMagickException(wand->exception,GetMagickModule(),
1150 ResourceLimitError,"MemoryAllocationFailed","`%s'",
1152 return((char **) NULL);
1155 options[i]=ConstantString(option);
1158 option=GetNextImageOption(wand->image_info);
1160 options[i]=(char *) NULL;
1161 *number_options=(size_t) i;
1166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1170 % M a g i c k G e t O r i e n t a t i o n %
1174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1176 % MagickGetOrientation() gets the wand orientation type.
1178 % The format of the MagickGetOrientation method is:
1180 % OrientationType MagickGetOrientation(MagickWand *wand)
1182 % A description of each parameter follows:
1184 % o wand: the magick wand.
1187 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
1189 assert(wand != (MagickWand *) NULL);
1190 assert(wand->signature == MagickWandSignature);
1191 if (wand->debug != MagickFalse)
1192 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1194 return(wand->image_info->orientation);
1198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1202 % M a g i c k G e t P a c k a g e N a m e %
1206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1208 % MagickGetPackageName() returns the ImageMagick package name as a string
1211 % The format of the MagickGetPackageName method is:
1213 % const char *MagickGetPackageName(void)
1217 WandExport const char *MagickGetPackageName(void)
1219 return(GetMagickPackageName());
1223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1227 % M a g i c k G e t P a g e %
1231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1233 % MagickGetPage() returns the page geometry associated with the magick wand.
1235 % The format of the MagickGetPage method is:
1237 % MagickBooleanType MagickGetPage(const MagickWand *wand,
1238 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1240 % A description of each parameter follows:
1242 % o wand: the magick wand.
1244 % o width: the page width.
1246 % o height: page height.
1248 % o x: the page x-offset.
1250 % o y: the page y-offset.
1253 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
1254 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1259 assert(wand != (const MagickWand *) NULL);
1260 assert(wand->signature == MagickWandSignature);
1261 if (wand->debug != MagickFalse)
1262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1264 (void) memset(&geometry,0,sizeof(geometry));
1265 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1266 *width=geometry.width;
1267 *height=geometry.height;
1274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1278 % M a g i c k G e t P o i n t s i z e %
1282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1284 % MagickGetPointsize() returns the font pointsize associated with the
1287 % The format of the MagickGetPointsize method is:
1289 % double MagickGetPointsize(MagickWand *wand)
1291 % A description of each parameter follows:
1293 % o wand: the magick wand.
1296 WandExport double MagickGetPointsize(MagickWand *wand)
1298 assert(wand != (MagickWand *) NULL);
1299 assert(wand->signature == MagickWandSignature);
1300 if (wand->debug != MagickFalse)
1301 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1303 return(wand->image_info->pointsize);
1307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1311 % M a g i c k G e t Q u a n t u m D e p t h %
1315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1317 % MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
1320 % The format of the MagickGetQuantumDepth method is:
1322 % const char *MagickGetQuantumDepth(size_t *depth)
1324 % A description of each parameter follows:
1326 % o depth: the quantum depth is returned as a number.
1329 WandExport const char *MagickGetQuantumDepth(size_t *depth)
1331 return(GetMagickQuantumDepth(depth));
1335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1339 % M a g i c k G e t Q u a n t u m R a n g e %
1343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1345 % MagickGetQuantumRange() returns the ImageMagick quantum range as a string
1348 % The format of the MagickGetQuantumRange method is:
1350 % const char *MagickGetQuantumRange(size_t *range)
1352 % A description of each parameter follows:
1354 % o range: the quantum range is returned as a number.
1357 WandExport const char *MagickGetQuantumRange(size_t *range)
1359 return(GetMagickQuantumRange(range));
1363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1367 % M a g i c k G e t R e l e a s e D a t e %
1371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1373 % MagickGetReleaseDate() returns the ImageMagick release date as a string
1376 % The format of the MagickGetReleaseDate method is:
1378 % const char *MagickGetReleaseDate(void)
1381 WandExport const char *MagickGetReleaseDate(void)
1383 return(GetMagickReleaseDate());
1387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1391 % M a g i c k G e t R e s o l u t i o n %
1395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1397 % MagickGetResolution() gets the image X and Y resolution.
1399 % The format of the MagickGetResolution method is:
1401 % MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
1404 % A description of each parameter follows:
1406 % o wand: the magick wand.
1408 % o x: the x-resolution.
1410 % o y: the y-resolution.
1413 WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
1414 double *x,double *y)
1416 assert(wand != (MagickWand *) NULL);
1417 assert(wand->signature == MagickWandSignature);
1418 if (wand->debug != MagickFalse)
1419 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1423 if (wand->image_info->density != (char *) NULL)
1431 flags=ParseGeometry(wand->image_info->density,&geometry_info);
1432 *x=geometry_info.rho;
1433 *y=geometry_info.sigma;
1434 if ((flags & SigmaValue) == 0)
1441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1445 % M a g i c k G e t R e s o u r c e %
1449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1451 % MagickGetResource() returns the specified resource in megabytes.
1453 % The format of the MagickGetResource method is:
1455 % MagickSizeType MagickGetResource(const ResourceType type)
1457 % A description of each parameter follows:
1459 % o wand: the magick wand.
1462 WandExport MagickSizeType MagickGetResource(const ResourceType type)
1464 return(GetMagickResource(type));
1468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1472 % M a g i c k G e t R e s o u r c e L i m i t %
1476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1478 % MagickGetResourceLimit() returns the specified resource limit in megabytes.
1480 % The format of the MagickGetResourceLimit method is:
1482 % MagickSizeType MagickGetResourceLimit(const ResourceType type)
1484 % A description of each parameter follows:
1486 % o wand: the magick wand.
1489 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
1491 return(GetMagickResourceLimit(type));
1495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1499 % M a g i c k G e t S a m p l i n g F a c t o r s %
1503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1505 % MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
1507 % The format of the MagickGetSamplingFactors method is:
1509 % double *MagickGetSamplingFactor(MagickWand *wand,
1510 % size_t *number_factors)
1512 % A description of each parameter follows:
1514 % o wand: the magick wand.
1516 % o number_factors: the number of factors in the returned array.
1519 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
1520 size_t *number_factors)
1531 assert(wand != (MagickWand *) NULL);
1532 assert(wand->signature == MagickWandSignature);
1533 if (wand->debug != MagickFalse)
1534 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1537 sampling_factors=(double *) NULL;
1538 if (wand->image_info->sampling_factor == (char *) NULL)
1539 return(sampling_factors);
1541 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1543 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1548 sampling_factors=(double *) AcquireQuantumMemory((size_t) i+1,
1549 sizeof(*sampling_factors));
1550 if (sampling_factors == (double *) NULL)
1551 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
1552 wand->image_info->filename);
1554 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1556 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1559 sampling_factors[i]=StringToDouble(p,(char **) NULL);
1562 *number_factors=(size_t) i;
1563 return(sampling_factors);
1567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1571 % M a g i c k G e t S i z e %
1575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1577 % MagickGetSize() returns the size associated with the magick wand.
1579 % The format of the MagickGetSize method is:
1581 % MagickBooleanType MagickGetSize(const MagickWand *wand,
1582 % size_t *columns,size_t *rows)
1584 % A description of each parameter follows:
1586 % o wand: the magick wand.
1588 % o columns: the width in pixels.
1590 % o height: the height in pixels.
1593 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
1594 size_t *columns,size_t *rows)
1599 assert(wand != (const MagickWand *) NULL);
1600 assert(wand->signature == MagickWandSignature);
1601 if (wand->debug != MagickFalse)
1602 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1604 (void) memset(&geometry,0,sizeof(geometry));
1605 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1606 *columns=geometry.width;
1607 *rows=geometry.height;
1612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1616 % M a g i c k G e t S i z e O f f s e t %
1620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1622 % MagickGetSizeOffset() returns the size offset associated with the magick
1625 % The format of the MagickGetSizeOffset method is:
1627 % MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1630 % A description of each parameter follows:
1632 % o wand: the magick wand.
1634 % o offset: the image offset.
1637 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1643 assert(wand != (const MagickWand *) NULL);
1644 assert(wand->signature == MagickWandSignature);
1645 if (wand->debug != MagickFalse)
1646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1648 (void) memset(&geometry,0,sizeof(geometry));
1649 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1659 % M a g i c k G e t T y p e %
1663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1665 % MagickGetType() returns the wand type.
1667 % The format of the MagickGetType method is:
1669 % ImageType MagickGetType(MagickWand *wand)
1671 % A description of each parameter follows:
1673 % o wand: the magick wand.
1676 WandExport ImageType MagickGetType(MagickWand *wand)
1678 assert(wand != (MagickWand *) NULL);
1679 assert(wand->signature == MagickWandSignature);
1680 if (wand->debug != MagickFalse)
1681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1683 return(wand->image_info->type);
1687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1691 % M a g i c k G e t V e r s i o n %
1695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1697 % MagickGetVersion() returns the ImageMagick API version as a string constant
1700 % The format of the MagickGetVersion method is:
1702 % const char *MagickGetVersion(size_t *version)
1704 % A description of each parameter follows:
1706 % o version: the ImageMagick version is returned as a number.
1709 WandExport const char *MagickGetVersion(size_t *version)
1711 return(GetMagickVersion(version));
1715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1719 % M a g i c k P r o f i l e I m a g e %
1723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1725 % MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
1726 % from an image. If the profile is NULL, it is removed from the image
1727 % otherwise added. Use a name of '*' and a profile of NULL to remove all
1728 % profiles from the image.
1730 % The format of the MagickProfileImage method is:
1732 % MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
1733 % const void *profile,const size_t length)
1735 % A description of each parameter follows:
1737 % o wand: the magick wand.
1739 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
1741 % o profile: the profile.
1743 % o length: the length of the profile.
1746 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
1747 const char *name,const void *profile,const size_t length)
1749 assert(wand != (MagickWand *) NULL);
1750 assert(wand->signature == MagickWandSignature);
1751 if (wand->debug != MagickFalse)
1752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1754 if (wand->images == (Image *) NULL)
1755 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1756 return(ProfileImage(wand->images,name,profile,length,wand->exception));
1760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1764 % M a g i c k R e m o v e I m a g e P r o f i l e %
1768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1770 % MagickRemoveImageProfile() removes the named image profile and returns it.
1772 % The format of the MagickRemoveImageProfile method is:
1774 % unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1775 % const char *name,size_t *length)
1777 % A description of each parameter follows:
1779 % o wand: the magick wand.
1781 % o name: Name of profile to return: ICC, IPTC, or generic profile.
1783 % o length: the length of the profile.
1786 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1787 const char *name,size_t *length)
1795 assert(wand != (MagickWand *) NULL);
1796 assert(wand->signature == MagickWandSignature);
1797 if (wand->debug != MagickFalse)
1798 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1800 if (wand->images == (Image *) NULL)
1802 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1803 "ContainsNoImages","`%s'",wand->name);
1804 return((unsigned char *) NULL);
1807 profile=RemoveImageProfile(wand->images,name);
1808 if (profile == (StringInfo *) NULL)
1809 return((unsigned char *) NULL);
1810 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1812 if (datum == (unsigned char *) NULL)
1813 return((unsigned char *) NULL);
1814 (void) memcpy(datum,GetStringInfoDatum(profile),
1815 GetStringInfoLength(profile));
1816 *length=GetStringInfoLength(profile);
1817 profile=DestroyStringInfo(profile);
1822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1826 % M a g i c k S e t A n t i a l i a s %
1830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1832 % MagickSetAntialias() sets the antialias propery of the wand.
1834 % The format of the MagickSetAntialias method is:
1836 % MagickBooleanType MagickSetAntialias(MagickWand *wand,
1837 % const MagickBooleanType antialias)
1839 % A description of each parameter follows:
1841 % o wand: the magick wand.
1843 % o antialias: the antialias property.
1846 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
1847 const MagickBooleanType antialias)
1849 assert(wand != (MagickWand *) NULL);
1850 assert(wand->signature == MagickWandSignature);
1851 if (wand->debug != MagickFalse)
1852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1854 wand->image_info->antialias=antialias;
1859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1863 % M a g i c k S e t B a c k g r o u n d C o l o r %
1867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1869 % MagickSetBackgroundColor() sets the wand background color.
1871 % The format of the MagickSetBackgroundColor method is:
1873 % MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1874 % const PixelWand *background)
1876 % A description of each parameter follows:
1878 % o wand: the magick wand.
1880 % o background: the background pixel wand.
1883 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1884 const PixelWand *background)
1886 assert(wand != (MagickWand *) NULL);
1887 assert(wand->signature == MagickWandSignature);
1888 if (wand->debug != MagickFalse)
1889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1891 PixelGetQuantumPacket(background,&wand->image_info->background_color);
1896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1900 % M a g i c k S e t C o l o r s p a c e %
1904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1906 % MagickSetColorspace() sets the wand colorspace type.
1908 % The format of the MagickSetColorspace method is:
1910 % MagickBooleanType MagickSetColorspace(MagickWand *wand,
1911 % const ColorspaceType colorspace)
1913 % A description of each parameter follows:
1915 % o wand: the magick wand.
1917 % o colorspace: the wand colorspace.
1920 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
1921 const ColorspaceType colorspace)
1923 assert(wand != (MagickWand *) NULL);
1924 assert(wand->signature == MagickWandSignature);
1925 if (wand->debug != MagickFalse)
1926 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1928 wand->image_info->colorspace=colorspace;
1933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1937 % M a g i c k S e t C o m p r e s s i o n %
1941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1943 % MagickSetCompression() sets the wand compression type.
1945 % The format of the MagickSetCompression method is:
1947 % MagickBooleanType MagickSetCompression(MagickWand *wand,
1948 % const CompressionType compression)
1950 % A description of each parameter follows:
1952 % o wand: the magick wand.
1954 % o compression: the wand compression.
1957 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
1958 const CompressionType compression)
1960 assert(wand != (MagickWand *) NULL);
1961 assert(wand->signature == MagickWandSignature);
1962 if (wand->debug != MagickFalse)
1963 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1965 wand->image_info->compression=compression;
1970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1974 % 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 %
1978 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1980 % MagickSetCompressionQuality() sets the wand compression quality.
1982 % The format of the MagickSetCompressionQuality method is:
1984 % MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1985 % const size_t quality)
1987 % A description of each parameter follows:
1989 % o wand: the magick wand.
1991 % o quality: the wand compression quality.
1994 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1995 const size_t quality)
1997 assert(wand != (MagickWand *) NULL);
1998 assert(wand->signature == MagickWandSignature);
1999 if (wand->debug != MagickFalse)
2000 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2002 wand->image_info->quality=quality;
2007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2011 % M a g i c k S e t D e p t h %
2015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2017 % MagickSetDepth() sets the wand pixel depth.
2019 % The format of the MagickSetDepth method is:
2021 % MagickBooleanType MagickSetDepth(MagickWand *wand,
2022 % const size_t depth)
2024 % A description of each parameter follows:
2026 % o wand: the magick wand.
2028 % o depth: the wand pixel depth.
2031 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
2034 assert(wand != (MagickWand *) NULL);
2035 assert(wand->signature == MagickWandSignature);
2036 if (wand->debug != MagickFalse)
2037 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2039 wand->image_info->depth=depth;
2044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2048 % M a g i c k S e t E x t r a c t %
2052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2054 % MagickSetExtract() sets the extract geometry before you read or write an
2055 % image file. Use it for inline cropping (e.g. 200x200+0+0) or resizing
2058 % The format of the MagickSetExtract method is:
2060 % MagickBooleanType MagickSetExtract(MagickWand *wand,
2061 % const char *geometry)
2063 % A description of each parameter follows:
2065 % o wand: the magick wand.
2067 % o geometry: the extract geometry.
2070 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
2071 const char *geometry)
2073 assert(wand != (MagickWand *) NULL);
2074 assert(wand->signature == MagickWandSignature);
2075 if (wand->debug != MagickFalse)
2076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2077 if (wand->image_info->extract != (char *) NULL)
2078 wand->image_info->extract=DestroyString(wand->image_info->extract);
2079 if (geometry != (const char *) NULL)
2080 (void) CloneString(&wand->image_info->extract,geometry);
2085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2089 % M a g i c k S e t F i l e n a m e %
2093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2095 % MagickSetFilename() sets the filename before you read or write an image file.
2097 % The format of the MagickSetFilename method is:
2099 % MagickBooleanType MagickSetFilename(MagickWand *wand,
2100 % const char *filename)
2102 % A description of each parameter follows:
2104 % o wand: the magick wand.
2106 % o filename: the image filename.
2109 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
2110 const char *filename)
2112 assert(wand != (MagickWand *) NULL);
2113 assert(wand->signature == MagickWandSignature);
2114 if (wand->debug != MagickFalse)
2115 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2117 if (filename != (const char *) NULL)
2118 (void) CopyMagickString(wand->image_info->filename,filename,MagickPathExtent);
2123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2127 % M a g i c k S e t F o n t %
2131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2133 % MagickSetFont() sets the font associated with the MagickWand.
2135 % The format of the MagickSetFont method is:
2137 % MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
2139 % A description of each parameter follows:
2141 % o wand: the magick wand.
2146 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
2148 if ((font == (const char *) NULL) || (*font == '\0'))
2149 return(MagickFalse);
2150 assert(wand != (MagickWand *) NULL);
2151 assert(wand->signature == MagickWandSignature);
2152 if (wand->debug != MagickFalse)
2153 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2155 (void) CloneString(&wand->image_info->font,font);
2160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2164 % M a g i c k S e t F o r m a t %
2168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2170 % MagickSetFormat() sets the format of the magick wand.
2172 % The format of the MagickSetFormat method is:
2174 % MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
2176 % A description of each parameter follows:
2178 % o wand: the magick wand.
2180 % o format: the image format.
2183 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
2189 assert(wand != (MagickWand *) NULL);
2190 assert(wand->signature == MagickWandSignature);
2191 if (wand->debug != MagickFalse)
2192 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2194 if ((format == (char *) NULL) || (*format == '\0'))
2196 *wand->image_info->magick='\0';
2199 magick_info=GetMagickInfo(format,wand->exception);
2200 if (magick_info == (const MagickInfo *) NULL)
2201 return(MagickFalse);
2202 ClearMagickException(wand->exception);
2203 (void) CopyMagickString(wand->image_info->magick,format,MagickPathExtent);
2208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2212 % M a g i c k S e t G r a v i t y %
2216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2218 % MagickSetGravity() sets the gravity type.
2220 % The format of the MagickSetGravity type is:
2222 % MagickBooleanType MagickSetGravity(MagickWand *wand,
2223 % const GravityType type)
2225 % A description of each parameter follows:
2227 % o wand: the magick wand.
2229 % o type: the gravity type.
2232 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
2233 const GravityType type)
2238 assert(wand != (MagickWand *) NULL);
2239 assert(wand->signature == MagickWandSignature);
2240 if (wand->debug != MagickFalse)
2241 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2243 status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
2244 MagickGravityOptions,(ssize_t) type));
2249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2253 % M a g i c k S e t I m a g e A r t i f r c t %
2257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2259 % MagickSetImageArtifact() associates a artifact with an image.
2261 % The format of the MagickSetImageArtifact method is:
2263 % MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2264 % const char *artifact,const char *value)
2266 % A description of each parameter follows:
2268 % o wand: the magick wand.
2270 % o artifact: the artifact.
2272 % o value: the value.
2275 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2276 const char *artifact,const char *value)
2278 assert(wand != (MagickWand *) NULL);
2279 assert(wand->signature == MagickWandSignature);
2280 if (wand->debug != MagickFalse)
2281 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2283 if (wand->images == (Image *) NULL)
2284 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2285 return(SetImageArtifact(wand->images,artifact,value));
2289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2293 % M a g i c k S e t P r o f i l e I m a g e %
2297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2299 % MagickSetImageProfile() adds a named profile to the magick wand. If a
2300 % profile with the same name already exists, it is replaced. This method
2301 % differs from the MagickProfileImage() method in that it does not apply any
2302 % CMS color profiles.
2304 % The format of the MagickSetImageProfile method is:
2306 % MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2307 % const char *name,const void *profile,const size_t length)
2309 % A description of each parameter follows:
2311 % o wand: the magick wand.
2313 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
2315 % o profile: the profile.
2317 % o length: the length of the profile.
2320 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2321 const char *name,const void *profile,const size_t length)
2329 assert(wand != (MagickWand *) NULL);
2330 assert(wand->signature == MagickWandSignature);
2331 if (wand->debug != MagickFalse)
2332 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2334 if (wand->images == (Image *) NULL)
2335 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2336 profile_info=AcquireStringInfo((size_t) length);
2337 SetStringInfoDatum(profile_info,(unsigned char *) profile);
2338 status=SetImageProfile(wand->images,name,profile_info,wand->exception);
2339 profile_info=DestroyStringInfo(profile_info);
2344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2348 % M a g i c k S e t I m a g e P r o p e r t y %
2352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2354 % MagickSetImageProperty() associates a property with an image.
2356 % The format of the MagickSetImageProperty method is:
2358 % MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2359 % const char *property,const char *value)
2361 % A description of each parameter follows:
2363 % o wand: the magick wand.
2365 % o property: the property.
2367 % o value: the value.
2370 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2371 const char *property,const char *value)
2376 assert(wand != (MagickWand *) NULL);
2377 assert(wand->signature == MagickWandSignature);
2378 if (wand->debug != MagickFalse)
2379 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2381 if (wand->images == (Image *) NULL)
2382 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2383 status=SetImageProperty(wand->images,property,value,wand->exception);
2388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2392 % M a g i c k S e t I n t e r l a c e S c h e m e %
2396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2398 % MagickSetInterlaceScheme() sets the image compression.
2400 % The format of the MagickSetInterlaceScheme method is:
2402 % MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2403 % const InterlaceType interlace_scheme)
2405 % A description of each parameter follows:
2407 % o wand: the magick wand.
2409 % o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
2410 % PlaneInterlace, PartitionInterlace.
2413 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2414 const InterlaceType interlace_scheme)
2416 assert(wand != (MagickWand *) NULL);
2417 assert(wand->signature == MagickWandSignature);
2418 if (wand->debug != MagickFalse)
2419 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2421 wand->image_info->interlace=interlace_scheme;
2426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2430 % 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 %
2434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2436 % MagickSetInterpolateMethod() sets the interpolate pixel method.
2438 % The format of the MagickSetInterpolateMethod method is:
2440 % MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2441 % const InterpolateMethodPixel method)
2443 % A description of each parameter follows:
2445 % o wand: the magick wand.
2447 % o method: the interpolate pixel method.
2450 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2451 const PixelInterpolateMethod method)
2456 assert(wand != (MagickWand *) NULL);
2457 assert(wand->signature == MagickWandSignature);
2458 if (wand->debug != MagickFalse)
2459 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2461 status=SetImageOption(wand->image_info,"interpolate",
2462 CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
2467 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2471 % M a g i c k S e t O p t i o n %
2475 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2477 % MagickSetOption() associates one or options with the wand (.e.g
2478 % MagickSetOption(wand,"jpeg:perserve","yes")).
2480 % The format of the MagickSetOption method is:
2482 % MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2483 % const char *value)
2485 % A description of each parameter follows:
2487 % o wand: the magick wand.
2491 % o value: The value.
2494 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2497 assert(wand != (MagickWand *) NULL);
2498 assert(wand->signature == MagickWandSignature);
2499 if (wand->debug != MagickFalse)
2500 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2502 return(SetImageOption(wand->image_info,key,value));
2506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2510 % M a g i c k S e t O r i e n t a t i o n %
2514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2516 % MagickSetOrientation() sets the wand orientation type.
2518 % The format of the MagickSetOrientation method is:
2520 % MagickBooleanType MagickSetOrientation(MagickWand *wand,
2521 % const OrientationType orientation)
2523 % A description of each parameter follows:
2525 % o wand: the magick wand.
2527 % o orientation: the wand orientation.
2530 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
2531 const OrientationType orientation)
2533 assert(wand != (MagickWand *) NULL);
2534 assert(wand->signature == MagickWandSignature);
2535 if (wand->debug != MagickFalse)
2536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2538 wand->image_info->orientation=orientation;
2543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2547 % M a g i c k S e t P a g e %
2551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2553 % MagickSetPage() sets the page geometry of the magick wand.
2555 % The format of the MagickSetPage method is:
2557 % MagickBooleanType MagickSetPage(MagickWand *wand,
2558 % const size_t width,const size_t height,const ssize_t x,
2561 % A description of each parameter follows:
2563 % o wand: the magick wand.
2565 % o width: the page width.
2567 % o height: the page height.
2569 % o x: the page x-offset.
2571 % o y: the page y-offset.
2574 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
2575 const size_t width,const size_t height,const ssize_t x,
2579 geometry[MagickPathExtent];
2581 assert(wand != (MagickWand *) NULL);
2582 assert(wand->signature == MagickWandSignature);
2583 if (wand->debug != MagickFalse)
2584 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2586 (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g%+.20g",
2587 (double) width,(double) height,(double) x,(double) y);
2588 (void) CloneString(&wand->image_info->page,geometry);
2593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2597 % M a g i c k S e t P a s s p h r a s e %
2601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2603 % MagickSetPassphrase() sets the passphrase.
2605 % The format of the MagickSetPassphrase method is:
2607 % MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2608 % const char *passphrase)
2610 % A description of each parameter follows:
2612 % o wand: the magick wand.
2614 % o passphrase: the passphrase.
2617 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2618 const char *passphrase)
2620 assert(wand != (MagickWand *) NULL);
2621 assert(wand->signature == MagickWandSignature);
2622 if (wand->debug != MagickFalse)
2623 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2625 (void) SetImageOption(wand->image_info,"authenticate",passphrase);
2630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2634 % M a g i c k S e t P o i n t s i z e %
2638 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2640 % MagickSetPointsize() sets the font pointsize associated with the MagickWand.
2642 % The format of the MagickSetPointsize method is:
2644 % MagickBooleanType MagickSetPointsize(MagickWand *wand,
2645 % const double pointsize)
2647 % A description of each parameter follows:
2649 % o wand: the magick wand.
2651 % o pointsize: the size of the font
2654 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
2655 const double pointsize)
2657 assert(wand != (MagickWand *) NULL);
2658 assert(wand->signature == MagickWandSignature);
2659 if (wand->debug != MagickFalse)
2660 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2662 wand->image_info->pointsize=pointsize;
2667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2671 % M a g i c k S e t P r o g r e s s M o n i t o r %
2675 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2677 % MagickSetProgressMonitor() sets the wand progress monitor to the specified
2678 % method and returns the previous progress monitor if any. The progress
2679 % monitor method looks like this:
2681 % MagickBooleanType MagickProgressMonitor(const char *text,
2682 % const MagickOffsetType offset,const MagickSizeType span,
2683 % void *client_data)
2685 % If the progress monitor returns MagickFalse, the current operation is
2688 % The format of the MagickSetProgressMonitor method is:
2690 % MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
2691 % const MagickProgressMonitor progress_monitor,void *client_data)
2693 % A description of each parameter follows:
2695 % o wand: the magick wand.
2697 % o progress_monitor: Specifies a pointer to a method to monitor progress
2698 % of an image operation.
2700 % o client_data: Specifies a pointer to any client data.
2703 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
2704 const MagickProgressMonitor progress_monitor,void *client_data)
2706 MagickProgressMonitor
2709 assert(wand != (MagickWand *) NULL);
2710 assert(wand->signature == MagickWandSignature);
2711 if (wand->debug != MagickFalse)
2712 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2714 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2715 progress_monitor,client_data);
2716 return(previous_monitor);
2720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2724 % M a g i c k S e t R e s o u r c e L i m i t %
2728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2730 % MagickSetResourceLimit() sets the limit for a particular resource in
2733 % The format of the MagickSetResourceLimit method is:
2735 % MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2736 % const MagickSizeType limit)
2738 % A description of each parameter follows:
2740 % o type: the type of resource: AreaResource, MemoryResource, MapResource,
2741 % DiskResource, FileResource.
2743 % o The maximum limit for the resource.
2746 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2747 const MagickSizeType limit)
2749 return(SetMagickResourceLimit(type,limit));
2753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2757 % M a g i c k S e t R e s o l u t i o n %
2761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2763 % MagickSetResolution() sets the image resolution.
2765 % The format of the MagickSetResolution method is:
2767 % MagickBooleanType MagickSetResolution(MagickWand *wand,
2768 % const double x_resolution,const double y_resolution)
2770 % A description of each parameter follows:
2772 % o wand: the magick wand.
2774 % o x_resolution: the image x resolution.
2776 % o y_resolution: the image y resolution.
2779 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
2780 const double x_resolution,const double y_resolution)
2783 density[MagickPathExtent];
2785 assert(wand != (MagickWand *) NULL);
2786 assert(wand->signature == MagickWandSignature);
2787 if (wand->debug != MagickFalse)
2788 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2790 (void) FormatLocaleString(density,MagickPathExtent,"%gx%g",x_resolution,
2792 (void) CloneString(&wand->image_info->density,density);
2797 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2801 % M a g i c k S e t S a m p l i n g F a c t o r s %
2805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2807 % MagickSetSamplingFactors() sets the image sampling factors.
2809 % The format of the MagickSetSamplingFactors method is:
2811 % MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2812 % const size_t number_factors,const double *sampling_factors)
2814 % A description of each parameter follows:
2816 % o wand: the magick wand.
2818 % o number_factoes: the number of factors.
2820 % o sampling_factors: An array of doubles representing the sampling factor
2821 % for each color component (in RGB order).
2824 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2825 const size_t number_factors,const double *sampling_factors)
2828 sampling_factor[MagickPathExtent];
2833 assert(wand != (MagickWand *) NULL);
2834 assert(wand->signature == MagickWandSignature);
2835 if (wand->debug != MagickFalse)
2836 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2838 if (wand->image_info->sampling_factor != (char *) NULL)
2839 wand->image_info->sampling_factor=(char *)
2840 RelinquishMagickMemory(wand->image_info->sampling_factor);
2841 if (number_factors == 0)
2843 for (i=0; i < (ssize_t) (number_factors-1); i++)
2845 (void) FormatLocaleString(sampling_factor,MagickPathExtent,"%g,",
2846 sampling_factors[i]);
2847 (void) ConcatenateString(&wand->image_info->sampling_factor,
2850 (void) FormatLocaleString(sampling_factor,MagickPathExtent,"%g",
2851 sampling_factors[i]);
2852 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2861 % M a g i c k S e t S e c u r i t y P o l i c y %
2865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2867 % MagickSetSecurityPolicy() sets the ImageMagick security policy. It returns
2868 % MagickFalse if the policy is already set or if the policy does not parse.
2870 % The format of the MagickSetAntialias method is:
2872 % MagickBooleanType MagickSetAntialias(MagickWand *wand,
2873 % const char *policy)
2875 % A description of each parameter follows:
2877 % o wand: the magick wand.
2879 % o policy: the security policy in the XML format.
2882 WandExport MagickBooleanType MagickSetSecurityPolicy(MagickWand *wand,
2885 assert(wand != (MagickWand *) NULL);
2886 assert(wand->signature == MagickWandSignature);
2887 if (wand->debug != MagickFalse)
2888 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2890 return(SetMagickSecurityPolicy(policy,wand->exception));
2894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2898 % M a g i c k S e t S i z e %
2902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2904 % MagickSetSize() sets the size of the magick wand. Set it before you
2905 % read a raw image format such as RGB, GRAY, or CMYK.
2907 % The format of the MagickSetSize method is:
2909 % MagickBooleanType MagickSetSize(MagickWand *wand,
2910 % const size_t columns,const size_t rows)
2912 % A description of each parameter follows:
2914 % o wand: the magick wand.
2916 % o columns: the width in pixels.
2918 % o rows: the rows in pixels.
2921 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
2922 const size_t columns,const size_t rows)
2925 geometry[MagickPathExtent];
2927 assert(wand != (MagickWand *) NULL);
2928 assert(wand->signature == MagickWandSignature);
2929 if (wand->debug != MagickFalse)
2930 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2932 (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g",(double)
2933 columns,(double) rows);
2934 (void) CloneString(&wand->image_info->size,geometry);
2939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2943 % M a g i c k S e t S i z e O f f s e t %
2947 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2949 % MagickSetSizeOffset() sets the size and offset of the magick wand. Set it
2950 % before you read a raw image format such as RGB, GRAY, or CMYK.
2952 % The format of the MagickSetSizeOffset method is:
2954 % MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2955 % const size_t columns,const size_t rows,
2956 % const ssize_t offset)
2958 % A description of each parameter follows:
2960 % o wand: the magick wand.
2962 % o columns: the image width in pixels.
2964 % o rows: the image rows in pixels.
2966 % o offset: the image offset.
2969 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2970 const size_t columns,const size_t rows,const ssize_t offset)
2973 geometry[MagickPathExtent];
2975 assert(wand != (MagickWand *) NULL);
2976 assert(wand->signature == MagickWandSignature);
2977 if (wand->debug != MagickFalse)
2978 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2980 (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g",
2981 (double) columns,(double) rows,(double) offset);
2982 (void) CloneString(&wand->image_info->size,geometry);
2987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2991 % M a g i c k S e t T y p e %
2995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2997 % MagickSetType() sets the image type attribute.
2999 % The format of the MagickSetType method is:
3001 % MagickBooleanType MagickSetType(MagickWand *wand,
3002 % const ImageType image_type)
3004 % A description of each parameter follows:
3006 % o wand: the magick wand.
3008 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
3009 % GrayscaleAlphaType, PaletteType, PaletteAlphaType, TrueColorType,
3010 % TrueColorAlphaType, ColorSeparationType, ColorSeparationAlphaType,
3014 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
3015 const ImageType image_type)
3017 assert(wand != (MagickWand *) NULL);
3018 assert(wand->signature == MagickWandSignature);
3019 if (wand->debug != MagickFalse)
3020 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3022 wand->image_info->type=image_type;