-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should add the ability to access photos via file #2
Comments
@eienmojiki206 How about I add two parameters |
@SOME-1HING Sounds good. But I strongly recommend editing the API so it can be more consistent. I'm assuming that the user wants to download an image from the Internet and then pass it into the API (Since the API doesn't always accept all image link formats), they might want to use the following code: const fs = require("fs");
const url = "https://google-reverse-image-api.vercel.app/reverse";
const data = new FormData()
const image = fs.createReadStream('/path/to/image')
data.append('image', image); // instead of "imageUrl"
fetch(url, {
method: "POST",
body: data,
})
.then((response) => {
if (response.ok) {
return response.json();
} else {
throw new Error("Could not perform reverse image search.");
}
})
.then((data) => console.log(data))
.catch((error) => console.error(error)); |
Has this been updated in the API? The ability to use a file of an image rather than a link. If so, how can I use it? |
@AryanPadmanabhan I've been pretty busy lately, but I've still been trying to make some progress. However, I'm running into some problems when using the image buffer. If anyone has any experience with this and can help me out, I'd really appreciate it! Feel free to submit a pull request (PR) if you have a fix. |
Add the ability to access photos through files for ease of use in many situations
The text was updated successfully, but these errors were encountered: