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
316 stars 93 forks source link

add multiple icons and texts with a single function #222

Open k2-ux opened 6 months ago

k2-ux commented 6 months ago

Describe the bug I want to set the icons and texts with a single function to achieve something like the image attached

Devlopment environment(please complete the following information):

react-native: 0.72.5 react-native-image-marker : 1.1.x Smartphone (please complete the following information):

Device: emulator & device OS: android (for now) Additional context it is something close to a watermark sample_image

JimmyDaddy commented 6 months ago

Hello, currently no API can set both image and text watermarks at the same time. You can try setting them in separate steps.


let res = await Marker.markText(textOptions);
res = await Marker.markImage({ backgroundImage: { src: res }, ...imageOptions });
MoinVnr commented 4 months ago

How can i add watermarkImages and watermarkTexts in single function so now I'm able to achieve with different function for markImage and markText. @JimmyDaddy

const overlayedImage = await ImageMarker.markImage({ backgroundImage: { src: data.uri, scale: 1, }, quality: 100, filename: 'ImageMarker', saveFormat: 'png', watermarkImages: [ { src: markerLogo, scale: 8, position: { position: Position.topRight, }, }, ], }); // Overlay Marker Text const overlayedText = await ImageMarker.markText({ backgroundImage: { src: data.uri, scale: 1, }, quality: 100, filename: 'TextMarker', saveFormat: 'png', watermarkTexts: [{ text: ${dateTime}\n${locationAddress}, position: { position: Position.bottomCenter, }, style: { color: '#217157', fontSize: 180, fontName: 'Arial', }, }], }); Aslso try below code but not working so please help with this issue.

let res = await Marker.markText(textOptions); res = await Marker.markImage({ backgroundImage: { src: res }, ...imageOptions });

MoinVnr commented 3 months ago

Hey @JimmyDaddy and @k2-ux I want to set both image and text watermarks at the same time in single fuction so please help me with this issue