8000 vips_getpoint gives wrong values for optimized PNG · Issue #36 · libvips/php-vips · GitHub
[go: up one dir, main page]

Skip to content
vips_getpoint gives wrong values for optimized PNG #36
Closed
@kleisauke

Description

@kleisauke

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
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0