Closed
Description
It looks like there's someting wrong with the vips_getpoint
operation when this is performed on an optimized (possible pngcrush
'd) PNG image.
Test images:
test_images.zip
Test script:
<?php
require __DIR__ . '/vendor/autoload.php';
use Jcupitt\Vips;
$imageWorking = Vips\Image::newFromFile(__DIR__ . '/PNG_transparency_demonstration_1_20170225194941.png', ['access' => 'random']);
echo (string) $imageWorking . PHP_EOL;
print_r($imageWorking->getpoint(0, 0));
$imageBroken = Vips\Image::newFromFile(__DIR__ . '/PNG_transparency_demonstration_1.png', ['access' => 'random']);
echo (string) $imageBroken . PHP_EOL;
print_r($imageBroken->getpoint(0, 0));
Output:
{"width":800,"height":600,"bands":4,"format":"uchar","interpretation":"srgb"}
Array
(
[0] => 255
[1] => 255
[2] => 255
[3] => 0
)
{"width":800,"height":600,"bands":4,"format":"uchar","interpretation":"srgb"}
Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
)