PHP 8.3.4 Released!

Imagick::getQuantumRange

(PECL imagick 2, PECL imagick 3)

Imagick::getQuantumRangeImagick parçacık aralığını döndürür

Açıklama

public Imagick::getQuantumRange(): array

Imagick parçacık aralığını bir dizi olarak döndürür.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Imagick örneği için parçacık aralığını bir dizi olarak döndürür. "quantumDepthLong" ve "quantumDepthString" üyelerini içeren ilişkisel dizi döner.

Hatalar/İstisnalar

Hata durumunda bir ImagickException istisnası oluşur.

add a note

User Contributed Notes 1 note

up
0
holdoffhunger at gmail dot com
11 years ago
The getQuantumRange is a useful function, since many of the ImageMagick functions accept parameters from 0 to a maximum of the Quantum Range. When getting a return value for this, it doesn't return a string. It actually returns an array, with one type being a String ('quantumRangeLong') and the other type being a Long Int ('quantumRangeString'). Here's some sample code and the results, given a color, BMP file photograph that is 600x450 pixels...

<?php

// Author: holdoffhunger@gmail.com

// Imagick Type
// ---------------------------------------------

$imagick_type = new Imagick();

// Open File
// ---------------------------------------------

$file_to_grab = "image_workshop_directory/test.bmp";

$file_handle_for_viewing_image_file = fopen($file_to_grab, 'a+');

// Grab File
// ---------------------------------------------

$imagick_type->readImageFile($file_handle_for_viewing_image_file);

// Get Quantum Range
// ---------------------------------------------

$imagick_type_quantum_range = $imagick_type->getQuantumRange();

// Print Results
// ---------------------------------------------

print("<pre>");
print_r($imagick_type_quantum_range);
print(
"</pre>");

?>

Output:

Array
(
[quantumRangeLong] => 65535
[quantumRangeString] => 65535
)
To Top