imagemagick - Get info from php extension
Get the solution ↓↓↓I am using php extension imagick. I want to use parts of it based on the condition if the file format is supported. I can see the info's about the extension usingReflextionExtension()
like this:
$imagemagick = new ReflectionExtension('imagick');
$imagemagick ->info();
It renders something like this in the browserwindow:
You can see a list of supported formats. How to get that array?
var_dump()
andprint_r()
don't reveal much. This is the result of avar_dump()
:
object(ReflectionExtension)#1 (1) { ["name"]=> string(7) "imagick" }
I want to add some code inside a logic that is only excecutedif (JP2)
is supported. So I need to get the array of formats to check for it.
Thanks
Answer
Solution:
You can grab that list withImagick::queryFormats('*');
.
As you're looking forJP2
support, than you may be able to call something like this...
if (!empty(Imagick::queryFormats('JP2'))) {
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: npm err! code 1
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.