php - Running Image magick code after installation -


i have installed imagemagick , imagick in centos .using

yum install imagemagick yum install imagemagick-devel  cd /root wget http://pecl.php.net/get/imagick-3.0.1.tgz tar zxf imagick-3.0.1.tgz cd imagick-3.0.1 phpize ./configure make make install 

installation went fine without errors , iam trying run, php imagemagick code

<?php   $cmd = " -background none -pointsize 60 -font dragm.ttf -fill red ".   " -strokewidth 1 -stroke black label:\"myexample\" ";   exec("convert $cmd coloured_font.png");  ?> 

edit: have tried code... still it's displaying blank page...

<?php /* create objects */ $image = new imagick(); $draw = new imagickdraw(); $pixel = new imagickpixel( 'gray' );  /* new image */ $image->newimage(800, 75, $pixel);  /* black text */ $draw->setfillcolor('black');  /* font properties */ $draw->setfont('bookman-demiitalic'); $draw->setfontsize( 30 );  /* create text */ $image->annotateimage($draw, 10, 45, 0, 'the quick brown fox jumps on lazy dog');  /* give image format */ $image->setimageformat('png');  /* output image headers */ header('content-type: image/png'); echo $image; 

php.info shows

imagick module enabled imagick module version 3.0.1 imagick classes imagick, imagickdraw, imagickpixel, imagickpixeliterator imagemagick version imagemagick 6.5.4-7 2012-05-07 q16 openmp http://www.imagemagick.org imagemagick copyright copyright (c) 1999-2009 imagemagick studio llc imagemagick release date 2012-05-07 imagemagick number of supported formats: 198 imagemagick supported formats a, ai, art, arw, avi, avs, b, bgr, bmp, bmp2, bmp3, brf, brg, c, cals, caption, cin, cip, clip, cmyk, cmyka, cr2, crw, cur, cut, dcm, dcr, dcx, dds, dfont, dng, dot, dps, dpx, epdf, epi, eps, eps2, eps3, epsf, epsi, ept, ept2, ept3, erf, fax, fits, fractal, fts, g, g3, gbr, gif, gif87, gradient, gray, grb, hald, histogram, hrz, htm, html, icb, ico, icon, info, inline, ipl, isobrl, jng, jp2, jpc, jpeg, jpg, jpx, k, k25, kdc, label, m, m2v, m4v, map, mat, matte, miff, mng, mono, mov, mp4, mpc, mpeg, mpg, mrw, msl, msvg, mtv, mvg, nef, null, o, orf, otb, otf, pal, palm, pam, pattern, pbm, pcd, pcds, pcl, pct, pcx, pdb, pdf, pdfa, pef, pfa, pfb, pfm, pgm, pgx, picon, pict, pix, pjpeg, plasma, png, png24, png32, png8, pnm, ppm, preview, ps, ps2, ps3, psd, ptif, pwp, r, radial-gradient, raf, ras, rbg, rgb, rgba, rgbo, rla, rle, scr, sct, sfw, sgi, shtml, sr2, srf, stegano, sun, svg, svgz, text, tga, thumbnail, tiff, tiff64, tile, tim, ttc, ttf, txt, ubrl, uil, uyvy, vda, vicar, vid, viff, vst, wbmp, wmf, wmv, wmz, wpg, x, x3f, xbm, xc, xcf, xpm, xps, xv, xwd, y, ycbcr, ycbcra, yuv

ideally should create image text myexample, not working, there ways fix this?

look @ "-font dragm.ttf". try set or "/full/path/to/font.ttf", or font name. available list of font names: "convert -list font" console.


Comments