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

Images with partial transpency return "false" for "has-transparency" #1214

Closed
JacobDB opened this issue May 14, 2024 · 6 comments · Fixed by #1215
Closed

Images with partial transpency return "false" for "has-transparency" #1214

JacobDB opened this issue May 14, 2024 · 6 comments · Fixed by #1215
Assignees
Labels
[Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) [Type] Bug An existing feature is broken

Comments

@JacobDB
Copy link

JacobDB commented May 14, 2024

Bug Description

Images that have partial transparency return false for has-transparency

Steps to reproduce

  1. Upload a partially transparent image, such as this one
  2. View the source code on the front end
  3. Observer data-transparency="false" is added to the image

Screenshots

image

image

Additional Context

  • PHP Version: 8.2.18
  • OS: All
  • Browser: All
  • Plugin Version: Performance Lab 3.0.0, Image Placeholders v1.1.0
  • Device: All
@JacobDB JacobDB added the [Type] Bug An existing feature is broken label May 14, 2024
@mukeshpanchal27 mukeshpanchal27 added the [Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) label May 14, 2024
@westonruter
Copy link
Member

From looking at the code it seems like this should be working correctly, where if alpha is zero then it is fully opaque:

if ( $rgba['alpha'] > 0 ) {
return true;
}

@JacobDB
Copy link
Author

JacobDB commented May 14, 2024

So are you saying that's intentional?

@westonruter
Copy link
Member

No, but I'm confused why it isn't working for you because it seems to be coded correctly. It doesn't seem to be working for me either.

@JacobDB
Copy link
Author

JacobDB commented May 14, 2024

Interesting, glad it's not just me then! I did some more testing and yeah, it seems to be consistently occurring.

@westonruter
Copy link
Member

I found the problem. I've proposed a fix in #1215. It's a one-line change you can easily test yourself.

@JacobDB
Copy link
Author

JacobDB commented May 14, 2024

Awesome, thanks much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) [Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants