JimmyDaddy / react-native-image-marker

🙈Adding text or icon watermark to your image using React Native👀👀
https://jimmydaddy.github.io/react-native-image-marker/
MIT License
325 stars 94 forks source link

When adding font watermark, if src is a path starting with file://, the watermark will not be displayed #90

Closed TomatoesMan closed 1 year ago

TomatoesMan commented 2 years ago

"react-native-image-marker": "^0.6.3", "react-native-image-picker": "^4.10.0", "react-native": "0.69.5",

import {launchCamera} from 'react-native-image-picker'; import ImageMarker from 'react-native-image-marker';

const cameraAction = async () => { const result = await launchCamera({ quality: 0.2, mediaType: 'photo', }); console.log(result, 222) const { assets: [{uri}], } = result; ImageMarker.markText({ src: uri, text: 'text marker', X: 30, Y: 30, color: 'red', // '#ff0000aa' '#f0aa' fontName: 'Arial-BoldItalicMT', fontSize: 22, shadowStyle: { dx: 10.5, dy: 20.8, radius: 20.9, color: '#ff00ff', // '#ff00ffad' }, textBackgroundStyle: { type: 'stretchX', paddingX: 1, paddingY: 1, color: '#0f0', // '#0f0a' }, scale: 1, quality: 100, }).then((res) => { console.log(res, 111) }).catch((err) => { console.log(err) }) }; <TouchableOpacity onPress={() => cameraAction()}>

拍照

<Image style={{width: 300, height: 300}} source={{uri}} />

JimmyDaddy commented 1 year ago

file:///xxx for Android and iOS: 截屏2023-08-07 13 14 45 截屏2023-08-07 13 17 17

thongquach commented 1 year ago

Hi @JimmyDaddy, I'm having the same problem. I'm trying to use a uri or file:///.... as src, then it crashes.

JimmyDaddy commented 1 year ago

Hi @JimmyDaddy, I'm having the same problem. I'm trying to use a uri or file:///.... as src, then it crashes.

Hi @thongquach , can you give me a MRE and crash logs

thongquach commented 1 year ago

I found out the issue: https://github.com/JimmyDaddy/react-native-image-marker/issues/43#issuecomment-510333330

JimmyDaddy commented 1 year ago

I found out the issue: #43 (comment)

Which version are you using?

thongquach commented 1 year ago

I'm using an old version, which is 0.6.3. I intended to use the latest version but encountered some Android build issues.

JimmyDaddy commented 1 year ago

I'm using an old version, which is 0.6.3. I intended to use the latest version but encountered some Android build issues.

Could you please provide your sample code and crash log? I can take a look and see what the specific issue is.

thongquach commented 1 year ago

I first got a complain about node version, mine is 14 and yours is 16. I bypassed using --ignore-engines. Then I got Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0

JimmyDaddy commented 1 year ago

I first got a complain about node version, mine is 14 and yours is 16. I bypassed using --ignore-engines. Then I got Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0

https://stackoverflow.com/questions/67448034/module-was-compiled-with-an-incompatible-version-of-kotlin-the-binary-version