Issue: Under Windows Imagick::writeimage () Success picture is unsuccessful, and no return value does not know why? However, under Linux it is possible to succeed successfully.
But
$this->image = new Imagick ($path);//$path Save the path of the picture;
...... (Set some properties of the picture, code omitted)
Method One: $this->image->writeimage ($path); Not successful
Method Two: File_put_contents ($path, $this->image); Success
Imagick version: Imagemagick-6.8.7-7-q16-x86-dll.exe
PHP Version: 5.4.16
Ask the big God to tell the reason
Reply to discussion (solution)
Imagick more trouble, PHP and Imagick version has compatibility issues, you have to find a suitable version of the line.
If it is only
Method One: $this->image->writeimage ($path); Not successful
Method Two: File_put_contents ($path, $this->image); Success
That's not ImageMagick's problem, it's your problem!
1, may be in the path with Chinese
2. Possible path is a long path name with spaces
3, may be the relative path when the absolute path processing
Thank you for the moderator tip, the problem is indeed in the road strength.
Change the road to the absolute path and you're done.