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

🐛 Fix Mask Image Transformation Issue #10

Merged
merged 4 commits into from
Oct 4, 2024
Merged

🐛 Fix Mask Image Transformation Issue #10

merged 4 commits into from
Oct 4, 2024

Conversation

enisit
Copy link
Contributor

@enisit enisit commented Oct 4, 2024

Description:

  • Removed the condition that prevented the upscaling of the mask image. The transformation is now applied regardless of the mask dimensions, ensuring proper alignment between the original and mask images.

Changes:

  • Modified the iOS Swift file (ReactNativeBackgroundRemover.swift) to apply the mask transformation consistently.
  • Deleted redundant logic that was avoiding the transformation if the mask was smaller than the original image.

Affected File:

  • ReactNativeBackgroundRemover.swift

Why:

This change addresses an issue where smaller mask images would not be scaled correctly to fit the original image, potentially leading to incorrect blending or misaligned masks.

-Added check to avoid producing images with large size
-Use CIContext for proper image conversion process to avoid crashes on some devices
Copy link
Owner

@atlj atlj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@atlj atlj merged commit 6bbd1e0 into atlj:main Oct 4, 2024
4 checks passed
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.

2 participants