ImageMagick output in browser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guffi
    New Member
    • Sep 2010
    • 1

    #1

    ImageMagick output in browser

    Hi, has established ImageMagick. The standard example from docs has followed:

    Code:
    #include <string>
    #include <iostream>
    #include <Magick++.h>
    
    using namespace std;
    using namespace Magick;
    
    int main(int /*argc*/,char **/*argv*/)
    {
    try {
    // Create base image (white image of 300 by 200 pixels)
    Image image( Geometry(300,200), Color("white") );
    
    // Set draw options
    image.strokeColor("red"); // Outline color
    image.fillColor("green"); // Fill color
    image.strokeWidth(5);
    
    // Draw a circle
    image.draw( DrawableCircle(100,100, 50,100) );
    
    // Draw a rectangle
    image.draw( DrawableRectangle(200,200, 270,170) );
    
    // Display the result
    image.display( );
    }
    catch( exception &error_ )
    {
    cout << "Caught exception: " << error_.what() << endl;
    return 1;
    }
    
    return 0;
    }
    As a result of script start I receive an error in logs Apache:
    Premature end of script headers, in the browser 500

    Chmod 755, owner and group - that from whom I start.
    Help pleace, thanks!
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    You're not sending any heads to the browser.

    Read up on HTTP headers - you'll need to send the Content-type header.

    Comment

    Working...