numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
949 stars 93 forks source link

downloadProgress not getting called #276

Open ihafkyrockrabbit opened 8 months ago

ihafkyrockrabbit commented 8 months ago

Current behavior

Expected behavior

Platform

React Native Version

"react-native": "0.72.7",

React Native Compressor Version

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

Reproducible Steps And Demo

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
github-actions[bot] commented 8 months ago

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

ChristopherGabba commented 7 months ago

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

ihafkyrockrabbit commented 7 months ago

@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!