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

[Bug]: Cropzoom iOS image show as blurry image #79

Open
RuchiraSwarnapriya opened this issue Dec 19, 2024 · 2 comments
Open

[Bug]: Cropzoom iOS image show as blurry image #79

RuchiraSwarnapriya opened this issue Dec 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@RuchiraSwarnapriya
Copy link

Summary

In my application, I am using CropZoom to crop images. However, on iOS, when I navigate to that screen, the image initially appears blurry.

To fix this, I added a 10-millisecond delay before loading the CropZoom component, and it works perfectly now.

Simulator Screenshot - iPhone 16 Pro - 2024-12-17 at 10 35 58


  const [isScreenLoaded, setIsScreenLoaded] = useState(false);

  useEffect(() => {
    // Simulate screen loading completion
    setTimeout(() => {
      setIsScreenLoaded(true);
    }, 100); // Adjust timeout as needed or remove if unnecessary
  }, []);

{!isScreenLoaded ? (
        <View style={styles.imageContainer} />
      ) : (
        <View style={styles.imageContainer}>
          <View style={styles.root}>
            <CropZoom
              ref={cropRef}
              cropSize={cropSize}
              maxScale={3}
              resolution={resolution}
              OverlayComponent={renderOverlay}
            >
              <Image source={{ uri: item.location }} style={styles.image} resizeMethod="scale" />
            </CropZoom>
          </View>
        </View>
      )}

Environment

"react-native-zoom-toolkit": "^4.0.0"

Steps to Reproduce

No response

@RuchiraSwarnapriya RuchiraSwarnapriya added the bug Something isn't working label Dec 19, 2024
@Glazzes
Copy link
Owner

Glazzes commented Dec 19, 2024

Hi @RuchiraSwarnapriya, could you please share me the image you're using? As far as I'm concerned this is a problem with iOS calculations for the image size, I never took the time to experiment before, might as well give it a look now.

As a temporary or definitive fix you could switch to Expo Image, someone reported the problem dissaperaed as soon as they made the change.

@RuchiraSwarnapriya
Copy link
Author

Hi @Glazzes, I'm using iOS simulator images.
Simulator Screenshot - iPhone 16 Pro - 2024-12-19 at 10 43 02

Yeah, Sure I'll try with Expo Image.

Thanks for the quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants