Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Refactor nativeMergeAndReplacePix. Addresses #132. #157

Merged
merged 1 commit into from
Jun 20, 2016
Merged

Refactor nativeMergeAndReplacePix. Addresses #132. #157

merged 1 commit into from
Jun 20, 2016

Conversation

megabytefisher
Copy link
Contributor

@megabytefisher megabytefisher commented Jun 18, 2016

Hello, after being encouraged by the merge of my first pull request, I decided to try and fix an open issue.

I am submitting this PR to fix issue #132. I refactored 'nativeMergeAndReplacePix' so that it now correctly removes the second supplied image from the Pixa and also correctly gets the depth to use from the source Pix, instead of the old hardcoded depth of '1' which would cause the calls to 'pixRasterop' to fail if the source depths were not both 1. (See file 'rop.c' @ line 226 & 227)

This fixes the test for me.

As always, please let me know if there are any issues. Thanks for your time.

Changed nativeMergeAndReplacePix so that it now deletes the secondary
Pix and uses whatever depth is needed, instead of a hardcoded depth of
1.
@rmtheis
Copy link
Owner

rmtheis commented Jun 20, 2016

Looks good to me. Nice fix.

If you're at all inclined to look at it, the testPixaReplacePix() test is currently commented out because it crashes in the native code. I'm not sure of the details, but it could use some attention.

Thanks for the contribution.

@rmtheis rmtheis merged commit abe7bda into rmtheis:master Jun 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants