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-2014 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"
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 == WandSignature);
85 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
127 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
169 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
202 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
237 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
271 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
303 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
335 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
391 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
423 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
457 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
495 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
561 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
623 if( IfMagickTrue(wand->debug) )
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 (IfMagickTrue(GlobExpression(artifact,pattern,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 == WandSignature);
705 if( IfMagickTrue(wand->debug) )
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) CopyMagickMemory(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 == WandSignature);
777 if( IfMagickTrue(wand->debug) )
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 (IfMagickTrue(GlobExpression(property,pattern,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 == WandSignature);
854 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
916 if( IfMagickTrue(wand->debug) )
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 (IfMagickTrue(GlobExpression(property,pattern,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 == WandSignature);
986 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1024 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1068 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1122 if( IfMagickTrue(wand->debug) )
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 (IfMagickTrue(GlobExpression(option,pattern,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 == WandSignature);
1191 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1261 if( IfMagickTrue(wand->debug) )
1262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1264 (void) ResetMagickMemory(&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 == WandSignature);
1300 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1418 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1533 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1601 if( IfMagickTrue(wand->debug) )
1602 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1604 (void) ResetMagickMemory(&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 == WandSignature);
1645 if( IfMagickTrue(wand->debug) )
1646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1648 (void) ResetMagickMemory(&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 == WandSignature);
1680 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1751 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1797 if( IfMagickTrue(wand->debug) )
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) CopyMagickMemory(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 == WandSignature);
1851 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1888 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1925 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1962 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
1999 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
2036 if( IfMagickTrue(wand->debug) )
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 == WandSignature);
2075 if( IfMagickTrue(wand->debug) )
2076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2078 if (geometry != (const char *) NULL)
2079 (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
2084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2088 % M a g i c k S e t F i l e n a m e %
2092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2094 % MagickSetFilename() sets the filename before you read or write an image file.
2096 % The format of the MagickSetFilename method is:
2098 % MagickBooleanType MagickSetFilename(MagickWand *wand,
2099 % const char *filename)
2101 % A description of each parameter follows:
2103 % o wand: the magick wand.
2105 % o filename: the image filename.
2108 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
2109 const char *filename)
2111 assert(wand != (MagickWand *) NULL);
2112 assert(wand->signature == WandSignature);
2113 if( IfMagickTrue(wand->debug) )
2114 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2116 if (filename != (const char *) NULL)
2117 (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
2122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2126 % M a g i c k S e t F o n t %
2130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2132 % MagickSetFont() sets the font associated with the MagickWand.
2134 % The format of the MagickSetFont method is:
2136 % MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
2138 % A description of each parameter follows:
2140 % o wand: the magick wand.
2145 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
2147 if ((font == (const char *) NULL) || (*font == '\0'))
2148 return(MagickFalse);
2149 assert(wand != (MagickWand *) NULL);
2150 assert(wand->signature == WandSignature);
2151 if( IfMagickTrue(wand->debug) )
2152 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2154 (void) CloneString(&wand->image_info->font,font);
2159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2163 % M a g i c k S e t F o r m a t %
2167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2169 % MagickSetFormat() sets the format of the magick wand.
2171 % The format of the MagickSetFormat method is:
2173 % MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
2175 % A description of each parameter follows:
2177 % o wand: the magick wand.
2179 % o format: the image format.
2182 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
2188 assert(wand != (MagickWand *) NULL);
2189 assert(wand->signature == WandSignature);
2190 if( IfMagickTrue(wand->debug) )
2191 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2193 if ((format == (char *) NULL) || (*format == '\0'))
2195 *wand->image_info->magick='\0';
2198 magick_info=GetMagickInfo(format,wand->exception);
2199 if (magick_info == (const MagickInfo *) NULL)
2200 return(MagickFalse);
2201 ClearMagickException(wand->exception);
2202 (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
2207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2211 % M a g i c k S e t G r a v i t y %
2215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2217 % MagickSetGravity() sets the gravity type.
2219 % The format of the MagickSetGravity type is:
2221 % MagickBooleanType MagickSetGravity(MagickWand *wand,
2222 % const GravityType type)
2224 % A description of each parameter follows:
2226 % o wand: the magick wand.
2228 % o type: the gravity type.
2231 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
2232 const GravityType type)
2237 assert(wand != (MagickWand *) NULL);
2238 assert(wand->signature == WandSignature);
2239 if( IfMagickTrue(wand->debug) )
2240 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2242 status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
2243 MagickGravityOptions,(ssize_t) type));
2248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2252 % M a g i c k S e t I m a g e A r t i f r c t %
2256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2258 % MagickSetImageArtifact() associates a artifact with an image.
2260 % The format of the MagickSetImageArtifact method is:
2262 % MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2263 % const char *artifact,const char *value)
2265 % A description of each parameter follows:
2267 % o wand: the magick wand.
2269 % o artifact: the artifact.
2271 % o value: the value.
2274 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2275 const char *artifact,const char *value)
2277 assert(wand != (MagickWand *) NULL);
2278 assert(wand->signature == WandSignature);
2279 if( IfMagickTrue(wand->debug) )
2280 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2282 if (wand->images == (Image *) NULL)
2283 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2284 return(SetImageArtifact(wand->images,artifact,value));
2288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2292 % M a g i c k S e t P r o f i l e I m a g e %
2296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2298 % MagickSetImageProfile() adds a named profile to the magick wand. If a
2299 % profile with the same name already exists, it is replaced. This method
2300 % differs from the MagickProfileImage() method in that it does not apply any
2301 % CMS color profiles.
2303 % The format of the MagickSetImageProfile method is:
2305 % MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2306 % const char *name,const void *profile,const size_t length)
2308 % A description of each parameter follows:
2310 % o wand: the magick wand.
2312 % o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
2314 % o profile: the profile.
2316 % o length: the length of the profile.
2319 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2320 const char *name,const void *profile,const size_t length)
2328 assert(wand != (MagickWand *) NULL);
2329 assert(wand->signature == WandSignature);
2330 if( IfMagickTrue(wand->debug) )
2331 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2333 if (wand->images == (Image *) NULL)
2334 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2335 profile_info=AcquireStringInfo((size_t) length);
2336 SetStringInfoDatum(profile_info,(unsigned char *) profile);
2337 status=SetImageProfile(wand->images,name,profile_info,wand->exception);
2338 profile_info=DestroyStringInfo(profile_info);
2343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2347 % M a g i c k S e t I m a g e P r o p e r t y %
2351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2353 % MagickSetImageProperty() associates a property with an image.
2355 % The format of the MagickSetImageProperty method is:
2357 % MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2358 % const char *property,const char *value)
2360 % A description of each parameter follows:
2362 % o wand: the magick wand.
2364 % o property: the property.
2366 % o value: the value.
2369 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2370 const char *property,const char *value)
2375 assert(wand != (MagickWand *) NULL);
2376 assert(wand->signature == WandSignature);
2377 if( IfMagickTrue(wand->debug) )
2378 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2380 if (wand->images == (Image *) NULL)
2381 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2382 status=SetImageProperty(wand->images,property,value,wand->exception);
2387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2391 % M a g i c k S e t I n t e r l a c e S c h e m e %
2395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2397 % MagickSetInterlaceScheme() sets the image compression.
2399 % The format of the MagickSetInterlaceScheme method is:
2401 % MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2402 % const InterlaceType interlace_scheme)
2404 % A description of each parameter follows:
2406 % o wand: the magick wand.
2408 % o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
2409 % PlaneInterlace, PartitionInterlace.
2412 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2413 const InterlaceType interlace_scheme)
2415 assert(wand != (MagickWand *) NULL);
2416 assert(wand->signature == WandSignature);
2417 if( IfMagickTrue(wand->debug) )
2418 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2420 wand->image_info->interlace=interlace_scheme;
2425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2429 % 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 %
2433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2435 % MagickSetInterpolateMethod() sets the interpolate pixel method.
2437 % The format of the MagickSetInterpolateMethod method is:
2439 % MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2440 % const InterpolateMethodPixel method)
2442 % A description of each parameter follows:
2444 % o wand: the magick wand.
2446 % o method: the interpolate pixel method.
2449 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2450 const PixelInterpolateMethod method)
2455 assert(wand != (MagickWand *) NULL);
2456 assert(wand->signature == WandSignature);
2457 if( IfMagickTrue(wand->debug) )
2458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2460 status=SetImageOption(wand->image_info,"interpolate",
2461 CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
2466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2470 % M a g i c k S e t O p t i o n %
2474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2476 % MagickSetOption() associates one or options with the wand (.e.g
2477 % MagickSetOption(wand,"jpeg:perserve","yes")).
2479 % The format of the MagickSetOption method is:
2481 % MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2482 % const char *value)
2484 % A description of each parameter follows:
2486 % o wand: the magick wand.
2490 % o value: The value.
2493 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2496 assert(wand != (MagickWand *) NULL);
2497 assert(wand->signature == WandSignature);
2498 if( IfMagickTrue(wand->debug) )
2499 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2501 return(SetImageOption(wand->image_info,key,value));
2505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2509 % M a g i c k S e t O r i e n t a t i o n %
2513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2515 % MagickSetOrientation() sets the wand orientation type.
2517 % The format of the MagickSetOrientation method is:
2519 % MagickBooleanType MagickSetOrientation(MagickWand *wand,
2520 % const OrientationType orientation)
2522 % A description of each parameter follows:
2524 % o wand: the magick wand.
2526 % o orientation: the wand orientation.
2529 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
2530 const OrientationType orientation)
2532 assert(wand != (MagickWand *) NULL);
2533 assert(wand->signature == WandSignature);
2534 if( IfMagickTrue(wand->debug) )
2535 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2537 wand->image_info->orientation=orientation;
2542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2546 % M a g i c k S e t P a g e %
2550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2552 % MagickSetPage() sets the page geometry of the magick wand.
2554 % The format of the MagickSetPage method is:
2556 % MagickBooleanType MagickSetPage(MagickWand *wand,
2557 % const size_t width,const size_t height,const ssize_t x,
2560 % A description of each parameter follows:
2562 % o wand: the magick wand.
2564 % o width: the page width.
2566 % o height: the page height.
2568 % o x: the page x-offset.
2570 % o y: the page y-offset.
2573 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
2574 const size_t width,const size_t height,const ssize_t x,
2578 geometry[MaxTextExtent];
2580 assert(wand != (MagickWand *) NULL);
2581 assert(wand->signature == WandSignature);
2582 if( IfMagickTrue(wand->debug) )
2583 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2585 (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
2586 (double) width,(double) height,(double) x,(double) y);
2587 (void) CloneString(&wand->image_info->page,geometry);
2592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2596 % M a g i c k S e t P a s s p h r a s e %
2600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2602 % MagickSetPassphrase() sets the passphrase.
2604 % The format of the MagickSetPassphrase method is:
2606 % MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2607 % const char *passphrase)
2609 % A description of each parameter follows:
2611 % o wand: the magick wand.
2613 % o passphrase: the passphrase.
2616 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2617 const char *passphrase)
2619 assert(wand != (MagickWand *) NULL);
2620 assert(wand->signature == WandSignature);
2621 if( IfMagickTrue(wand->debug) )
2622 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2624 (void) SetImageOption(wand->image_info,"authenticate",passphrase);
2629 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2633 % M a g i c k S e t P o i n t s i z e %
2637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2639 % MagickSetPointsize() sets the font pointsize associated with the MagickWand.
2641 % The format of the MagickSetPointsize method is:
2643 % MagickBooleanType MagickSetPointsize(MagickWand *wand,
2644 % const double pointsize)
2646 % A description of each parameter follows:
2648 % o wand: the magick wand.
2650 % o pointsize: the size of the font
2653 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
2654 const double pointsize)
2656 assert(wand != (MagickWand *) NULL);
2657 assert(wand->signature == WandSignature);
2658 if( IfMagickTrue(wand->debug) )
2659 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2661 wand->image_info->pointsize=pointsize;
2666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2670 % M a g i c k S e t P r o g r e s s M o n i t o r %
2674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2676 % MagickSetProgressMonitor() sets the wand progress monitor to the specified
2677 % method and returns the previous progress monitor if any. The progress
2678 % monitor method looks like this:
2680 % MagickBooleanType MagickProgressMonitor(const char *text,
2681 % const MagickOffsetType offset,const MagickSizeType span,
2682 % void *client_data)
2684 % If the progress monitor returns MagickFalse, the current operation is
2687 % The format of the MagickSetProgressMonitor method is:
2689 % MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
2690 % const MagickProgressMonitor progress_monitor,void *client_data)
2692 % A description of each parameter follows:
2694 % o wand: the magick wand.
2696 % o progress_monitor: Specifies a pointer to a method to monitor progress
2697 % of an image operation.
2699 % o client_data: Specifies a pointer to any client data.
2702 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
2703 const MagickProgressMonitor progress_monitor,void *client_data)
2705 MagickProgressMonitor
2708 assert(wand != (MagickWand *) NULL);
2709 assert(wand->signature == WandSignature);
2710 if( IfMagickTrue(wand->debug) )
2711 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2713 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2714 progress_monitor,client_data);
2715 return(previous_monitor);
2719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2723 % M a g i c k S e t R e s o u r c e L i m i t %
2727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2729 % MagickSetResourceLimit() sets the limit for a particular resource in
2732 % The format of the MagickSetResourceLimit method is:
2734 % MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2735 % const MagickSizeType limit)
2737 % A description of each parameter follows:
2739 % o type: the type of resource: AreaResource, MemoryResource, MapResource,
2740 % DiskResource, FileResource.
2742 % o The maximum limit for the resource.
2745 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2746 const MagickSizeType limit)
2748 return(SetMagickResourceLimit(type,limit));
2752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2756 % M a g i c k S e t R e s o l u t i o n %
2760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2762 % MagickSetResolution() sets the image resolution.
2764 % The format of the MagickSetResolution method is:
2766 % MagickBooleanType MagickSetResolution(MagickWand *wand,
2767 % const double x_resolution,const double y_resolution)
2769 % A description of each parameter follows:
2771 % o wand: the magick wand.
2773 % o x_resolution: the image x resolution.
2775 % o y_resolution: the image y resolution.
2778 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
2779 const double x_resolution,const double y_resolution)
2782 density[MaxTextExtent];
2784 assert(wand != (MagickWand *) NULL);
2785 assert(wand->signature == WandSignature);
2786 if( IfMagickTrue(wand->debug) )
2787 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2789 (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",x_resolution,
2791 (void) CloneString(&wand->image_info->density,density);
2796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2800 % M a g i c k S e t S a m p l i n g F a c t o r s %
2804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2806 % MagickSetSamplingFactors() sets the image sampling factors.
2808 % The format of the MagickSetSamplingFactors method is:
2810 % MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2811 % const size_t number_factors,const double *sampling_factors)
2813 % A description of each parameter follows:
2815 % o wand: the magick wand.
2817 % o number_factoes: the number of factors.
2819 % o sampling_factors: An array of doubles representing the sampling factor
2820 % for each color component (in RGB order).
2823 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2824 const size_t number_factors,const double *sampling_factors)
2827 sampling_factor[MaxTextExtent];
2832 assert(wand != (MagickWand *) NULL);
2833 assert(wand->signature == WandSignature);
2834 if( IfMagickTrue(wand->debug) )
2835 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2837 if (wand->image_info->sampling_factor != (char *) NULL)
2838 wand->image_info->sampling_factor=(char *)
2839 RelinquishMagickMemory(wand->image_info->sampling_factor);
2840 if (number_factors == 0)
2842 for (i=0; i < (ssize_t) (number_factors-1); i++)
2844 (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g,",
2845 sampling_factors[i]);
2846 (void) ConcatenateString(&wand->image_info->sampling_factor,
2849 (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g",
2850 sampling_factors[i]);
2851 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2860 % M a g i c k S e t S i z e %
2864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2866 % MagickSetSize() sets the size of the magick wand. Set it before you
2867 % read a raw image format such as RGB, GRAY, or CMYK.
2869 % The format of the MagickSetSize method is:
2871 % MagickBooleanType MagickSetSize(MagickWand *wand,
2872 % const size_t columns,const size_t rows)
2874 % A description of each parameter follows:
2876 % o wand: the magick wand.
2878 % o columns: the width in pixels.
2880 % o rows: the rows in pixels.
2883 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
2884 const size_t columns,const size_t rows)
2887 geometry[MaxTextExtent];
2889 assert(wand != (MagickWand *) NULL);
2890 assert(wand->signature == WandSignature);
2891 if( IfMagickTrue(wand->debug) )
2892 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2894 (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
2895 columns,(double) rows);
2896 (void) CloneString(&wand->image_info->size,geometry);
2901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2905 % M a g i c k S e t S i z e O f f s e t %
2909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2911 % MagickSetSizeOffset() sets the size and offset of the magick wand. Set it
2912 % before you read a raw image format such as RGB, GRAY, or CMYK.
2914 % The format of the MagickSetSizeOffset method is:
2916 % MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2917 % const size_t columns,const size_t rows,
2918 % const ssize_t offset)
2920 % A description of each parameter follows:
2922 % o wand: the magick wand.
2924 % o columns: the image width in pixels.
2926 % o rows: the image rows in pixels.
2928 % o offset: the image offset.
2931 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2932 const size_t columns,const size_t rows,const ssize_t offset)
2935 geometry[MaxTextExtent];
2937 assert(wand != (MagickWand *) NULL);
2938 assert(wand->signature == WandSignature);
2939 if( IfMagickTrue(wand->debug) )
2940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2942 (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g",
2943 (double) columns,(double) rows,(double) offset);
2944 (void) CloneString(&wand->image_info->size,geometry);
2949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2953 % M a g i c k S e t T y p e %
2957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2959 % MagickSetType() sets the image type attribute.
2961 % The format of the MagickSetType method is:
2963 % MagickBooleanType MagickSetType(MagickWand *wand,
2964 % const ImageType image_type)
2966 % A description of each parameter follows:
2968 % o wand: the magick wand.
2970 % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
2971 % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
2972 % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
2976 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
2977 const ImageType image_type)
2979 assert(wand != (MagickWand *) NULL);
2980 assert(wand->signature == WandSignature);
2981 if( IfMagickTrue(wand->debug) )
2982 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2984 wand->image_info->type=image_type;