I must make labels with JavaScript, it is simple. I must join a couple of generated images (QR code and product name), and others that never change (company logo).
I have no problem with static images that do not change because they are uploaded to the server.
I am using merge-images (link below) which only tolerates images hosted in the project directory.
https://www.npmjs.com/package/merge-images
How can I generate an image from a link within the project to pass it in the mergeImages src?
import logo from './logo-left.jpg';
import backg from './back.png'
const qrCode = "www.exampleImageLink.test/img"
mergeImages([
{src: backg },
{src: logo, y: 50, x: 20},
{src: qrCode, x: 600, y: 55},
]).then(b64 => setImg(b64));
logo
and backg
are inside my directory in the project, but qrCode
changes because it is generated with another function that returns a link to the image of the qr code