Open In App

PHP | Gmagick getimageinterlacescheme() Function

Last Updated : 21 Jan, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

The Gmagick::getimageinterlacescheme() function is an inbuilt function in PHP which is used to get the interlace scheme of the image.

Syntax:

int Gmagick::getimageinterlacescheme( void )

Parameters: This function doesn’t accept any parameters.

Return Value: This function returns an integer value corresponding to one of INTERLACE constants as given below:

  • gmagick::INTERLACE_UNDEFINED (0)
  • gmagick::INTERLACE_NO (1)
  • gmagick::INTERLACE_LINE (2)
  • gmagick::INTERLACE_PLANE (3)
  • gmagick::INTERLACE_PARTITION (4)

Exceptions: This function throws GmagickException on error.

Below given programs illustrate the Gmagick::getimageinterlacescheme() function in PHP:

Program 1:




<?php
  
// Create a new Gmagick object
$gmagick = new Gmagick('geeksforgeeks.png');
  
// Get the interlace scheme
$interlaceScheme = $gmagick->getimageinterlacescheme();
echo $interlaceScheme
?>


Output:

0 // Which is the default value for any Gmagick object.

Program 2:




<?php
  
// Create a new Gmagick object
$gmagick = new Gmagick('geeksforgeeks.png');
  
// Set the interlace scheme
$gmagick->setimageinterlacescheme(gmagick::INTERLACE_LINE);
  
// Get the interlace scheme
$interlaceScheme = $gmagick->getimageinterlacescheme();
echo $interlaceScheme;
?>


Output:

2 // Which corresponds to gmagick::INTERLACE_LINE.

Reference: https://www.php.net/manual/en/gmagick.getimageinterlacescheme.php


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads