Image Extension Library (Imagick)

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.