{"_id":"@byron-react-native/image-blur","_rev":"3-6214627f9bacc6c48f3edcb0a5c727b7","name":"@byron-react-native/image-blur","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@byron-react-native/image-blur","title":"React Native Image Blur","version":"1.0.0","description":"React Native Image Blur","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/472647301/react-native-image-blur.git","baseUrl":"https://github.com/472647301/react-native-image-blur"},"keywords":["react-native"],"author":{"name":"Byron","email":"byron.zhuwenbo@gmail.com"},"license":"MIT","licenseFilename":"LICENSE","peerDependencies":{"react":">=16.8.1","react-native":">=0.60.0-rc.0 <1.0.x"},"devDependencies":{"react":"^16.9.0","react-native":"^0.61.5"},"types":"./index.d.ts","gitHead":"ede72008da667a32dae08ab8d7349464c3413ddd","bugs":{"url":"https://github.com/472647301/react-native-image-blur/issues"},"homepage":"https://github.com/472647301/react-native-image-blur#readme","_id":"@byron-react-native/image-blur@1.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-2AEX4Csd9ilwApAptkfkpdEG9sps1I4uSh+evNqLtZi1iw1L4ZBrSC5jXAjXDDBsLItrTIYo/5aVoo7OsNIkhg==","shasum":"3cbfeb4a0cd61e33e00fcee21dd0876ac764078f","tarball":"https://registry.npmjs.org/@byron-react-native/image-blur/-/image-blur-1.0.0.tgz","fileCount":18,"unpackedSize":83482,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeycpY7vPK1TbMnEvDfJI/3Em3J9IkH2ZL9pDdQL7ZYgIgAd5rqn4Ck+EtLVbWjnrPhuTtZpr1OpXWAdXmOi0P7Gg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisZWRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphAw//QcD45kXVJceKZYbMD0lQT7rxsAy+tglBrlQpc8yP4yU1NeMi\r\nhec+Jc7z3sp9IK935KQGwiWKT4RmrcZ61aNDVXTfpTk7hThAMQe9Ukrcviwc\r\nXjSw47SRM5j9YpCE+YefFdsHxKLm5sRxl19kdznBEpSAtkGHDlBHzqmlgqfe\r\nmXcb8jn7VLJDcTLFF8qt1Up7UqQ66vwf8G39rDv5hytB/9ex/F0Fr+hIBlap\r\nCtY1H9CTm/DOSMkdaleXpaIipYtfUm3lrNLdV86MUScwvPdGxVANlU2IevIy\r\nL1Xs9vjhh3qRkOC13tROfQfz+XwcZB6Hzu8sd0K0E/z3t2MkaT7tlnb7Z+gh\r\nif1/3RIiZYulq5mr2yK0Eke6NTtnAcC3VhrQX7QYkxEOGRj/W1ROwhUCxTJq\r\n/J68128+XY7k0W2BRNsQyUN8fKrGXcrtrCyLgr83N7X4bE/OFweE6ksks71T\r\n4IE/kKprs/JCwpEZ6I81rTIuUjmZTyN6R1LqBtVtXVnCDJ0xWTLDjYMimXJd\r\nVoVN5iIvzyHmlThtLQDjBmrIu6mM0JvTlWNQQSdK7xLqq5jVf8/+flnIQXfC\r\nLnx6NG6GB/MYZngFwPTJCYNxRMB4gp2fgc6f07Pnu4FNJjB2ZcWIsedIwpm8\r\nr9CKMXcuMtc4wJWCeTnCgFFU4ynWmPZilJ0=\r\n=nkRk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"},"directories":{},"maintainers":[{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-blur_1.0.0_1655805329338_0.6275873433821828"},"_hasShrinkwrap":false},"1.0.1":{"name":"@byron-react-native/image-blur","title":"React Native Image Blur","version":"1.0.1","description":"React Native Image Blur","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/472647301/react-native-image-blur.git","baseUrl":"https://github.com/472647301/react-native-image-blur"},"keywords":["react-native"],"author":{"name":"Byron","email":"byron.zhuwenbo@gmail.com"},"license":"MIT","licenseFilename":"LICENSE","peerDependencies":{"react":">=16.8.1","react-native":">=0.60.0-rc.0 <1.0.x"},"devDependencies":{"react":"^16.9.0","react-native":"^0.61.5"},"types":"./index.d.ts","gitHead":"ede72008da667a32dae08ab8d7349464c3413ddd","bugs":{"url":"https://github.com/472647301/react-native-image-blur/issues"},"homepage":"https://github.com/472647301/react-native-image-blur#readme","_id":"@byron-react-native/image-blur@1.0.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-Y4C35qb3ExpvEwM8kBJZceYatpNbPlbG4UwhQ1rEhCQcz2blsd4lqpmB297w3UEjrpoB4QdevtJyvkAe7fV6bQ==","shasum":"345cb1048a5e853e0ec92119e85f2f3f30412d6e","tarball":"https://registry.npmjs.org/@byron-react-native/image-blur/-/image-blur-1.0.1.tgz","fileCount":25,"unpackedSize":196080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASfu5j/UmGJ+D698jOJA/Re6vZezXnuytgza+pkL3zlAiEAukl0fmDfPiCwQRt607OLNPcD/DHiI0RpUTDrGFfvcsI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3l2mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/gA//ZkiyliiEDbrlGBqOH/M3bWi1XWZEHWvZxHPwR1R64QYWIzy/\r\n6J5eaOnCoUeHMOD9cKX1BnH+QCRhQ2QvTcaijQQpx6+0RcRkDQjlVuxU/1KZ\r\nJOS7KN6N4VFF2EKu+GYz82GJKCqtzBuVN9DwzGOO5/Qnt8UE0nF9w0mEhegn\r\nt0nGPPHa6NL7ZiisQWaeqqc2A1Z1OMsRgNXZW0vMSE0sngE2PHMRmcZpWtDw\r\nVxx0n080czWxCb3Xbt3Ip3siQJfwTAT5+rGsM2VpWp1o/HVe+CbdGAnN82SH\r\nVXmvXNw1WiFEIrB4CsZQUbtMjpisD0+KuXKMwSQmVjA4MJJJxa92a74qxdj5\r\nmFqeD26MBTdk1/MXDVFaMwP/AzNljcZCBPKOWq22rIm47vUJPLcRWJcvED64\r\nQk20C05u9KrD5sQ2gDCy+bBbzCGQdz3BsuqgPxxySNFsY2zzBYoc5Q5jvaWi\r\njLdEB7ynNkQvrJZR8bgUEKaxmFe3rmJfq2hEuk1GtT1xD7NSWEeX1uEToiUh\r\nG+ity29pOpF+1PdlRd07ek0x9nmNoZQz48VR5F0+XNFuME9rTjI4MMDpysox\r\nxflkAj3oYt9DPNYfx3naEngECID3KFgZ2YUtyH/RW7EzxuXzPiJoDTc9XChn\r\nqjWS4R4ayoLslOEYU293ovGGwc2TGGkxXTc=\r\n=c77o\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"},"directories":{},"maintainers":[{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-blur_1.0.1_1658740133779_0.9330681210514862"},"_hasShrinkwrap":false},"1.0.2":{"name":"@byron-react-native/image-blur","title":"React Native Image Blur","version":"1.0.2","description":"React Native Image Blur","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/472647301/react-native-image-blur.git","baseUrl":"https://github.com/472647301/react-native-image-blur"},"keywords":["react-native"],"author":{"name":"Byron","email":"byron.zhuwenbo@gmail.com"},"license":"MIT","licenseFilename":"LICENSE","peerDependencies":{"react":">=16.8.1","react-native":">=0.60.0-rc.0 <1.0.x"},"devDependencies":{"react":"^16.9.0","react-native":"^0.61.5"},"types":"./index.d.ts","gitHead":"ede72008da667a32dae08ab8d7349464c3413ddd","bugs":{"url":"https://github.com/472647301/react-native-image-blur/issues"},"homepage":"https://github.com/472647301/react-native-image-blur#readme","_id":"@byron-react-native/image-blur@1.0.2","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-abRJ6Cvb4WUqv1O0cho4wG220yPBoCFUHoV+Vr/1NHduVeQ8CteDWaaxCcWNtQ+DEt4S6LfH7LtxMd7MOtSt2w==","shasum":"401d1dac5e7ce4268d2c17202fb053a6370d5f5e","tarball":"https://registry.npmjs.org/@byron-react-native/image-blur/-/image-blur-1.0.2.tgz","fileCount":25,"unpackedSize":196228,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqE6PeGrtX+PvR+LOoAuXszoDkFjEy8C0BuRNsfduWQQIhAIMGdKI8NUG26geuNRwySOhUXh2lyUqEYg1yTgOKj4hV"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3mUsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/UBAAgM1hQZvGQt7yr7i7M//JModQUaB4cBw+uAgp5jFQgypZIFjd\r\nU8sNsSqq9i/0f8A3oDDCJeP96ElBC6eiO9codtum+VEw15J7tqQmBZAzu83A\r\nsBem+YIniKxcNPAW+CEzH7neC4qUfUetfHXeHyFT4PsoSAGx2ONnudyWcin8\r\nZTlQvJzUMQmoMKTk+s4n7SLROurh8vUJUtGgAb6gYynMcsCZSRtqCJo1ITa0\r\nVYMhGGR1InONygYIiO0JN/9kaa5iXcK1w0P5OpbvZ7oG+z6B+4JgVYjf6uVE\r\nYBmyADotYBx3BUiGDA08DaaP+F0Mo2rZMHsmRSiN3Msln/4QhF6njKOTzWPP\r\n5zbfxuuBTe7/MD37NTugLslLY71RjG/3kTzRUOGPQ9succrErxnDv6HMFzOf\r\nmtmOLhIvqDw5Xg4JpAaqt9+LISRNiyPQUVc+fP4ZCqOaTvPO1Tpud0c/I0h0\r\n7o/2yYLtF7CzZ7WFivdQpl1H2vhUGuQxHGZF1Yvn/j7d2RY9gEg5bp8jwIA6\r\nUjUGnL49YkJOY1GyPZ/5X4Qc0SsJUyVMyOQIyKpP92d2zE8QAYpLq/cuq+Cy\r\n4xVHvnEhtIrz2Dd1L1v5u8u0mR6tHyosqDdVoWuPxo4ySpyF2omtMl94d23i\r\nAlccCQC5pDvnkjFtSQJyYKcuGPmrmkCycq8=\r\n=7dsK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"},"directories":{},"maintainers":[{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-blur_1.0.2_1658742060556_0.1864868567179725"},"_hasShrinkwrap":false},"1.0.3":{"name":"@byron-react-native/image-blur","title":"React Native Image Blur","version":"1.0.3","description":"React Native Image Blur","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/472647301/react-native-image-blur.git","baseUrl":"https://github.com/472647301/react-native-image-blur"},"keywords":["react-native"],"author":{"name":"Byron","email":"byron.zhuwenbo@gmail.com"},"license":"MIT","licenseFilename":"LICENSE","peerDependencies":{"react":">=16.8.1","react-native":">=0.60.0-rc.0 <1.0.x"},"devDependencies":{"react":"^16.9.0","react-native":"^0.61.5"},"types":"./index.d.ts","gitHead":"986e98b0290ca77c6133f585890916f895b7f8c8","bugs":{"url":"https://github.com/472647301/react-native-image-blur/issues"},"homepage":"https://github.com/472647301/react-native-image-blur#readme","_id":"@byron-react-native/image-blur@1.0.3","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-XffW8TvR5rmVaqQ0IpmyjZyxr+oI6I5LfrdahHXGLqwMpgXs26cmOtwSSXqS6khtKAhIYuSh65/33HvMEsI9lg==","shasum":"a0cf9030126c950ef6e882646139f2baeb7dd152","tarball":"https://registry.npmjs.org/@byron-react-native/image-blur/-/image-blur-1.0.3.tgz","fileCount":25,"unpackedSize":196436,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+ScRwjVd9LFGjTKJmfjN8XR9geIy4hTnOXkJcA/GbjAIhAJ7yCON2H7Wk7TtihYkHUwsXyWZeIcIj8NUzsVh3S+SN"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc1mjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLAQ//XLWyfw5dSCDcmU8edJnZWLpKluYXSZ+noq/kzIGyfCmDFecs\r\n2lmDO16zzlobnFJwsji/7SezKAGrSDkOmUVVOiiLHRyKpCxSfjJoyjFTme0R\r\nMDdc7XcjIbjDLrberSGGjfa7roHfNFanCaX+PF+BCKmtRgMuO5EBnOensXP6\r\neabpW1ZMi58MUFi8mOLxZSKuX/OWpdvj6Mr9t6d7xenQnB70Fpdws6w8ZP07\r\n7xGAwwuG09uaOGpkxJEkOtIeLPg2gxvfQMjlyh+pYKzfNao/6CC0dMQRO4tm\r\nRsW+s/+NrEnSHi8eDGMTtSXUhA5A/NRas8iQaTcOfvLFeu75YAh3Sv8MrAzI\r\n9niGqtkLuKr8CXdbFExZEayc9mjGrnrD6C0j9XphnrSMyjZGhI8C4WQ9aNrs\r\nQVE+F7xzAs9wagDOxtG6Lpayk20eQCG1ZWCT4wBJDtyjekU+clluc+4mzEt5\r\nuAAUtBeSM1Aq2fXXh61VE9EWuA5IxQ4+q8tKqTFP2wTk5zMxkg4MEpI4Y0l5\r\nOPYKkB2ExafcSp7GTZEjriaHEUh5fpvKzIW/CFUrSi/etrygQX5zFeVlIeNh\r\nlf7WUjvGrud0lmJMagoWiHC6rVEb2g5Dpad0vXhaFbs3yBH/ZZDPh9uB6wsR\r\nqqGKiPeYa9LePe+PKfFOOvLhS+PHBYLHMOM=\r\n=zZIB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"},"directories":{},"maintainers":[{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-blur_1.0.3_1668503971126_0.8675343380535547"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-21T09:55:29.263Z","1.0.0":"2022-06-21T09:55:29.516Z","modified":"2022-11-15T09:19:31.407Z","1.0.1":"2022-07-25T09:08:53.983Z","1.0.2":"2022-07-25T09:41:00.847Z","1.0.3":"2022-11-15T09:19:31.318Z"},"maintainers":[{"name":"byronzhu","email":"byron.zhuwenbo@gmail.com"}],"description":"React Native Image Blur","homepage":"https://github.com/472647301/react-native-image-blur#readme","keywords":["react-native"],"repository":{"type":"git","url":"git+https://github.com/472647301/react-native-image-blur.git","baseUrl":"https://github.com/472647301/react-native-image-blur"},"author":{"name":"Byron","email":"byron.zhuwenbo@gmail.com"},"bugs":{"url":"https://github.com/472647301/react-native-image-blur/issues"},"license":"MIT","readme":"# react-native-image-blur\n\n  由于 react-native-blur 与 react-native-screens 使用会产生 Recording currently in progress - missing #endRecording() call 错误。\n[合并了#1406也还是有问题](https://github.com/software-mansion/react-native-screens/pull/1406)，所以决定制作这个库。\n目前只是用于方便自己使用，如有问题欢迎提issues或pull request\n\n  Because react-native-blur and react-native-screens use Recording currently in progress - missing #endRecording() call error.\n[I still have problems with merging #1406](https://github.com/software-mansion/react-native-screens/pull/1406), so I decided to make this library.\nAt present, it is only for your own convenience. If you have any questions, please submit issues or pull requests.\n\n## Getting started\n\n`$ npm install @byron-react-native/image-blur --save`\n\n## Usage\n```javascript\nimport React, {Component} from 'react';\nimport {Platform, StyleSheet, Text, View} from 'react-native';\nimport ImageBlur from '@byron-react-native/image-blur';\nimport {ImageBackground, ActivityIndicator, StatusBar} from 'react-native';\nimport RNFS from 'react-native-fs';\nimport MD5 from 'crypto-js/md5';\n\nconst url = 'https://kaiguang-assets.ibanquan.com/gxuqtvv6tfd4xik9la0ulrl1k6t8';\n\nexport default class App extends Component {\n  state = {\n    uri: '',\n  };\n\n  loadCache = async () => {\n    try {\n      const existsDir = await RNFS.exists(RNFS.CachesDirectoryPath);\n      if (!existsDir) {\n        await RNFS.mkdir(RNFS.CachesDirectoryPath);\n      }\n      const name = MD5(url);\n      const toFile = `${RNFS.CachesDirectoryPath}/${name}.png`;\n      const existsFile = await RNFS.exists(toFile);\n      if (existsFile) {\n        console.log(' >> from cache ', toFile);\n        this.loadBlur(toFile);\n        return;\n      }\n      const saveFile = RNFS.downloadFile({\n        fromUrl: url,\n        toFile: toFile,\n      });\n      const res = await saveFile.promise;\n      if (res.statusCode !== 200) {\n        this.setState({uri: url});\n        return;\n      }\n      this.loadBlur(toFile);\n    } catch (e) {\n      console.log(' >> fs err ', e);\n      this.setState({uri: url});\n    }\n  };\n\n  loadBlur = async fromPath => {\n    console.log(' >> load blur', fromPath);\n    try {\n      const name = MD5(url);\n      const toFile = `${name}_blur.png`;\n      const str = await ImageBlur.blur(fromPath, toFile, 32);\n      console.log(' >> blur res ', str);\n      this.setState({\n        uri: Platform.OS === 'android' ? `file://${str}` : str,\n      });\n    } catch (e) {\n      console.log(' >> blur err ', e);\n      this.setState({uri: url});\n    }\n  };\n\n  componentDidMount() {\n    this.loadCache();\n  }\n\n  render() {\n    if (!this.state.uri) {\n      return (\n        <View style={styles.container}>\n          <ActivityIndicator color={'#000'} />\n        </View>\n      );\n    }\n    return (\n      <>\n        <StatusBar\n          translucent={true}\n          backgroundColor={'transparent'}\n          barStyle={'light-content'}\n        />\n        <ImageBackground\n          style={styles.container}\n          source={{uri: this.state.uri}}>\n          <Text style={styles.welcome}>☆ImageBlur example☆</Text>\n          <Text style={styles.welcome}>☆NATIVE CALLBACK MESSAGE☆</Text>\n        </ImageBackground>\n      </>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#F5FCFF',\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 10,\n    color: '#fff',\n  },\n});\n\n```\n## Screenshot\n\n<img src=\"https://github.com/472647301/react-native-image-blur/blob/main/example/screenshot.png?raw=true\" width=\"1038\">","readmeFilename":"README.md"}