By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

ImageMagick output in browser

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

Expand|Select|Wrap|Line Numbers
  1. #include <string>
  2. #include <iostream>
  3. #include <Magick++.h>
  4.  
  5. using namespace std;
  6. using namespace Magick;
  7.  
  8. int main(int /*argc*/,char **/*argv*/)
  9. {
  10. try {
  11. // Create base image (white image of 300 by 200 pixels)
  12. Image image( Geometry(300,200), Color("white") );
  13.  
  14. // Set draw options
  15. image.strokeColor("red"); // Outline color
  16. image.fillColor("green"); // Fill color
  17. image.strokeWidth(5);
  18.  
  19. // Draw a circle
  20. image.draw( DrawableCircle(100,100, 50,100) );
  21.  
  22. // Draw a rectangle
  23. image.draw( DrawableRectangle(200,200, 270,170) );
  24.  
  25. // Display the result
  26. image.display( );
  27. }
  28. catch( exception &error_ )
  29. {
  30. cout << "Caught exception: " << error_.what() << endl;
  31. return 1;
  32. }
  33.  
  34. return 0;
  35. }
  36.  
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!
Sep 17 '10 #1
Share this Question
Share on Google+
1 Reply


Markus
Expert 5K+
P: 6,050
You're not sending any heads to the browser.

Read up on HTTP headers - you'll need to send the Content-type header.
Sep 19 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.