Skip to content

image output: throw ValueError on out-of-bounds qualities #8026

@steffdimitrov

Description

@steffdimitrov

Description

The following code:

<?php
ob_start();
imagepng($resource, null, 98);
$contents = ob_get_clean();
ob_end_flush();

var_dump($contents);

Resulted in this output:

string(0);

But I expected this output instead:

ERROR

or:

$content = <<<Binary data here >>>

Tested on php 7.3 but I think it is also applicable for other version using gd.

PHP Version

PHP 7.3.33

Operating System

Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions