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

fixed bug for images with odd-numbered columns #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmagree
Copy link

@dmagree dmagree commented Sep 20, 2015

This fixes a problem when half-sampling images with an odd number of columns. Pointers top and bottom finish the for loop one pointer short if the out.cols does not evenly divide in.cols.

@cfo
Copy link
Collaborator

cfo commented Sep 20, 2015

are you sure?
note that the stride is sometimes not equal to in.cols because of the internal memory layout.

@dmagree
Copy link
Author

dmagree commented Sep 20, 2015

Hmm, I don't think it matters, does it? The problem with lines 111 and 112 are that top and bottom are not at the end of their respective rows. Stride will never advance them the correct amount in that case. The fix assumes that top and bottom are 1 byte away in the case of odd number of columns, which is consistent with how the rest of the section is written, correct?

@dmagree
Copy link
Author

dmagree commented Sep 20, 2015

Ah, ok, but I should be checking in.cols instead of stride at 93. If you agree I'll fix and make another pull request.

@kvmanohar22
Copy link

@cfo This probably should have been merged quite a long ago. Please have a look at the valgrind report at #32

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