imagick showing script url instead of image

Posted by Raz on Stack Overflow See other posts from Stack Overflow or by Raz
Published on 2010-04-07T11:02:35Z Indexed on 2010/04/07 11:03 UTC
Read the original article Hit count: 469

Filed under:
|
|

Hi, currently i'm trying to use imagick to generate some images without saving them on the server and then outputting to the browser, my method of choice was image magic with the imagick extension for php. I read the documentation, and i'm sure the package is installed on my machine (windows xp, with xampp). the class is installed

imagick module  enabled 
imagick module version  2.0.0-alpha 
imagick classes     Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator 
ImageMagick version     ImageMagick 6.3.3 04/21/07 Q16 http://www.imagemagick.org 
ImageMagick release date    04/21/07 
ImageMagick Number of supported formats:    164 
ImageMagick Supported formats   A, ART, AVI, AVS, B, BIE, BMP, BMP2, BMP3, C, CACHE, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CUR, CUT, DCM, DCX, DFONT, DPS, DPX, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, FAX, FITS, FRACTAL, FTS, G, G3, GIF, GIF87, GRADIENT, GRAY, HISTOGRAM, HTM, HTML, ICB, ICO, ICON, INFO, JBG, JBIG, JNG, JP2, JPC, JPEG, JPG, JPX, K, LABEL, M, M2V, MAP, MAT, MATTE, MIFF, MNG, MONO, MPC, MPEG, MPG, MSL, MSVG, MTV, MVG, NULL, O, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PFA, PFB, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSD, PTIF, PWP, R, RAS, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TILE, TIM, TTC, TTF, TXT, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMF, WMFWIN32, WMZ, WPG, X, XBM, XC, XCF, XPM, XV, XWD, Y, YCbCr, YCbCrA, YUV

this is from the phpinfo so i know i have it installed, the thing is when i try to generate an image and save it, it works flawlessly, but when i try to output the image directly, i get the script url as an image

  $draw = new ImagickDraw();

    $draw->setFont('AnkeCalligraph.TTF');
    $draw->setFontSize(52);

    $draw->annotation(110, 110, "Hello World!");
    $draw->annotation(50, 220, "Hello World!");
    $canvas = new Imagick('./pictures/test_live.PNG');
    $canvas->drawImage($draw);
    $canvas->setImageFormat('png');
    header("Content-Type: image/png");
    echo $canvas;

this is the code used. if i use writeimage, then the file on the server is created with no problems. does anyone have any ideas what i'm doing wrong ?

© Stack Overflow or respective owner

Related posts about php

Related posts about imagemagick