How to search google images directly with base64 url? - fabricjs

Hi I am making an online image editor using fabric js.
I am trying to show the user an image similar to the canvas that the user has worked on by importing it from Google and the canvas can be converted to a base64 url ​​through toDataURl().
At this time, to get the image search result corresponding to this, https://www.google.com/searchbyimage?image_url={base64url} I enter the following address, but an error occurs.
How to fix the base64 url ​​to get the desired image result search

Related

Image gets cropped while replacing image in google docs using google doc api

I'm trying to replace the image using google doc api. Image is replaced but it takes the dimensions of previous and so gets cropped.
I also tried by providing height and width but it didn't work.
When I reset the image manually in google doc then the full image is showing in doc and after reset image, its height and width can be changed accordingly. But google doc API did not provide an option to reset image.
Here is a little code which replaces the image in a Google doc :
"replaceImage": {
"imageObjectId": IMAGE_ID",
"uri": REPLACED_IMAGE_URL,
"imageReplaceMethod": IMAGE_REPLACE_METHOD,
}
Is there any possible way to replace the image so that it can replace the previous image properly.
Thanks.
I don't think it is possible to avoid cropping when using the replaceImage request. As it can be seen in the official documentation, the only valid value for imageReplaceMethod is CENTER_CROP, which "Scales and centers the image to fill the bounds of the original image. The image may be cropped in order to fill the original image's bounds. The rendered size of the image will be the same as that of the original image.".
I hope this is of any help.

Froala Editor - Converting image to base64 and sending email using nodemailer. For bigger images it is not working

we have a licensed version of froala. And we are trying to send the editor content as RTF mail.
Right now there is no option to get the content as RTF. Froala is giving it as HTML.
So we are using image.beforeUpload method and converting the image to base64 and sending the content to email.
For small size images it is converting and working fine. But If I convert a bigger image the base64 is very big, So the image is not showing in the email.
Can you provide any solution for the problem? How can I send images and videos embedded inside the froala editor to mail?
Is there any option to retrieve the content as RTF from froala itself.

Fabric canvas text to read html tag

I am trying to make a image editor like yourquote.
I am using fabric js for editor.
I am doing it on website not app.
I have used 2 different url. On first url I want user to enter text and on second url I am letting the user decorate the text and make it image.
My regular text is working as I am posting the text to url, but when I am maintaining line break it is not working.
How can it be possible ?
Its solved
I added '\n' after each line break and sent the final string to next URL and the fabric js canvas loaded exact what I wanted.

Node.js how to download webp image

It´s very easy to download images via the request module. But this is only working for me when then end of the url contains .jpg or .png
But how can you download as example this image?
https://lh3.googleusercontent.com/VpoWDgQ2I_RlTNM1Srlo5Q0VQglr-gdbzJ48TwYRXM2U4iF75PMrv76rBiu5c3l1UJs=s180-rw
Does anybody know a method to download the image as .jpg?
I found a solution on howtogeek
"Click the URL bar, delete the last three characters in the address (the “-rw”), and then press “Enter.” The same image will be displayed again, but this time it’s rendered in its original format, usually JPEG or PNG."

Display image in a packagedapp/extension after selecting from Google Drive

My packaged app gets images from google drive and then display them on the side. But I can't get the images to be displayed. I am trying to get the url of the image so that I can put that url in an image source. The image url that I am getting is actually an html page rather than jpeg, png etc. I have looked at the reference guide for google picker but nothing seems to work.
I am using this
function pickerCallback(data) {
if (data.action == google.picker.Action.PICKED) {
var fileId = data.docs[0].id;
fileName = data.docs[0].name;
imgURL = data.docs[0].url;
}
I want to use imgURL as the source for image selection but imgURL is not something like "https//:www.example.com/image.jpg. It is rather an html page I want something that ends with file type only then it will be able to display the image. Please let me know how can I get the image to be displayed in html page of my packaged app after selecting it from google drive.
You should fetch the metadata of the image, then use the webContentLink of the image, then the user can view it in a logged in browser. See the documentation on downloads for more information.

Resources