The image extension Library (Imagick) environment is as follows:
Apache/2.4.18 (Win64) OpenSSL/1.0.2e PHP/5.6.16
Imagick module version 3.4.2
Imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version ImageMagick 6.9.3-7 Q16 x64 2016-03-27 http://www.imagemagick.org
Imagick using ImageMagick library version ImageMagick 6.9.3-7 Q16 x64 2016-03-27 http://www.imagemagick.org
The Demo1 code is as follows:
Ini_set ('display _ errors ', 1 );
Header ('content-type: image/jpeg ');
$ Image = new Imagick('1.jpg ');
$ Image-> thumbnailImage (100,0 );
Echo $ image;
Exit;
The following error is reported:
The image "http://www.testf.com/test.php?is displayed by mistake.
The Demo2 code is as follows:
$ Thumb = new Imagick ();
$ Thumb-> readImage('1.jpg ');
$ Thumb-> writeImage('test.gif ');
$ Thumb-> clear ();
$ Thumb-> destroy ();
Exit;
The following error is reported:
Fatal error: Uncaught exception 'imagickexception' with message 'unabletoopenblob '1.jpg ': No such file or directory @ error/blob. c/OpenBlob/2702 'in I: \ wamp \ Apache24 \ htdocs \ test. php: 3 Stack trace: #0 I: \ wamp \ Apache24 \ htdocs \ test. php (3): Imagick-> readimage('1.jpg ') #1 {main} thrown in I: \ wamp \ Apache24 \ htdocs \ test. php on line 3
Please give me some advice. thank you.
Reply to discussion (solution)
Check whether your 1.jpg file exists and the path is correct.
The image and path are correct.
Don't tease me,... '1.jpg ': No such file or directory does not have such a file or directory
Don't tease me,... '1.jpg ': No such file or directory does not have such a file or directory
So what do you think.
readImage('http://images.csdn.net/20160518/380-253.jpg');$imagick->writeImages('converted.jpg', false); exit;
Error message:
Fatal error: Uncaught exception 'imagickexception' with message 'failed' to read the file 'in I: \ wamp \ Apache24 \ htdocs \ test. php: 3 Stack trace: #0 I: \ wamp \ Apache24 \ htdocs \ test. php (3): Imagick-> readimage ('http: // images. c... ') #1 {main} thrown in I: \ wamp \ Apache24 \ htdocs \ test. php on line 3
Failed to read the file.
What do I think?
He has clearly told you the cause of the problem!
Okay. I did not ask.