Change language

PHP Imagick getImageProperties () function

Syntax:
array Imagick::getImageProperties (string $pattern, string  $includes_values)
Parameters:This function takes two parameters as above and described below:
  • $pattern: defines a pattern for property names. The default is *, which returns all properties.
  • $includes_values:specifies whether to return only property names. The default is TRUE. If FALSE, then only property names will be returned.
Return value:This function returns an array containing the image properties or only the property names.The following programs illustrate the Imagick::getImageProperties() functionin PHP:Program 1:  
// Create a new one imagick object $imagick = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png );  
// Set image properties $imagick -> setImageProperty ( ’property1’ , ’value1’ ); $imagick -> setImageProperty ( ’property2’ , ’ value2’ ); $imagick -> setImageProperty ( ’hello’ , ’ world’ );  
// Get picture profiles without values ​​starting with "pro" $properties = $imagick -> getImageProperties ( "pro *" , false); print ( "
 " . print_r (  $properties , true).  "
" ); ?>
Output:
Array ([0] = > property1 [1] = > property2)
Program 2:  
// Create a new one imagick object $imagick = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png );  
// Set image properties $imagick -> setImageProperty ( ’property1’ , ’value1’ ); $imagick -> setImageProperty ( ’property2’ , ’ value2’ );  
// Get picture profiles $properties = $imagick -> getImageProperties ( "*" ); print ( "
 " . print_r (  $properties , true).  "
" ); ?>
Output:
Array ([date: create] = > 2019-11-21T22: 32: 52 + 05: 00 [date: modify] = > 2019-11-21T22: 32: 52 + 05: 00 [png : cHRM] = > chunk was found (see Chromaticity, above) [png: gAMA] = > gamma = 0.45455 (See Gamma, above) [png: IHDR.bit-depth-orig] = > 8 [png: IHDR.bit_depth] = > 8 [png: IHDR.color-type-orig] = > 6 [png: IHDR.color_type] = > 6 (RGBA) [png: IHDR.interlace_method] = > 0 (Not interlaced) [png: IHDR.width, height] = > 667, 184 [png: pHYs] = > x_res = 3780, y_res = 3780, units = 1 [png: sRGB] = > intent = 0 (Perceptual Intent ) [png: text] = > 1 tEXt / zTXt / iTXt chunks were found [property1] = > value1 [property2] = > value2 [Software] = > Adobe ImageReady)
Link: https://www.php.net/manual/en/imagick.getimageproperties.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method