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-2012 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 "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"
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( IfMagickTrue(wand->debug) )
96 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
98 if (wand->images == (Image *) NULL)
100 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
101 "ContainsNoImages","'%s'",wand->name);
104 return(DeleteImageArtifact(wand->images,artifact));
108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112 % 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 %
116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118 % MagickDeleteImageProperty() deletes a wand property.
120 % The format of the MagickDeleteImageProperty method is:
122 % MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
123 % const char *property)
125 % A description of each parameter follows:
127 % o image: the image.
129 % o property: the image property.
132 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
133 const char *property)
135 assert(wand != (MagickWand *) NULL);
136 assert(wand->signature == WandSignature);
137 if( IfMagickTrue(wand->debug) )
138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
140 if (wand->images == (Image *) NULL)
142 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
143 "ContainsNoImages","'%s'",wand->name);
146 return(DeleteImageProperty(wand->images,property));
150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 % M a g i c k D e l e t e O p t i o n %
158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160 % MagickDeleteOption() deletes a wand option.
162 % The format of the MagickDeleteOption method is:
164 % MagickBooleanType MagickDeleteOption(MagickWand *wand,
165 % const char *option)
167 % A description of each parameter follows:
169 % o image: the image.
171 % o option: the image option.
174 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
177 assert(wand != (MagickWand *) NULL);
178 assert(wand->signature == WandSignature);
179 if( IfMagickTrue(wand->debug) )
180 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
182 return(DeleteImageOption(wand->image_info,option));
186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190 % M a g i c k G e t A n t i a l i a s %
194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196 % MagickGetAntialias() returns the antialias property associated with the
199 % The format of the MagickGetAntialias method is:
201 % MagickBooleanType MagickGetAntialias(const MagickWand *wand)
203 % A description of each parameter follows:
205 % o wand: the magick wand.
208 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
210 assert(wand != (const MagickWand *) NULL);
211 assert(wand->signature == WandSignature);
212 if( IfMagickTrue(wand->debug) )
213 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
215 return(wand->image_info->antialias);
219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
223 % M a g i c k G e t B a c k g r o u n d C o l o r %
227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
229 % MagickGetBackgroundColor() returns the wand background color.
231 % The format of the MagickGetBackgroundColor method is:
233 % PixelWand *MagickGetBackgroundColor(MagickWand *wand)
235 % A description of each parameter follows:
237 % o wand: the magick wand.
240 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
245 assert(wand != (MagickWand *) NULL);
246 assert(wand->signature == WandSignature);
247 if( IfMagickTrue(wand->debug) )
248 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
250 background_color=NewPixelWand();
251 PixelSetPixelColor(background_color,&wand->image_info->background_color);
252 return(background_color);
256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 % M a g i c k G e t C o l o r s p a c e %
264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 % MagickGetColorspace() gets the wand colorspace type.
268 % The format of the MagickGetColorspace method is:
270 % ColorspaceType MagickGetColorspace(MagickWand *wand)
272 % A description of each parameter follows:
274 % o wand: the magick wand.
277 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
279 assert(wand != (MagickWand *) NULL);
280 assert(wand->signature == WandSignature);
281 if( IfMagickTrue(wand->debug) )
282 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
284 return(wand->image_info->colorspace);
288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
292 % M a g i c k G e t C o m p r e s s i o n %
296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298 % MagickGetCompression() gets the wand compression type.
300 % The format of the MagickGetCompression method is:
302 % CompressionType MagickGetCompression(MagickWand *wand)
304 % A description of each parameter follows:
306 % o wand: the magick wand.
309 WandExport CompressionType MagickGetCompression(MagickWand *wand)
311 assert(wand != (MagickWand *) NULL);
312 assert(wand->signature == WandSignature);
313 if( IfMagickTrue(wand->debug) )
314 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
316 return(wand->image_info->compression);
320 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
324 % 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 %
328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
330 % MagickGetCompressionQuality() gets the wand compression quality.
332 % The format of the MagickGetCompressionQuality method is:
334 % size_t MagickGetCompressionQuality(MagickWand *wand)
336 % A description of each parameter follows:
338 % o wand: the magick wand.
341 WandExport size_t MagickGetCompressionQuality(MagickWand *wand)
343 assert(wand != (MagickWand *) NULL);
344 assert(wand->signature == WandSignature);
345 if( IfMagickTrue(wand->debug) )
346 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
348 return(wand->image_info->quality);
352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
356 % M a g i c k G e t C o p y r i g h t %
360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
362 % MagickGetCopyright() returns the ImageMagick API copyright as a string
365 % The format of the MagickGetCopyright method is:
367 % const char *MagickGetCopyright(void)
370 WandExport const char *MagickGetCopyright(void)
372 return(GetMagickCopyright());
376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
380 % M a g i c k G e t F i l e n a m e %
384 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
386 % MagickGetFilename() returns the filename associated with an image sequence.
388 % The format of the MagickGetFilename method is:
390 % const char *MagickGetFilename(const MagickWand *wand)
392 % A description of each parameter follows:
394 % o wand: the magick wand.
397 WandExport char *MagickGetFilename(const MagickWand *wand)
399 assert(wand != (const MagickWand *) NULL);
400 assert(wand->signature == WandSignature);
401 if( IfMagickTrue(wand->debug) )
402 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
404 return(AcquireString(wand->image_info->filename));
408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
412 % M a g i c k G e t F o n t %
416 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
418 % MagickGetFont() returns the font associated with the MagickWand.
420 % The format of the MagickGetFont method is:
422 % char *MagickGetFont(MagickWand *wand)
424 % A description of each parameter follows:
426 % o wand: the magick wand.
429 WandExport char *MagickGetFont(MagickWand *wand)
431 assert(wand != (MagickWand *) NULL);
432 assert(wand->signature == WandSignature);
433 if( IfMagickTrue(wand->debug) )
434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
436 if (wand->image_info->font == (char *) NULL)
437 return((char *) NULL);
438 return(AcquireString(wand->image_info->font));
442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
446 % M a g i c k G e t F o r m a t %
450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
452 % MagickGetFormat() returns the format of the magick wand.
454 % The format of the MagickGetFormat method is:
456 % const char MagickGetFormat(MagickWand *wand)
458 % A description of each parameter follows:
460 % o wand: the magick wand.
463 WandExport char *MagickGetFormat(MagickWand *wand)
465 assert(wand != (MagickWand *) NULL);
466 assert(wand->signature == WandSignature);
467 if( IfMagickTrue(wand->debug) )
468 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
470 return(AcquireString(wand->image_info->magick));
474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
478 % M a g i c k G e t G r a v i t y %
482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
484 % MagickGetGravity() gets the wand gravity.
486 % The format of the MagickGetGravity method is:
488 % GravityType MagickGetGravity(MagickWand *wand)
490 % A description of each parameter follows:
492 % o wand: the magick wand.
495 WandExport GravityType MagickGetGravity(MagickWand *wand)
503 assert(wand != (MagickWand *) NULL);
504 assert(wand->signature == WandSignature);
505 if( IfMagickTrue(wand->debug) )
506 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
508 option=GetImageOption(wand->image_info,"gravity");
509 if (option == (const char *) NULL)
510 return(UndefinedGravity);
511 type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,option);
516 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
520 % M a g i c k G e t H o m e U R L %
524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
526 % MagickGetHomeURL() returns the ImageMagick home URL.
528 % The format of the MagickGetHomeURL method is:
530 % char *MagickGetHomeURL(void)
533 WandExport char *MagickGetHomeURL(void)
535 return(GetMagickHomeURL());
539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
543 % M a g i c k G e t I m a g e A r t i f a c t %
547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
549 % MagickGetImageArtifact() returns a value associated with the specified
550 % artifact. Use MagickRelinquishMemory() to free the value when you are
553 % The format of the MagickGetImageArtifact method is:
555 % char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
557 % A description of each parameter follows:
559 % o wand: the magick wand.
561 % o artifact: the artifact.
564 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
569 assert(wand != (MagickWand *) NULL);
570 assert(wand->signature == WandSignature);
571 if( IfMagickTrue(wand->debug) )
572 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
574 if (wand->images == (Image *) NULL)
576 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
577 "ContainsNoImages","'%s'",wand->name);
578 return((char *) NULL);
580 value=GetImageArtifact(wand->images,artifact);
581 if (value == (const char *) NULL)
582 return((char *) NULL);
583 return(ConstantString(value));
587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
591 % M a g i c k G e t I m a g e P r o p e r t i e s %
595 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
597 % MagickGetImageArtifacts() returns all the artifact names that match the
598 % specified pattern associated with a wand. Use MagickGetImageProperty() to
599 % return the value of a particular artifact. Use MagickRelinquishMemory() to
600 % free the value when you are finished with it.
602 % The format of the MagickGetImageArtifacts method is:
604 % char *MagickGetImageArtifacts(MagickWand *wand,
605 % const char *pattern,size_t *number_artifacts)
607 % A description of each parameter follows:
609 % o wand: the magick wand.
611 % o pattern: Specifies a pointer to a text string containing a pattern.
613 % o number_artifacts: the number artifacts associated with this wand.
616 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
617 const char *pattern,size_t *number_artifacts)
631 assert(wand != (MagickWand *) NULL);
632 assert(wand->signature == WandSignature);
633 if( IfMagickTrue(wand->debug) )
634 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
636 if (wand->images == (Image *) NULL)
638 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
639 "ContainsNoImages","'%s'",wand->name);
640 return((char **) NULL);
642 (void) GetImageProperty(wand->images,"exif:*",wand->exception);
644 artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
645 if (artifacts == (char **) NULL)
646 return((char **) NULL);
647 ResetImagePropertyIterator(wand->images);
648 artifact=GetNextImageProperty(wand->images);
649 for (i=0; artifact != (const char *) NULL; )
651 if ((*artifact != '[') &&
652 (IfMagickTrue(GlobExpression(artifact,pattern,MagickFalse))))
654 if ((i+1) >= (ssize_t) length)
657 artifacts=(char **) ResizeQuantumMemory(artifacts,length,
659 if (artifacts == (char **) NULL)
661 (void) ThrowMagickException(wand->exception,GetMagickModule(),
662 ResourceLimitError,"MemoryAllocationFailed","'%s'",
664 return((char **) NULL);
667 artifacts[i]=ConstantString(artifact);
670 artifact=GetNextImageProperty(wand->images);
672 artifacts[i]=(char *) NULL;
673 *number_artifacts=(size_t) i;
678 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
682 % M a g i c k G e t I m a g e P r o f i l e %
686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
688 % MagickGetImageProfile() returns the named image profile.
690 % The format of the MagickGetImageProfile method is:
692 % unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
695 % A description of each parameter follows:
697 % o wand: the magick wand.
699 % o name: Name of profile to return: ICC, IPTC, or generic profile.
701 % o length: the length of the profile.
704 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
705 const char *name,size_t *length)
713 assert(wand != (MagickWand *) NULL);
714 assert(wand->signature == WandSignature);
715 if( IfMagickTrue(wand->debug) )
716 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
718 if (wand->images == (Image *) NULL)
720 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
721 "ContainsNoImages","'%s'",wand->name);
722 return((unsigned char *) NULL);
725 if (wand->images->profiles == (SplayTreeInfo *) NULL)
726 return((unsigned char *) NULL);
727 profile=GetImageProfile(wand->images,name);
728 if (profile == (StringInfo *) NULL)
729 return((unsigned char *) NULL);
730 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
732 if (datum == (unsigned char *) NULL)
733 return((unsigned char *) NULL);
734 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
735 GetStringInfoLength(profile));
736 *length=(size_t) GetStringInfoLength(profile);
741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
745 % M a g i c k G e t I m a g e P r o f i l e s %
749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
751 % MagickGetImageProfiles() returns all the profile names that match the
752 % specified pattern associated with a wand. Use MagickGetImageProfile() to
753 % return the value of a particular property. Use MagickRelinquishMemory() to
754 % free the value when you are finished with it.
756 % The format of the MagickGetImageProfiles method is:
758 % char *MagickGetImageProfiles(MagickWand *wand,const char *pattern,
759 % size_t *number_profiles)
761 % A description of each parameter follows:
763 % o wand: the magick wand.
765 % o pattern: Specifies a pointer to a text string containing a pattern.
767 % o number_profiles: the number profiles associated with this wand.
770 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
771 size_t *number_profiles)
785 assert(wand != (MagickWand *) NULL);
786 assert(wand->signature == WandSignature);
787 if( IfMagickTrue(wand->debug) )
788 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
790 if (wand->images == (Image *) NULL)
792 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
793 "ContainsNoImages","'%s'",wand->name);
794 return((char **) NULL);
796 (void) GetImageProfile(wand->images,"exif:*");
798 profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
799 if (profiles == (char **) NULL)
800 return((char **) NULL);
801 ResetImageProfileIterator(wand->images);
802 property=GetNextImageProfile(wand->images);
803 for (i=0; property != (const char *) NULL; )
805 if ((*property != '[') &&
806 (IfMagickTrue(GlobExpression(property,pattern,MagickFalse))))
808 if ((i+1) >= (ssize_t) length)
811 profiles=(char **) ResizeQuantumMemory(profiles,length,
813 if (profiles == (char **) NULL)
815 (void) ThrowMagickException(wand->exception,GetMagickModule(),
816 ResourceLimitError,"MemoryAllocationFailed","'%s'",
818 return((char **) NULL);
821 profiles[i]=ConstantString(property);
824 property=GetNextImageProfile(wand->images);
826 profiles[i]=(char *) NULL;
827 *number_profiles=(size_t) i;
832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
836 % M a g i c k G e t I m a g e P r o p e r t y %
840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
842 % MagickGetImageProperty() returns a value associated with the specified
843 % property. Use MagickRelinquishMemory() to free the value when you are
846 % The format of the MagickGetImageProperty method is:
848 % char *MagickGetImageProperty(MagickWand *wand,const char *property)
850 % A description of each parameter follows:
852 % o wand: the magick wand.
854 % o property: the property.
857 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
862 assert(wand != (MagickWand *) NULL);
863 assert(wand->signature == WandSignature);
864 if( IfMagickTrue(wand->debug) )
865 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
867 if (wand->images == (Image *) NULL)
869 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
870 "ContainsNoImages","'%s'",wand->name);
871 return((char *) NULL);
873 value=GetImageProperty(wand->images,property,wand->exception);
874 if (value == (const char *) NULL)
875 return((char *) NULL);
876 return(ConstantString(value));
880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
884 % M a g i c k G e t I m a g e P r o p e r t i e s %
888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
890 % MagickGetImageProperties() returns all the property names that match the
891 % specified pattern associated with a wand. Use MagickGetImageProperty() to
892 % return the value of a particular property. Use MagickRelinquishMemory() to
893 % free the value when you are finished with it.
895 % The format of the MagickGetImageProperties method is:
897 % char *MagickGetImageProperties(MagickWand *wand,
898 % const char *pattern,size_t *number_properties)
900 % A description of each parameter follows:
902 % o wand: the magick wand.
904 % o pattern: Specifies a pointer to a text string containing a pattern.
906 % o number_properties: the number properties associated with this wand.
909 WandExport char **MagickGetImageProperties(MagickWand *wand,
910 const char *pattern,size_t *number_properties)
924 assert(wand != (MagickWand *) NULL);
925 assert(wand->signature == WandSignature);
926 if( IfMagickTrue(wand->debug) )
927 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
929 if (wand->images == (Image *) NULL)
931 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
932 "ContainsNoImages","'%s'",wand->name);
933 return((char **) NULL);
935 (void) GetImageProperty(wand->images,"exif:*",wand->exception);
937 properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
938 if (properties == (char **) NULL)
939 return((char **) NULL);
940 ResetImagePropertyIterator(wand->images);
941 property=GetNextImageProperty(wand->images);
942 for (i=0; property != (const char *) NULL; )
944 if ((*property != '[') &&
945 (IfMagickTrue(GlobExpression(property,pattern,MagickFalse))))
947 if ((i+1) >= (ssize_t) length)
950 properties=(char **) ResizeQuantumMemory(properties,length,
951 sizeof(*properties));
952 if (properties == (char **) NULL)
954 (void) ThrowMagickException(wand->exception,GetMagickModule(),
955 ResourceLimitError,"MemoryAllocationFailed","'%s'",
957 return((char **) NULL);
960 properties[i]=ConstantString(property);
963 property=GetNextImageProperty(wand->images);
965 properties[i]=(char *) NULL;
966 *number_properties=(size_t) i;
971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
975 % M a g i c k G e t I n t e r l a c e S c h e m e %
979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
981 % MagickGetInterlaceScheme() gets the wand interlace scheme.
983 % The format of the MagickGetInterlaceScheme method is:
985 % InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
987 % A description of each parameter follows:
989 % o wand: the magick wand.
992 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
994 assert(wand != (MagickWand *) NULL);
995 assert(wand->signature == WandSignature);
996 if( IfMagickTrue(wand->debug) )
997 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
999 return(wand->image_info->interlace);
1003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1007 % 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 %
1011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1013 % MagickGetInterpolateMethod() gets the wand compression.
1015 % The format of the MagickGetInterpolateMethod method is:
1017 % PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
1019 % A description of each parameter follows:
1021 % o wand: the magick wand.
1024 WandExport PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
1029 PixelInterpolateMethod
1032 assert(wand != (MagickWand *) NULL);
1033 assert(wand->signature == WandSignature);
1034 if( IfMagickTrue(wand->debug) )
1035 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1037 option=GetImageOption(wand->image_info,"interpolate");
1038 if (option == (const char *) NULL)
1039 return(UndefinedInterpolatePixel);
1040 method=(PixelInterpolateMethod) ParseCommandOption(MagickInterpolateOptions,
1041 MagickFalse,option);
1046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1050 % M a g i c k G e t O p t i o n %
1054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1056 % MagickGetOption() returns a value associated with a wand and the specified
1057 % key. Use MagickRelinquishMemory() to free the value when you are finished
1060 % The format of the MagickGetOption method is:
1062 % char *MagickGetOption(MagickWand *wand,const char *key)
1064 % A description of each parameter follows:
1066 % o wand: the magick wand.
1071 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
1076 assert(wand != (MagickWand *) NULL);
1077 assert(wand->signature == WandSignature);
1078 if( IfMagickTrue(wand->debug) )
1079 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1081 option=GetImageOption(wand->image_info,key);
1082 return(ConstantString(option));
1086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1090 % M a g i c k G e t O p t i o n s %
1094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1096 % MagickGetOptions() returns all the option names that match the specified
1097 % pattern associated with a wand. Use MagickGetOption() to return the value
1098 % of a particular option. Use MagickRelinquishMemory() to free the value
1099 % when you are finished with it.
1101 % The format of the MagickGetOptions method is:
1103 % char *MagickGetOptions(MagickWand *wand,const char *pattern,
1104 % size_t *number_options)
1106 % A description of each parameter follows:
1108 % o wand: the magick wand.
1110 % o pattern: Specifies a pointer to a text string containing a pattern.
1112 % o number_options: the number options associated with this wand.
1115 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
1116 size_t *number_options)
1130 assert(wand != (MagickWand *) NULL);
1131 assert(wand->signature == WandSignature);
1132 if( IfMagickTrue(wand->debug) )
1133 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1135 if (wand->images == (Image *) NULL)
1137 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1138 "ContainsNoImages","'%s'",wand->name);
1139 return((char **) NULL);
1142 options=(char **) AcquireQuantumMemory(length,sizeof(*options));
1143 if (options == (char **) NULL)
1144 return((char **) NULL);
1145 ResetImageOptionIterator(wand->image_info);
1146 option=GetNextImageOption(wand->image_info);
1147 for (i=0; option != (const char *) NULL; )
1149 if ((*option != '[') &&
1150 (IfMagickTrue(GlobExpression(option,pattern,MagickFalse))))
1152 if ((i+1) >= (ssize_t) length)
1155 options=(char **) ResizeQuantumMemory(options,length,
1157 if (options == (char **) NULL)
1159 (void) ThrowMagickException(wand->exception,GetMagickModule(),
1160 ResourceLimitError,"MemoryAllocationFailed","'%s'",
1162 return((char **) NULL);
1165 options[i]=ConstantString(option);
1168 option=GetNextImageOption(wand->image_info);
1170 options[i]=(char *) NULL;
1171 *number_options=(size_t) i;
1176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1180 % M a g i c k G e t O r i e n t a t i o n %
1184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1186 % MagickGetOrientation() gets the wand orientation type.
1188 % The format of the MagickGetOrientation method is:
1190 % OrientationType MagickGetOrientation(MagickWand *wand)
1192 % A description of each parameter follows:
1194 % o wand: the magick wand.
1197 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
1199 assert(wand != (MagickWand *) NULL);
1200 assert(wand->signature == WandSignature);
1201 if( IfMagickTrue(wand->debug) )
1202 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1204 return(wand->image_info->orientation);
1208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1212 % M a g i c k G e t P a c k a g e N a m e %
1216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1218 % MagickGetPackageName() returns the ImageMagick package name as a string
1221 % The format of the MagickGetPackageName method is:
1223 % const char *MagickGetPackageName(void)
1227 WandExport const char *MagickGetPackageName(void)
1229 return(GetMagickPackageName());
1233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1237 % M a g i c k G e t P a g e %
1241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1243 % MagickGetPage() returns the page geometry associated with the magick wand.
1245 % The format of the MagickGetPage method is:
1247 % MagickBooleanType MagickGetPage(const MagickWand *wand,
1248 % size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1250 % A description of each parameter follows:
1252 % o wand: the magick wand.
1254 % o width: the page width.
1256 % o height: page height.
1258 % o x: the page x-offset.
1260 % o y: the page y-offset.
1263 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
1264 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1269 assert(wand != (const MagickWand *) NULL);
1270 assert(wand->signature == WandSignature);
1271 if( IfMagickTrue(wand->debug) )
1272 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1274 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1275 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1276 *width=geometry.width;
1277 *height=geometry.height;
1284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1288 % M a g i c k G e t P o i n t s i z e %
1292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 % MagickGetPointsize() returns the font pointsize associated with the
1297 % The format of the MagickGetPointsize method is:
1299 % double MagickGetPointsize(MagickWand *wand)
1301 % A description of each parameter follows:
1303 % o wand: the magick wand.
1306 WandExport double MagickGetPointsize(MagickWand *wand)
1308 assert(wand != (MagickWand *) NULL);
1309 assert(wand->signature == WandSignature);
1310 if( IfMagickTrue(wand->debug) )
1311 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1313 return(wand->image_info->pointsize);
1317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1321 % M a g i c k G e t Q u a n t u m D e p t h %
1325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1327 % MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
1330 % The format of the MagickGetQuantumDepth method is:
1332 % const char *MagickGetQuantumDepth(size_t *depth)
1334 % A description of each parameter follows:
1336 % o depth: the quantum depth is returned as a number.
1339 WandExport const char *MagickGetQuantumDepth(size_t *depth)
1341 return(GetMagickQuantumDepth(depth));
1345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1349 % M a g i c k G e t Q u a n t u m R a n g e %
1353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1355 % MagickGetQuantumRange() returns the ImageMagick quantum range as a string
1358 % The format of the MagickGetQuantumRange method is:
1360 % const char *MagickGetQuantumRange(size_t *range)
1362 % A description of each parameter follows:
1364 % o range: the quantum range is returned as a number.
1367 WandExport const char *MagickGetQuantumRange(size_t *range)
1369 return(GetMagickQuantumRange(range));
1373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1377 % M a g i c k G e t R e l e a s e D a t e %
1381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1383 % MagickGetReleaseDate() returns the ImageMagick release date as a string
1386 % The format of the MagickGetReleaseDate method is:
1388 % const char *MagickGetReleaseDate(void)
1391 WandExport const char *MagickGetReleaseDate(void)
1393 return(GetMagickReleaseDate());
1397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1401 % M a g i c k G e t R e s o l u t i o n %
1405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1407 % MagickGetResolution() gets the image X and Y resolution.
1409 % The format of the MagickGetResolution method is:
1411 % MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
1414 % A description of each parameter follows:
1416 % o wand: the magick wand.
1418 % o x: the x-resolution.
1420 % o y: the y-resolution.
1423 WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
1424 double *x,double *y)
1426 assert(wand != (MagickWand *) NULL);
1427 assert(wand->signature == WandSignature);
1428 if( IfMagickTrue(wand->debug) )
1429 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1433 if (wand->image_info->density != (char *) NULL)
1441 flags=ParseGeometry(wand->image_info->density,&geometry_info);
1442 *x=geometry_info.rho;
1443 *y=geometry_info.sigma;
1444 if ((flags & SigmaValue) == 0)
1451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1455 % M a g i c k G e t R e s o u r c e %
1459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1461 % MagickGetResource() returns the specified resource in megabytes.
1463 % The format of the MagickGetResource method is:
1465 % MagickSizeType MagickGetResource(const ResourceType type)
1467 % A description of each parameter follows:
1469 % o wand: the magick wand.
1472 WandExport MagickSizeType MagickGetResource(const ResourceType type)
1474 return(GetMagickResource(type));
1478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1482 % M a g i c k G e t R e s o u r c e L i m i t %
1486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1488 % MagickGetResourceLimit() returns the specified resource limit in megabytes.
1490 % The format of the MagickGetResourceLimit method is:
1492 % MagickSizeType MagickGetResourceLimit(const ResourceType type)
1494 % A description of each parameter follows:
1496 % o wand: the magick wand.
1499 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
1501 return(GetMagickResourceLimit(type));
1505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1509 % M a g i c k G e t S a m p l i n g F a c t o r s %
1513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1515 % MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
1517 % The format of the MagickGetSamplingFactors method is:
1519 % double *MagickGetSamplingFactor(MagickWand *wand,
1520 % size_t *number_factors)
1522 % A description of each parameter follows:
1524 % o wand: the magick wand.
1526 % o number_factors: the number of factors in the returned array.
1529 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
1530 size_t *number_factors)
1541 assert(wand != (MagickWand *) NULL);
1542 assert(wand->signature == WandSignature);
1543 if( IfMagickTrue(wand->debug) )
1544 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1547 sampling_factors=(double *) NULL;
1548 if (wand->image_info->sampling_factor == (char *) NULL)
1549 return(sampling_factors);
1551 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1553 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1558 sampling_factors=(double *) AcquireQuantumMemory((size_t) i,
1559 sizeof(*sampling_factors));
1560 if (sampling_factors == (double *) NULL)
1561 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
1562 wand->image_info->filename);
1564 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1566 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1569 sampling_factors[i]=StringToDouble(p,(char **) NULL);
1572 *number_factors=(size_t) i;
1573 return(sampling_factors);
1577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1581 % M a g i c k G e t S i z e %
1585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1587 % MagickGetSize() returns the size associated with the magick wand.
1589 % The format of the MagickGetSize method is:
1591 % MagickBooleanType MagickGetSize(const MagickWand *wand,
1592 % size_t *columns,size_t *rows)
1594 % A description of each parameter follows:
1596 % o wand: the magick wand.
1598 % o columns: the width in pixels.
1600 % o height: the height in pixels.
1603 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
1604 size_t *columns,size_t *rows)
1609 assert(wand != (const MagickWand *) NULL);
1610 assert(wand->signature == WandSignature);
1611 if( IfMagickTrue(wand->debug) )
1612 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1614 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1615 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1616 *columns=geometry.width;
1617 *rows=geometry.height;
1622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1626 % M a g i c k G e t S i z e O f f s e t %
1630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1632 % MagickGetSizeOffset() returns the size offset associated with the magick
1635 % The format of the MagickGetSizeOffset method is:
1637 % MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1640 % A description of each parameter follows:
1642 % o wand: the magick wand.
1644 % o offset: the image offset.
1647 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1653 assert(wand != (const MagickWand *) NULL);
1654 assert(wand->signature == WandSignature);
1655 if( IfMagickTrue(wand->debug) )
1656 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1658 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1659 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1669 % M a g i c k G e t T y p e %
1673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1675 % MagickGetType() returns the wand type.
1677 % The format of the MagickGetType method is:
1679 % ImageType MagickGetType(MagickWand *wand)
1681 % A description of each parameter follows:
1683 % o wand: the magick wand.
1686 WandExport ImageType MagickGetType(MagickWand *wand)
1688 assert(wand != (MagickWand *) NULL);
1689 assert(wand->signature == WandSignature);
1690 if( IfMagickTrue(wand->debug) )
1691 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1693 return(wand->image_info->type);
1697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1701 % M a g i c k G e t V e r s i o n %
1705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1707 % MagickGetVersion() returns the ImageMagick API version as a string constant
1710 % The format of the MagickGetVersion method is:
1712 % const char *MagickGetVersion(size_t *version)
1714 % A description of each parameter follows:
1716 % o version: the ImageMagick version is returned as a number.
1719 WandExport const char *MagickGetVersion(size_t *version)
1721 return(GetMagickVersion(version));
1725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1729 % M a g i c k P r o f i l e I m a g e %
1733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1735 % MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
1736 % from an image. If the profile is NULL, it is removed from the image
1737 % otherwise added. Use a name of '*' and a profile of NULL to remove all
1738 % profiles from the image.
1740 % The format of the MagickProfileImage method is:
1742 % MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
1743 % const void *profile,const size_t length)
1745 % A description of each parameter follows:
1747 % o wand: the magick wand.
1749 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
1751 % o profile: the profile.
1753 % o length: the length of the profile.
1756 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
1757 const char *name,const void *profile,const size_t length)
1759 assert(wand != (MagickWand *) NULL);
1760 assert(wand->signature == WandSignature);
1761 if( IfMagickTrue(wand->debug) )
1762 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1764 if (wand->images == (Image *) NULL)
1765 ThrowWandException(WandError,"ContainsNoImages",wand->name);
1766 return(ProfileImage(wand->images,name,profile,length,wand->exception));
1770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1774 % M a g i c k R e m o v e I m a g e P r o f i l e %
1778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1780 % MagickRemoveImageProfile() removes the named image profile and returns it.
1782 % The format of the MagickRemoveImageProfile method is:
1784 % unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1785 % const char *name,size_t *length)
1787 % A description of each parameter follows:
1789 % o wand: the magick wand.
1791 % o name: Name of profile to return: ICC, IPTC, or generic profile.
1793 % o length: the length of the profile.
1796 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1797 const char *name,size_t *length)
1805 assert(wand != (MagickWand *) NULL);
1806 assert(wand->signature == WandSignature);
1807 if( IfMagickTrue(wand->debug) )
1808 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1810 if (wand->images == (Image *) NULL)
1812 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1813 "ContainsNoImages","'%s'",wand->name);
1814 return((unsigned char *) NULL);
1817 profile=RemoveImageProfile(wand->images,name);
1818 if (profile == (StringInfo *) NULL)
1819 return((unsigned char *) NULL);
1820 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1822 if (datum == (unsigned char *) NULL)
1823 return((unsigned char *) NULL);
1824 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
1825 GetStringInfoLength(profile));
1826 *length=GetStringInfoLength(profile);
1827 profile=DestroyStringInfo(profile);
1832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1836 % M a g i c k S e t A n t i a l i a s %
1840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1842 % MagickSetAntialias() sets the antialias propery of the wand.
1844 % The format of the MagickSetAntialias method is:
1846 % MagickBooleanType MagickSetAntialias(MagickWand *wand,
1847 % const MagickBooleanType antialias)
1849 % A description of each parameter follows:
1851 % o wand: the magick wand.
1853 % o antialias: the antialias property.
1856 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
1857 const MagickBooleanType antialias)
1859 assert(wand != (MagickWand *) NULL);
1860 assert(wand->signature == WandSignature);
1861 if( IfMagickTrue(wand->debug) )
1862 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1864 wand->image_info->antialias=antialias;
1869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1873 % M a g i c k S e t B a c k g r o u n d C o l o r %
1877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1879 % MagickSetBackgroundColor() sets the wand background color.
1881 % The format of the MagickSetBackgroundColor method is:
1883 % MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1884 % const PixelWand *background)
1886 % A description of each parameter follows:
1888 % o wand: the magick wand.
1890 % o background: the background pixel wand.
1893 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1894 const PixelWand *background)
1896 assert(wand != (MagickWand *) NULL);
1897 assert(wand->signature == WandSignature);
1898 if( IfMagickTrue(wand->debug) )
1899 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1901 PixelGetQuantumPacket(background,&wand->image_info->background_color);
1906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1910 % M a g i c k S e t C o l o r s p a c e %
1914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1916 % MagickSetColorspace() sets the wand colorspace type.
1918 % The format of the MagickSetColorspace method is:
1920 % MagickBooleanType MagickSetColorspace(MagickWand *wand,
1921 % const ColorspaceType colorspace)
1923 % A description of each parameter follows:
1925 % o wand: the magick wand.
1927 % o colorspace: the wand colorspace.
1930 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
1931 const ColorspaceType colorspace)
1933 assert(wand != (MagickWand *) NULL);
1934 assert(wand->signature == WandSignature);
1935 if( IfMagickTrue(wand->debug) )
1936 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1938 wand->image_info->colorspace=colorspace;
1943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1947 % M a g i c k S e t C o m p r e s s i o n %
1951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1953 % MagickSetCompression() sets the wand compression type.
1955 % The format of the MagickSetCompression method is:
1957 % MagickBooleanType MagickSetCompression(MagickWand *wand,
1958 % const CompressionType compression)
1960 % A description of each parameter follows:
1962 % o wand: the magick wand.
1964 % o compression: the wand compression.
1967 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
1968 const CompressionType compression)
1970 assert(wand != (MagickWand *) NULL);
1971 assert(wand->signature == WandSignature);
1972 if( IfMagickTrue(wand->debug) )
1973 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1975 wand->image_info->compression=compression;
1980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1984 % 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 %
1988 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1990 % MagickSetCompressionQuality() sets the wand compression quality.
1992 % The format of the MagickSetCompressionQuality method is:
1994 % MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1995 % const size_t quality)
1997 % A description of each parameter follows:
1999 % o wand: the magick wand.
2001 % o quality: the wand compression quality.
2004 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
2005 const size_t quality)
2007 assert(wand != (MagickWand *) NULL);
2008 assert(wand->signature == WandSignature);
2009 if( IfMagickTrue(wand->debug) )
2010 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2012 wand->image_info->quality=quality;
2017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2021 % M a g i c k S e t D e p t h %
2025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2027 % MagickSetDepth() sets the wand pixel depth.
2029 % The format of the MagickSetDepth method is:
2031 % MagickBooleanType MagickSetDepth(MagickWand *wand,
2032 % const size_t depth)
2034 % A description of each parameter follows:
2036 % o wand: the magick wand.
2038 % o depth: the wand pixel depth.
2041 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
2044 assert(wand != (MagickWand *) NULL);
2045 assert(wand->signature == WandSignature);
2046 if( IfMagickTrue(wand->debug) )
2047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2049 wand->image_info->depth=depth;
2054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2058 % M a g i c k S e t E x t r a c t %
2062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2064 % MagickSetExtract() sets the extract geometry before you read or write an
2065 % image file. Use it for inline cropping (e.g. 200x200+0+0) or resizing
2068 % The format of the MagickSetExtract method is:
2070 % MagickBooleanType MagickSetExtract(MagickWand *wand,
2071 % const char *geometry)
2073 % A description of each parameter follows:
2075 % o wand: the magick wand.
2077 % o geometry: the extract geometry.
2080 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
2081 const char *geometry)
2083 assert(wand != (MagickWand *) NULL);
2084 assert(wand->signature == WandSignature);
2085 if( IfMagickTrue(wand->debug) )
2086 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2088 if (geometry != (const char *) NULL)
2089 (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
2094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2098 % M a g i c k S e t F i l e n a m e %
2102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2104 % MagickSetFilename() sets the filename before you read or write an image file.
2106 % The format of the MagickSetFilename method is:
2108 % MagickBooleanType MagickSetFilename(MagickWand *wand,
2109 % const char *filename)
2111 % A description of each parameter follows:
2113 % o wand: the magick wand.
2115 % o filename: the image filename.
2118 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
2119 const char *filename)
2121 assert(wand != (MagickWand *) NULL);
2122 assert(wand->signature == WandSignature);
2123 if( IfMagickTrue(wand->debug) )
2124 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2126 if (filename != (const char *) NULL)
2127 (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
2132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2136 % M a g i c k S e t F o n t %
2140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2142 % MagickSetFont() sets the font associated with the MagickWand.
2144 % The format of the MagickSetFont method is:
2146 % MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
2148 % A description of each parameter follows:
2150 % o wand: the magick wand.
2155 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
2157 if ((font == (const char *) NULL) || (*font == '\0'))
2158 return(MagickFalse);
2159 assert(wand != (MagickWand *) NULL);
2160 assert(wand->signature == WandSignature);
2161 if( IfMagickTrue(wand->debug) )
2162 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2164 (void) CloneString(&wand->image_info->font,font);
2169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2173 % M a g i c k S e t F o r m a t %
2177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2179 % MagickSetFormat() sets the format of the magick wand.
2181 % The format of the MagickSetFormat method is:
2183 % MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
2185 % A description of each parameter follows:
2187 % o wand: the magick wand.
2189 % o format: the image format.
2192 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
2198 assert(wand != (MagickWand *) NULL);
2199 assert(wand->signature == WandSignature);
2200 if( IfMagickTrue(wand->debug) )
2201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2203 if ((format == (char *) NULL) || (*format == '\0'))
2205 *wand->image_info->magick='\0';
2208 magick_info=GetMagickInfo(format,wand->exception);
2209 if (magick_info == (const MagickInfo *) NULL)
2210 return(MagickFalse);
2211 ClearMagickException(wand->exception);
2212 (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
2217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2221 % M a g i c k S e t G r a v i t y %
2225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2227 % MagickSetGravity() sets the gravity type.
2229 % The format of the MagickSetGravity type is:
2231 % MagickBooleanType MagickSetGravity(MagickWand *wand,
2232 % const GravityType type)
2234 % A description of each parameter follows:
2236 % o wand: the magick wand.
2238 % o type: the gravity type.
2241 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
2242 const GravityType type)
2247 assert(wand != (MagickWand *) NULL);
2248 assert(wand->signature == WandSignature);
2249 if( IfMagickTrue(wand->debug) )
2250 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2252 status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
2253 MagickGravityOptions,(ssize_t) type));
2258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2262 % M a g i c k S e t I m a g e A r t i f r c t %
2266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2268 % MagickSetImageArtifact() associates a artifact with an image.
2270 % The format of the MagickSetImageArtifact method is:
2272 % MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2273 % const char *artifact,const char *value)
2275 % A description of each parameter follows:
2277 % o wand: the magick wand.
2279 % o artifact: the artifact.
2281 % o value: the value.
2284 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2285 const char *artifact,const char *value)
2287 assert(wand != (MagickWand *) NULL);
2288 assert(wand->signature == WandSignature);
2289 if( IfMagickTrue(wand->debug) )
2290 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2292 if (wand->images == (Image *) NULL)
2293 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2294 return(SetImageArtifact(wand->images,artifact,value));
2298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2302 % M a g i c k S e t P r o f i l e I m a g e %
2306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2308 % MagickSetImageProfile() adds a named profile to the magick wand. If a
2309 % profile with the same name already exists, it is replaced. This method
2310 % differs from the MagickProfileImage() method in that it does not apply any
2311 % CMS color profiles.
2313 % The format of the MagickSetImageProfile method is:
2315 % MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2316 % const char *name,const void *profile,const size_t length)
2318 % A description of each parameter follows:
2320 % o wand: the magick wand.
2322 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
2324 % o profile: the profile.
2326 % o length: the length of the profile.
2329 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2330 const char *name,const void *profile,const size_t length)
2338 assert(wand != (MagickWand *) NULL);
2339 assert(wand->signature == WandSignature);
2340 if( IfMagickTrue(wand->debug) )
2341 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2343 if (wand->images == (Image *) NULL)
2344 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2345 profile_info=AcquireStringInfo((size_t) length);
2346 SetStringInfoDatum(profile_info,(unsigned char *) profile);
2347 status=SetImageProfile(wand->images,name,profile_info,wand->exception);
2348 profile_info=DestroyStringInfo(profile_info);
2353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2357 % M a g i c k S e t I m a g e P r o p e r t y %
2361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2363 % MagickSetImageProperty() associates a property with an image.
2365 % The format of the MagickSetImageProperty method is:
2367 % MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2368 % const char *property,const char *value)
2370 % A description of each parameter follows:
2372 % o wand: the magick wand.
2374 % o property: the property.
2376 % o value: the value.
2379 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2380 const char *property,const char *value)
2385 assert(wand != (MagickWand *) NULL);
2386 assert(wand->signature == WandSignature);
2387 if( IfMagickTrue(wand->debug) )
2388 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2390 if (wand->images == (Image *) NULL)
2391 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2392 status=SetImageProperty(wand->images,property,value,wand->exception);
2397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2401 % M a g i c k S e t I n t e r l a c e S c h e m e %
2405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2407 % MagickSetInterlaceScheme() sets the image compression.
2409 % The format of the MagickSetInterlaceScheme method is:
2411 % MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2412 % const InterlaceType interlace_scheme)
2414 % A description of each parameter follows:
2416 % o wand: the magick wand.
2418 % o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
2419 % PlaneInterlace, PartitionInterlace.
2422 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2423 const InterlaceType interlace_scheme)
2425 assert(wand != (MagickWand *) NULL);
2426 assert(wand->signature == WandSignature);
2427 if( IfMagickTrue(wand->debug) )
2428 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2430 wand->image_info->interlace=interlace_scheme;
2435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2439 % 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 %
2443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2445 % MagickSetInterpolateMethod() sets the interpolate pixel method.
2447 % The format of the MagickSetInterpolateMethod method is:
2449 % MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2450 % const InterpolateMethodPixel method)
2452 % A description of each parameter follows:
2454 % o wand: the magick wand.
2456 % o method: the interpolate pixel method.
2459 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2460 const PixelInterpolateMethod method)
2465 assert(wand != (MagickWand *) NULL);
2466 assert(wand->signature == WandSignature);
2467 if( IfMagickTrue(wand->debug) )
2468 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2470 status=SetImageOption(wand->image_info,"interpolate",
2471 CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
2476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2480 % M a g i c k S e t O p t i o n %
2484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2486 % MagickSetOption() associates one or options with the wand (.e.g
2487 % MagickSetOption(wand,"jpeg:perserve","yes")).
2489 % The format of the MagickSetOption method is:
2491 % MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2492 % const char *value)
2494 % A description of each parameter follows:
2496 % o wand: the magick wand.
2500 % o value: The value.
2503 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2506 assert(wand != (MagickWand *) NULL);
2507 assert(wand->signature == WandSignature);
2508 if( IfMagickTrue(wand->debug) )
2509 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2511 return(SetImageOption(wand->image_info,key,value));
2515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2519 % M a g i c k S e t O r i e n t a t i o n %
2523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2525 % MagickSetOrientation() sets the wand orientation type.
2527 % The format of the MagickSetOrientation method is:
2529 % MagickBooleanType MagickSetOrientation(MagickWand *wand,
2530 % const OrientationType orientation)
2532 % A description of each parameter follows:
2534 % o wand: the magick wand.
2536 % o orientation: the wand orientation.
2539 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
2540 const OrientationType orientation)
2542 assert(wand != (MagickWand *) NULL);
2543 assert(wand->signature == WandSignature);
2544 if( IfMagickTrue(wand->debug) )
2545 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2547 wand->image_info->orientation=orientation;
2552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2556 % M a g i c k S e t P a g e %
2560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2562 % MagickSetPage() sets the page geometry of the magick wand.
2564 % The format of the MagickSetPage method is:
2566 % MagickBooleanType MagickSetPage(MagickWand *wand,
2567 % const size_t width,const size_t height,const ssize_t x,
2570 % A description of each parameter follows:
2572 % o wand: the magick wand.
2574 % o width: the page width.
2576 % o height: the page height.
2578 % o x: the page x-offset.
2580 % o y: the page y-offset.
2583 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
2584 const size_t width,const size_t height,const ssize_t x,
2588 geometry[MaxTextExtent];
2590 assert(wand != (MagickWand *) NULL);
2591 assert(wand->signature == WandSignature);
2592 if( IfMagickTrue(wand->debug) )
2593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2595 (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
2596 (double) width,(double) height,(double) x,(double) y);
2597 (void) CloneString(&wand->image_info->page,geometry);
2602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2606 % M a g i c k S e t P a s s p h r a s e %
2610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2612 % MagickSetPassphrase() sets the passphrase.
2614 % The format of the MagickSetPassphrase method is:
2616 % MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2617 % const char *passphrase)
2619 % A description of each parameter follows:
2621 % o wand: the magick wand.
2623 % o passphrase: the passphrase.
2626 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2627 const char *passphrase)
2629 assert(wand != (MagickWand *) NULL);
2630 assert(wand->signature == WandSignature);
2631 if( IfMagickTrue(wand->debug) )
2632 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2634 (void) SetImageOption(wand->image_info,"authenticate",passphrase);
2639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2643 % M a g i c k S e t P o i n t s i z e %
2647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2649 % MagickSetPointsize() sets the font pointsize associated with the MagickWand.
2651 % The format of the MagickSetPointsize method is:
2653 % MagickBooleanType MagickSetPointsize(MagickWand *wand,
2654 % const double pointsize)
2656 % A description of each parameter follows:
2658 % o wand: the magick wand.
2660 % o pointsize: the size of the font
2663 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
2664 const double pointsize)
2666 assert(wand != (MagickWand *) NULL);
2667 assert(wand->signature == WandSignature);
2668 if( IfMagickTrue(wand->debug) )
2669 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2671 wand->image_info->pointsize=pointsize;
2676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2680 % M a g i c k S e t P r o g r e s s M o n i t o r %
2684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2686 % MagickSetProgressMonitor() sets the wand progress monitor to the specified
2687 % method and returns the previous progress monitor if any. The progress
2688 % monitor method looks like this:
2690 % MagickBooleanType MagickProgressMonitor(const char *text,
2691 % const MagickOffsetType offset,const MagickSizeType span,
2692 % void *client_data)
2694 % If the progress monitor returns MagickFalse, the current operation is
2697 % The format of the MagickSetProgressMonitor method is:
2699 % MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
2700 % const MagickProgressMonitor progress_monitor,void *client_data)
2702 % A description of each parameter follows:
2704 % o wand: the magick wand.
2706 % o progress_monitor: Specifies a pointer to a method to monitor progress
2707 % of an image operation.
2709 % o client_data: Specifies a pointer to any client data.
2712 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
2713 const MagickProgressMonitor progress_monitor,void *client_data)
2715 MagickProgressMonitor
2718 assert(wand != (MagickWand *) NULL);
2719 assert(wand->signature == WandSignature);
2720 if( IfMagickTrue(wand->debug) )
2721 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2723 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2724 progress_monitor,client_data);
2725 return(previous_monitor);
2729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2733 % M a g i c k S e t R e s o u r c e L i m i t %
2737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2739 % MagickSetResourceLimit() sets the limit for a particular resource in
2742 % The format of the MagickSetResourceLimit method is:
2744 % MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2745 % const MagickSizeType limit)
2747 % A description of each parameter follows:
2749 % o type: the type of resource: AreaResource, MemoryResource, MapResource,
2750 % DiskResource, FileResource.
2752 % o The maximum limit for the resource.
2755 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2756 const MagickSizeType limit)
2758 return(SetMagickResourceLimit(type,limit));
2762 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2766 % M a g i c k S e t R e s o l u t i o n %
2770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2772 % MagickSetResolution() sets the image resolution.
2774 % The format of the MagickSetResolution method is:
2776 % MagickBooleanType MagickSetResolution(MagickWand *wand,
2777 % const double x_resolution,const double y_resolution)
2779 % A description of each parameter follows:
2781 % o wand: the magick wand.
2783 % o x_resolution: the image x resolution.
2785 % o y_resolution: the image y resolution.
2788 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
2789 const double x_resolution,const double y_resolution)
2792 density[MaxTextExtent];
2794 assert(wand != (MagickWand *) NULL);
2795 assert(wand->signature == WandSignature);
2796 if( IfMagickTrue(wand->debug) )
2797 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2799 (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",x_resolution,
2801 (void) CloneString(&wand->image_info->density,density);
2806 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2810 % M a g i c k S e t S a m p l i n g F a c t o r s %
2814 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2816 % MagickSetSamplingFactors() sets the image sampling factors.
2818 % The format of the MagickSetSamplingFactors method is:
2820 % MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2821 % const size_t number_factors,const double *sampling_factors)
2823 % A description of each parameter follows:
2825 % o wand: the magick wand.
2827 % o number_factoes: the number of factors.
2829 % o sampling_factors: An array of doubles representing the sampling factor
2830 % for each color component (in RGB order).
2833 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2834 const size_t number_factors,const double *sampling_factors)
2837 sampling_factor[MaxTextExtent];
2842 assert(wand != (MagickWand *) NULL);
2843 assert(wand->signature == WandSignature);
2844 if( IfMagickTrue(wand->debug) )
2845 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2847 if (wand->image_info->sampling_factor != (char *) NULL)
2848 wand->image_info->sampling_factor=(char *)
2849 RelinquishMagickMemory(wand->image_info->sampling_factor);
2850 if (number_factors == 0)
2852 for (i=0; i < (ssize_t) (number_factors-1); i++)
2854 (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g,",
2855 sampling_factors[i]);
2856 (void) ConcatenateString(&wand->image_info->sampling_factor,
2859 (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g",
2860 sampling_factors[i]);
2861 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2870 % M a g i c k S e t S i z e %
2874 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2876 % MagickSetSize() sets the size of the magick wand. Set it before you
2877 % read a raw image format such as RGB, GRAY, or CMYK.
2879 % The format of the MagickSetSize method is:
2881 % MagickBooleanType MagickSetSize(MagickWand *wand,
2882 % const size_t columns,const size_t rows)
2884 % A description of each parameter follows:
2886 % o wand: the magick wand.
2888 % o columns: the width in pixels.
2890 % o rows: the rows in pixels.
2893 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
2894 const size_t columns,const size_t rows)
2897 geometry[MaxTextExtent];
2899 assert(wand != (MagickWand *) NULL);
2900 assert(wand->signature == WandSignature);
2901 if( IfMagickTrue(wand->debug) )
2902 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2904 (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
2905 columns,(double) rows);
2906 (void) CloneString(&wand->image_info->size,geometry);
2911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2915 % M a g i c k S e t S i z e O f f s e t %
2919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2921 % MagickSetSizeOffset() sets the size and offset of the magick wand. Set it
2922 % before you read a raw image format such as RGB, GRAY, or CMYK.
2924 % The format of the MagickSetSizeOffset method is:
2926 % MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2927 % const size_t columns,const size_t rows,
2928 % const ssize_t offset)
2930 % A description of each parameter follows:
2932 % o wand: the magick wand.
2934 % o columns: the image width in pixels.
2936 % o rows: the image rows in pixels.
2938 % o offset: the image offset.
2941 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2942 const size_t columns,const size_t rows,const ssize_t offset)
2945 geometry[MaxTextExtent];
2947 assert(wand != (MagickWand *) NULL);
2948 assert(wand->signature == WandSignature);
2949 if( IfMagickTrue(wand->debug) )
2950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2952 (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g",
2953 (double) columns,(double) rows,(double) offset);
2954 (void) CloneString(&wand->image_info->size,geometry);
2959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2963 % M a g i c k S e t T y p e %
2967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2969 % MagickSetType() sets the image type attribute.
2971 % The format of the MagickSetType method is:
2973 % MagickBooleanType MagickSetType(MagickWand *wand,
2974 % const ImageType image_type)
2976 % A description of each parameter follows:
2978 % o wand: the magick wand.
2980 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
2981 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
2982 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
2986 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
2987 const ImageType image_type)
2989 assert(wand != (MagickWand *) NULL);
2990 assert(wand->signature == WandSignature);
2991 if( IfMagickTrue(wand->debug) )
2992 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2994 wand->image_info->type=image_type;