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

downloadProgress not getting called #276

Open
1 task done
ihafkyrockrabbit opened this issue Mar 8, 2024 · 3 comments
Open
1 task done

downloadProgress not getting called #276

ihafkyrockrabbit opened this issue Mar 8, 2024 · 3 comments

Comments

@ihafkyrockrabbit
Copy link

Current behavior

  • The console log nor the onProgress callback are logging out to the console

Expected behavior

  • downloadProgress should get called with the progress from 0 to 100 in increments of 10 and be able to report out to the console log or update the UI through the onProgress callback.

Platform

  • iOS

React Native Version

"react-native": "0.72.7",

React Native Compressor Version

"react-native-compressor": "^1.8.24",

Reproducible Steps And Demo

  • The progress bar should slowly fill with green:
    no-progress
import { Image as CompressorImage } from 'react-native-compressor'

const compressImage = async (
  imageUri: string,
  onProgress: (p: number) => void
) => {
  try {
    const compressedImageURI = await CompressorImage.compress(imageUri, {
      progressDivider: 10,
      downloadProgress: (progress: number) => {
        console.log("Progress " + progress)
        onProgress(progress)
      },
    })

    return compressedImageURI
  } catch (error: any) {
    return '' 
  }
}

export default compressImage
Copy link

github-actions bot commented Mar 8, 2024

👋 @ihafkyrockrabbit
Thanks for opening your issue here! If you find this package useful hit the star🌟!

@ChristopherGabba
Copy link

@ihafkyrockrabbit are you using Expo? If so, what version are you using?

@ihafkyrockrabbit
Copy link
Author

@ihafkyrockrabbit are you using Expo? If so, what version are you using?

We are not using Expo.

We are using:
"react-native": "0.72.7",
"react-native-compressor": "^1.8.24",

Let me know if you need any other deps!

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

2 participants