add files
This commit is contained in:
commit
db33c2fb08
1284 changed files with 183815 additions and 0 deletions
55
share/doc/ImageMagick-7/www/source/wand.c
Normal file
55
share/doc/ImageMagick-7/www/source/wand.c
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <wand/MagickWand.h>
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
#define ThrowWandException(wand) \
|
||||
{ \
|
||||
char \
|
||||
*description; \
|
||||
\
|
||||
ExceptionType \
|
||||
severity; \
|
||||
\
|
||||
description=MagickGetException(wand,&severity); \
|
||||
(void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); \
|
||||
description=(char *) MagickRelinquishMemory(description); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
MagickBooleanType
|
||||
status;
|
||||
|
||||
MagickWand
|
||||
*magick_wand;
|
||||
|
||||
if (argc != 3)
|
||||
{
|
||||
(void) fprintf(stdout,"Usage: %s image thumbnail\n",argv[0]);
|
||||
exit(0);
|
||||
}
|
||||
/*
|
||||
Read an image.
|
||||
*/
|
||||
MagickWandGenesis();
|
||||
magick_wand=NewMagickWand();
|
||||
status=MagickReadImage(magick_wand,argv[1]);
|
||||
if (status == MagickFalse)
|
||||
ThrowWandException(magick_wand);
|
||||
/*
|
||||
Turn the images into a thumbnail sequence.
|
||||
*/
|
||||
MagickResetIterator(magick_wand);
|
||||
while (MagickNextImage(magick_wand) != MagickFalse)
|
||||
MagickResizeImage(magick_wand,106,80,LanczosFilter,1.0);
|
||||
/*
|
||||
Write the image then destroy it.
|
||||
*/
|
||||
status=MagickWriteImages(magick_wand,argv[2],MagickTrue);
|
||||
if (status == MagickFalse)
|
||||
ThrowWandException(magick_wand);
|
||||
magick_wand=DestroyMagickWand(magick_wand);
|
||||
MagickWandTerminus();
|
||||
return(0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue