test: add specs for non-rgb image processing #32
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
I'm prototyping
libvips
-based Morandi on a separate branch in hope of improving its memory profile and performance.Problems
Pixbuf automatically converts everything to RGB, but
libvips
doesn't. We want to ensure that when non-RGB images are supplied, they are processed correctly and provide sRGB output by default.Solutions
Add basic test coverage for processing a non-RGB image (in this case it's 1-channel - greyscale).
On top of basic test, I added a second simple test case, because colour filters rely on some RGB constants and fail for non-RGB images when implemented incorrectly.
The other differently handled option is cropping outside of image boundaries, but I consider that edge case not worthy of a dedicated test at the moment
Notes