16using namespace Magick;
18int main(
int ,
char ** argv)
24 const char *
const p = getenv(
"MAGICK_FONT");
25 const string MAGICK_FONT(p ? p :
"");
32 if(getenv(
"SRCDIR") != 0)
33 srcdir = getenv(
"SRCDIR");
39 list<Image> imageList;
40 readImages( &imageList, srcdir +
"test_image_anim.miff" );
42 vector<Image> montage;
44 montageOpts.font(MAGICK_FONT);
47 montageImages( &montage, imageList.begin(), imageList.end(), montageOpts );
51 if ( montage[0].montageGeometry() != targetGeometry )
54 cout <<
"Line: " << __LINE__
55 <<
" Montage geometry ("
56 << string(montage[0].montageGeometry())
57 <<
") is incorrect (expected "
58 << string(targetGeometry)
64 if ( montage[0].columns() != 768 || montage[0].rows() != 504 )
67 cout <<
"Line: " << __LINE__
68 <<
" Montage columns/rows ("
69 << montage[0].columns() <<
"x"
71 <<
") incorrect. (expected 768x504)" << endl;
76 montageOpts.borderColor(
"green" );
77 montageOpts.borderWidth( 1 );
78 montageOpts.fileName(
"Montage" );
79 montageOpts.frameGeometry(
"6x6+3+3" );
80 montageOpts.geometry(
"50x50+2+2>");
81 montageOpts.gravity( CenterGravity );
82 montageOpts.strokeColor(
"yellow" );
83 montageOpts.shadow(
true );
84 montageOpts.texture(
"granite:" );
85 montageOpts.tile(
"2x1");
86 montageImages( &montage, imageList.begin(), imageList.end(), montageOpts );
88 if ( montage.size() != 3 )
91 cout <<
"Line: " << __LINE__
92 <<
" Montage images failed, number of montage frames is "
94 <<
" rather than 3 as expected." << endl;
99 if ( montage[0].montageGeometry() != targetGeometry )
102 cout <<
"Line: " << __LINE__
103 <<
" Montage geometry ("
104 << string(montage[0].montageGeometry())
105 <<
") is incorrect (expected "
106 << string(targetGeometry)
112 if ( montage[0].columns() != 136 || montage[0].rows() != 70 )
115 cout <<
"Line: " << __LINE__
116 <<
" Montage columns/rows ("
117 << montage[0].columns() <<
"x"
119 <<
") incorrect. (expected 136x70)" << endl;
125 cout <<
"Caught exception: " << error_.what() << endl;
128 catch( exception &error_ )
130 cout <<
"Caught exception: " << error_.what() << endl;
136 cout << failures <<
" failures" << endl;