16using namespace Magick;
18int main(
int ,
char ** )
25 const char *
const p = getenv(
"MAGICK_FONT");
26 const string MAGICK_FONT(p ? p :
"");
33 if(getenv(
"SRCDIR") != 0)
34 srcdir = getenv(
"SRCDIR");
40 list<Image> imageList;
41 readImages( &imageList, srcdir +
"test_image_anim.miff" );
43 vector<Image> montage;
45 montageOpts.font(MAGICK_FONT);
48 montageImages( &montage, imageList.begin(), imageList.end(), montageOpts );
52 if ( montage[0].montageGeometry() != targetGeometry )
55 cout <<
"Line: " << __LINE__
56 <<
" Montage geometry ("
57 << string(montage[0].montageGeometry())
58 <<
") is incorrect (expected "
59 << string(targetGeometry)
65 if ( montage[0].columns() != 768 || montage[0].rows() != 504 )
68 cout <<
"Line: " << __LINE__
69 <<
" Montage columns/rows ("
70 << montage[0].columns() <<
"x"
72 <<
") incorrect. (expected 768x504)" << endl;
77 montageOpts.borderColor(
"green" );
78 montageOpts.borderWidth( 1 );
79 montageOpts.fileName(
"Montage" );
80 montageOpts.frameGeometry(
"6x6+3+3" );
81 montageOpts.geometry(
"50x50+2+2>");
82 montageOpts.gravity( CenterGravity );
83 montageOpts.strokeColor(
"yellow" );
84 montageOpts.shadow(
true );
85 montageOpts.texture(
"granite:" );
86 montageOpts.tile(
"2x1");
87 montageImages( &montage, imageList.begin(), imageList.end(), montageOpts );
89 if ( montage.size() != 3 )
92 cout <<
"Line: " << __LINE__
93 <<
" Montage images failed, number of montage frames is "
95 <<
" rather than 3 as expected." << endl;
100 if ( montage[0].montageGeometry() != targetGeometry )
103 cout <<
"Line: " << __LINE__
104 <<
" Montage geometry ("
105 << string(montage[0].montageGeometry())
106 <<
") is incorrect (expected "
107 << string(targetGeometry)
113 if ( montage[0].columns() != 136 || montage[0].rows() != 70 )
116 cout <<
"Line: " << __LINE__
117 <<
" Montage columns/rows ("
118 << montage[0].columns() <<
"x"
120 <<
") incorrect. (expected 136x70)" << endl;
126 cout <<
"Caught exception: " << error_.what() << endl;
129 catch( exception &error_ )
131 cout <<
"Caught exception: " << error_.what() << endl;
137 cout << failures <<
" failures" << endl;