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

some bug in equate_images()?? #156

Closed
msae opened this issue Nov 26, 2018 · 2 comments
Closed

some bug in equate_images()?? #156

msae opened this issue Nov 26, 2018 · 2 comments

Comments

@msae
Copy link

msae commented Nov 26, 2018

Hi,
I have used your gamma evaluation.
During testing I regognised some behavior that I would interprete as a bug.
if you would enter fthe function equate_images with the same file, you will get a ZeroDivisionError.

that snipset will fix that issue "quick an dirty"

'
physical_height_diff = image1.physical_shape[0] - image2.physical_shape[0]
if physical_height_diff < 0:  # image2 is bigger
    img = image2
elif physical_height_diff > 0:
    img = image1
    pixel_height_diff = abs(int(round(-physical_height_diff * img.dpmm / 2)))
    img.remove_edges(pixel_height_diff, edges=('top', 'bottom'))

physical_width_diff = image1.physical_shape[1] - image2.physical_shape[1]
if physical_width_diff > 0:
    img = image1
**elif physical_width_diff < 0:
    img = image2
    pixel_width_diff = abs(int(round(physical_width_diff*img.dpmm/2)))
    img.remove_edges(pixel_width_diff, edges=('left', 'right'))`

best regards

jrkerns added a commit that referenced this issue Feb 22, 2023
Pre-commit 🤯

Approved-by: Randy Taylor
@LuisOlivaresJ
Copy link
Contributor

Hi,

This issue was fixed on #455. I suppose this issue could be closed.

@jrkerns
Copy link
Owner

jrkerns commented Jun 22, 2023

Thanks

@jrkerns jrkerns closed this as completed Jun 22, 2023
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

No branches or pull requests

3 participants