I am exporting typed and image signatures using exportSignatures(), wherein I get a String value similar to the following for each one:
[
"data:image/png;base64,qwerty...",
"data:image/png;base64,asdfgh..."
]
Whenever I try to load typed and image upload signatures back using importSignatures(signatureArray), the imported signatures are of much lower quality, and have a slight transparency on the entire image.
Is there a setting in the importSignatures to make it use the original quality?
If I try to parse and load only the actual base64 content (qwerty or asdfgh), it doesn't work.
But if I also try to decode just the base64 using an external decoder I am able to get the original quality of the image.
Here is a sample image of the original (left) and exported-imported (right) signatures:
The code I used to export/import the signatures are similar to the samples in the official documentation:
const signatureTool = docViewer.getTool('AnnotationCreateSignature');
const signatures = signatureTool.exportSignatures();
// save signatures to database as string array
// get signatures from database as string array
const signatureTool = docViewer.getTool('AnnotationCreateSignature');
signatureTool.importSignatures(signatures);
Would you be able to share the code snippet on how to reproduce this? Or would you be able to share a screenshot of the resulted signature? We haven't had such an issue reported before.
Related
I want to manipulate an image with pure NodeJS
I can't find a way how to get the pixel data of an image. I can get the buffer and base64 of the image. I found many libraries that provide this functionality, but I can't reproduce it myself. I thought this was easy to do because in JavaScript we have a Canvas which gives any information about an image and is easy to manipulate
Here is my code:
var fs = require('fs');
fs.readFile('cat.png', (e,image) => {
console.log(image.toString('base64'));
})
May be here is another way how to read the image?
If this is not possible with pure Node JS, could you please explain to me:
Why?
How do other libraries work with images?
Here’s what I’m trying to do:
Download a tiny placeholder image axios.get(imgUrl, { responseType: "arraybuffer" }).
Remove exif data (ICC profile). This is the tricky bit.
BASE64 encode it Buffer.from(img.data, 'binary').toString('base64').
Cache for later use.
Some images have an Adobe ICC profile attached to them which adds significantly to the size, and thus I’d like to remove it before encoding.
I’m able to work with the exif data on the original image. But if I use query params on the URL to change its size ?w=20 I can’t access the Exif data anymore, I’m just reminded that there is no exif data. I use node-exif. The exif data clearly is there still, since the created BASE64 string is as large as before.
If I look into the buffers Buffer.from(img.data, "binary").toString("utf8", 0, 370) I see they look very different. This is the original image which I can read the exif from:
����;ExifMMb(1!r2��i��-��'-��'Adobe Photoshop 21.1 (Macintosh)2020:03:25 10:35:31������"HH����
Adobe_CM��Adobed����
Here's the resized image that claims to contain no exif data:
����JFIF,,��`ICC_PROFILEPapplmntrRGB XYZ �
acspAPPLAPPL���-appldescPbdscm�6cprt�#wtptrXYZ$gXYZ8bXYZLrTRC`
aargl vcgt�0ndin�>chad�,mmod((bTRC`
gTRC`
aabgl aaggl
What do you think is happening when the image is resized?
Here's a demo of the problem: https://codesandbox.io/s/goofy-sea-68eny?file=/src/index.js
I need some help on implementing a data uri scheme image decoder, I get a url with a string containing image encoded in base64
with something like this: :
"data:image/jpeg;base64,/9j/4AAQSkZJ.....TY3OD=="
Is there an existing decoder or an example on how to implement it in picasso?
I'm currently using a modified version of the "Displaying Bitmaps Efficiently" example, but the caching is really basic.
Thanks in Advance.
Roberto.
I am trying to upload and image to cloudinary by passing binary data of an image or base64 string. when i try to pass a base64 string as a data uri I am getting a error with the response of status code 502. but it works fine with small base64 strings.
This works fine
res = cloudinary.uploader.upload("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")
whereas when I pass some lengthy string it fails with 502 status code.
Might be because the uri cannot handle large value. Is there any other right way for passing lengthy strings?
or how can i pass a binary data as a input to the cloudinary?
I'm Itay from Cloudinary.
In order to understand this issue better we'll need to take a deeper look at your account. We'll need some more information like your cloud name, timestamp of the fault uploads and more.
If you prefer this to be handled more privately, you're more than welcomed to open a support ticket (http://support.cloudinary.com/tickets/new) and we'll be happy to assist.
I create a binary input stream using some js trickery which contains compressed image data like jpeg or gif. I want to decode and display this data either using imgITools::decodeImageData or some other way but couldn't find a way yet. Where should I start?
The easiest way is to read the image data into a string, base64 encode the string, then turn that into a data: URL and set that as the src of your image. Unfortunately stackoverflow won't let me create a live data: link, but it would look like this:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAMklEQVRIx2NgGAWjYBQMFXAFDRMrR5GF/6H4CglyoxaOWjhq4aiFg7hoGwWjYBTQDgAAy8VWOfRR6fkAAAAASUVORK5CYII="