In php, it is very slow for the magickwand library to generate GIF images for saving or outputting images. Does anyone know why? What should I do?

Source: Internet
Author: User
In php, it is very slow for the magickwand library to generate GIF images for saving or outputting images. Does anyone know why? Because the GD library does not have the GIF animation writing function, all functions are implemented using MAGICKWAND. it is indeed very useful, but I found that GIF images are generated using XDEBUG (the bigger the more obvious) whether it is saved to a file or directly output, it is very slow, when I use the JPG/PNG format, I will not ask the magickwand Library in php to generate GIF format images. it is very slow to save or output images. Does anyone know why?
Because the GD library does not have the GIF animation writing function, all functions are implemented using MAGICKWAND. it is indeed very useful, but I found that GIF images are generated using XDEBUG (the bigger the more obvious) it is very slow to save to the file or directly output. this problem does not occur when I use JPG/PNG format. the following code description:

$ NewMw = newmagickwand ();
Magicksetformat ($ newMw, 'GIF ');
Magickreadimage({newmw,'old.gif ');
Magickwriteimages({newmw,'filename.gif ');
?>
It takes 700 ms to execute the above code !!!


$ NewMw = newmagickwand ();
Magicksetformat ($ newMw, 'jpg ');
Magickreadimage({newmw,'old.gif ');
Magickwriteimages({newmw,'filename.gif ');
?>
The above code only takes 30 ms !!!


------ Solution --------------------
I don't know. it's your server problem.
------ Solution --------------------
Magicksetformat ($ newMw, 'GIF'); it is best to write this sentence as magicksetformat ($ newMw, 'GIF ');

I'm trying to test all the slow operations here. jpg's 0.3 second gif's 0.5 second
(PHP4.4.8 ImageMagick 6.3.4)

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.