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

Change the order of operations: boolean, extractChannel, then sRGB conversion #504

Merged
merged 1 commit into from
Jul 13, 2016
Merged

Change the order of operations: boolean, extractChannel, then sRGB conversion #504

merged 1 commit into from
Jul 13, 2016

Conversation

mhirsch
Copy link
Contributor

@mhirsch mhirsch commented Jul 13, 2016

This small pr moves the boolean(), bandbool(), and extractChannel() operations to before the code that performs sRGB conversion. It doesn't make sense to be able to extract a channel that doesn't appear in the input image. It also doesn't make a lot of sense to perform boolean operations on channels that were implicitly added after the image was loaded. This does raise the somewhat odd potential for colorspace conversion to be performed after a bitwise boolean operation -- perhaps this should be explicitly prevented? It can happen if the input image has a non-sRGB profile.

…orm channel extraction before converting to sRGB/3 channel image
@coveralls
Copy link

coveralls commented Jul 13, 2016

Coverage Status

Coverage remained the same at 99.014% when pulling 9fda463 on mhirsch:order_of_ops_boolean_extractChannel into 2d50055 on lovell:master.

@lovell
Copy link
Owner

lovell commented Jul 13, 2016

Thanks Matt. Might this be considered a breaking change? Should this land in v0.16.0 or v0.15.2?

@mhirsch
Copy link
Contributor Author

mhirsch commented Jul 13, 2016

I can see a circumstance where it might break existing code. The intent is to avoid confusing situations where a boolean operation occurs on a channel that you weren't expecting to exist, or you are able to extract a channel that didn't exist in the input image. So to me the question is whether it is more likely that people run into problems with the code as is, or with the change. Given that we just added these features three or four days ago, it seems unlikely that someone would have already written code to exploit one of the existing corner cases. The overlap between using bitwise boolean operations and working with images that contain a color profile seems like it would be small.

I guess I can see both sides here. Perhaps there's some additional behavior that could be enforced to make this an easier decision? In the end though it doesn't matter much to me which version the change lands in -- whatever you think is best.

@lovell lovell merged commit 15a5778 into lovell:master Jul 13, 2016
@lovell lovell added this to the v0.15.2 milestone Jul 13, 2016
@lovell
Copy link
Owner

lovell commented Jul 13, 2016

Thanks Matt, I agree this has minimal impact - will be in the next point release.

@mhirsch mhirsch deleted the order_of_ops_boolean_extractChannel branch July 13, 2016 18:30
@lovell lovell modified the milestones: v0.16.0, v0.15.2 Jul 25, 2016
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.

3 participants