Skip to content

imagefttext() ignores clipping rect for palette images #17373

Description

@cmb69

Description

The following code:

<?php
$im = imagecreate(64, 32);
$bg = imagecolorallocate($im, 0, 0, 0);
$fg = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, 31, 31, $bg);
imagesetclip($im, 32, 0, 63, 31);
var_dump(imagettftext($im, 16, 0, 7, 23, $fg, "DejaVuSans", "hello"));
imagepng($im);

Resulted in this output with bundled libgd:
fonts-bad

But I expected this output instead (like external libgd):
fonts-good

PHP Version

any with bundled libgd

Operating System

any

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions