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

GD image alpha is inverted #9

Open
SteveMarshall opened this issue May 2, 2014 · 2 comments
Open

GD image alpha is inverted #9

SteveMarshall opened this issue May 2, 2014 · 2 comments

Comments

@SteveMarshall
Copy link

Hi,

I’ve been working with ngx_small_light for the last week and, after discovering that ImageMagick struggles under load (~1/10-1/2 of all requests fail with it), I tried switching to GD. Thankfully, GD is much better at coping with load, but I discovered that it expects, per libgd.h, 0-127 as its alpha value, with 0 being transparent.

I was wondering if it would be possible to put some fix into ngx_small_light to mask that from the front-end? I would’ve submitted a patch, but wasn't sure the best way to formulate a test for it.

Thanks for a great module!

@cubicdaiya
Copy link
Owner

@SteveMarshall

Hi, thanks for your report.

I discovered that it expects, per libgd.h, 0-127 as its alpha value, with 0 being transparent.

Sorry. I could not understand about the above described very well. Would you mind explaining about your problem more specifically?

I was wondering if it would be possible to put some fix into ngx_small_light to mask that from the front-end? I would’ve submitted a patch, but wasn't sure the best way to formulate a test for it.

Could you submit a patch tentatively? So that I'll review it.(It might take time to complete the review as I'm a little busy recently)

@SteveMarshall
Copy link
Author

Hey, sorry, I wrote that the wrong way around: GD treats 0 alpha as opaque, 127+ as transparent (where ImageMagick has 0 alpha as transparent and 255 as opaque).

I’ll try to work up a patch this week.

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 a pull request may close this issue.

2 participants