react-native-image-marker icon indicating copy to clipboard operation
react-native-image-marker copied to clipboard

Can we arrange two image on side of each other and create a new image?

Open vivekshah-zymr opened this issue 6 years ago • 6 comments

Is your feature request related to a problem? Please describe. I am developing a project where I have requirement like user uploads the 2 picture from gallary and we have to upload it over the S3. So can we do this by using this library?

Describe the solution you'd like Can we arrange selected two pictures side by side and merge them? As we want 1st one on top and second one at bottom of the 1st one.

Describe alternatives you've considered Suggest me any alternative to achive this.

vivekshah-zymr avatar Jul 15 '19 14:07 vivekshah-zymr

@vivekshah-zymr this looks like an image/photo editor library, maybe you can try this.

JimmyDaddy avatar Jul 16 '19 06:07 JimmyDaddy

@JimmyDaddy , Let me put my exact requirement. I am having a requirment where user do a signature on a canvas and then click a picture from the camera. And I need to merge this sign and the clicked image and send it to the backend API without displaying merged image to user. I don't know if your suggested lib work or not for this.

vivekshah-zymr avatar Jul 16 '19 06:07 vivekshah-zymr

Did you mean merging the signature to the picture side by side, not marking the signature to the picture and use it as background?

JimmyDaddy avatar Jul 16 '19 06:07 JimmyDaddy

I mean side by side and not marking the sign to the picture. Attached pic for ref. Screen Shot 2019-07-16 at 12 22 02 PM

This I have send to the API without displaying user, user can see two seperate sign and the clicked image, but not the merged image.

vivekshah-zymr avatar Jul 16 '19 06:07 vivekshah-zymr

This could be a temporary solution:

import React from 'react';
import Marker from 'react-native-image-marker';

const BlankBg = require('./assets/blankBg.png')

const mergeExample = async () => {
  // using a blank image as background, make the photo fill half of it
  const markedImage = await Marker.markImage({
    src: BlankBg,
    markerSrc: 'photo from gallary',
    ...imageOptions
  });
  // then adding the signature to the merged image
  const res = await Marker.markText({
    src: markedImage,
    text: 'signature',
    ...textOptions
  })
  
  upload(res)
}


JimmyDaddy avatar Jul 16 '19 07:07 JimmyDaddy

@JimmyDaddy , Thanks. It worked well.

vivekshah-zymr avatar Jul 17 '19 12:07 vivekshah-zymr