PHP Imagick creates image, but does not write

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
SkepticaLee
-


Joined: 26 Mar 2014
Posts: 1

PostPosted: Wed Mar 26, 2014 4:00 pm    Post subject: PHP Imagick creates image, but does not write Reply with quote

I am using this code to create an Imagick object, the associated new image which is blue, reading one pixel out of it, which has the correct values. But writeImage does not save the file.

This has been demonstrated to work on an apache server 2.2 under php 5.4, imagick 6.6:

Code:

$im = new Imagick ();
$im->newImage (320, 240, "blue");
$pixel = $im->exportImagePixels (0, 0, 1, 1, "RGB", Imagick::PIXEL_CHAR);
var_dump ($pixel);
$im->writeImage ("test.png");
$im->destroy ();
echo "<img src=\"test.png\">";


Any clues?[/code]
Back to top View user's profile Send private message
aprelium-support
-


Joined: 20 Feb 2009
Posts: 356

PostPosted: Fri Apr 25, 2014 11:30 am    Post subject: Re: PHP Imagick creates image, but does not write Reply with quote

SkepticaLee,

Neither Apache nor Abyss Web Server actually runs your PHP code and executs it. It's PHP that does that. Check the permissions and verify why PHP does not save the file as intended: your code by the way does not check for error conditions (why if writeImage fails? There is nothing to handle that.)
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group