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

Fix: Preserve signature in PNG palette images during transformation #279

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

clementbirkle
Copy link
Contributor

Before this change, when transforming PNG palette images (with transparency), the signature would be lost, and the resulting image would become fully transparent. This PR ensures that the signature is preserved during transformations, keeping it visible while maintaining the transparency of the image.

Screenshots:

  • Original Image (before transformation):
    original
  • Image Before Fix (signature lost after transformation):
    before-fix
  • Image After Fix (signature preserved):
    after-fix

@freekmurze
Copy link
Member

Thank you! It seems that the tests are failing. Could you take a look?

@clementbirkle
Copy link
Contributor Author

clementbirkle commented Dec 9, 2024

Thank you for bringing this up!

All tests pass locally with my Lando config:

name: spatieimage
recipe: lamp
config:
  webroot: .
  php: "8.2"
services:
  appserver:
    build_as_root:
      - apt-get update

      # Install NodeJS
      - curl -sL https://deb.nodesource.com/setup_20.x | bash -
      - apt-get install -y nodejs

      # Install dependencies needed for optimizers and PHP extensions
      - apt-get install -y jpegoptim pngquant gifsicle optipng libjpeg-progs webp libavif-bin

It seems that my local environment is not generating the same snapshots as required by GitHub Actions.
@freekmurze, could you help me investigate this? I haven’t been able to pinpoint the issue.

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

Successfully merging this pull request may close these issues.

2 participants