Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drawLine() ignores transparent colors with GD <= 2.1.0 #1349

Open
olivervogel opened this issue May 5, 2024 · 0 comments
Open

drawLine() ignores transparent colors with GD <= 2.1.0 #1349

olivervogel opened this issue May 5, 2024 · 0 comments

Comments

@olivervogel
Copy link
Member

olivervogel commented May 5, 2024

Describe the bug

The drawLine() function ignores a transparent color and draws the line completely opaque. #ffffff44 for example is drawn as #ffffffff.

The erroneous output was observed with GD version bundled (2.1.0 compatible), which is now about 8 years old and no longer supported. However, it still seems to be unfortunately present in many installations. For example, a recent official PHP 8.3 Docker image still contains this old version.

With a setup with the same version the line width is also ignored. See #1304

There were no problems with current GD versions (e.g. 2.3.3).

Code Example

$image = $manager
    ->create(500, 500)
    ->fill('ff5500')
    ->drawLine(function (LineFactory $line) {
        $line->color('fff4'); // transparency!
        $line->from(100, 100);
        $line->to(400, 100);
    });

Expected behavior

Function should draw line (half) transparent according to given color.

Environment

  • PHP Version: 8.1
  • OS: Debian
  • Intervention Image Version: 3.6.3
  • GD or Imagick: GD bundled (2.1.0 compatible)
@olivervogel olivervogel changed the title drawLine() ignores line width and transparent colors with GD <= 2.1.0 drawLine() ignores transparent colors with GD <= 2.1.0 May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant