Comments (6)
thank you renanbastos93,
actually there is no space in the urls but i will look into it.
apparently the issue is not related to image-to-base64.
from image-to-base64.
your error way line /usr/src/app/handlers/emails.js:87:33
Can you show name uses? Please, post here code from example.
from image-to-base64.
const items = order_items.map(async item=>{
const price = (item.product.price - (item.product.price*item.product.discount/100))
const image = https://backend.rover.micota.com.tr/build/img/${item.product.image[0].path}.jpeg
const decodedImage = await imageToBase64(image)
return (
`<div style="border-style: solid">
<img style="width:150px" src="data:image/jpg;base64,${decodedImage}">
<p><span>${item.product.name}</span></p>
<p><span>${item.qty} Adet</span></p>
<p><span>${price} TL</span></p>
</div>`
)
})
item.product.image[0].path = "Supla_Beyaz1"
from image-to-base64.
I tested it and worked well, but I made a code a little different.
Why I change it? because I see one point
you don't treat
item.product.image
length
var order_items = [
{
product: {
name: "test",
price: 1,
discount: 0,
image: [{
path: "Supla_Beyaz1"
}]
},
qty: 1
}
]
let items = order_items.map(async item=>{
let price = (item.product.price - (item.product.price*item.product.discount/100))
let image = "";
let decodedImage = "";
if (item.product.image.length > 0 && item.product.image[0].path) {
image = `https://backend.rover.micota.com.tr/build/img/${item.product.image[0].path}.jpeg`
}
decodedImage = await imageToBase64(image)
return `<div style="border-style: solid">
<img style="width:150px" src="data:image/jpg;base64,${decodedImage}">
<p><span>${item.product.name}</span></p>
<p><span>${item.qty} Adet</span></p>
<p><span>${price} TL</span></p>
</div>`
})
from image-to-base64.
thank you very much.
you are right, but i am sure that image is there because this endpoint is only posted with a product being present and every product has an image.
so your code doesn't make a difference. my code worked for months, it only gave this error this morning and now it is working again and i don't know what happened and how it started working again.
now i am afraid if it is going to give this error again in the future: code: 'ERR_UNESCAPED_CHARACTERS'
do you know what is this error about?
from image-to-base64.
wow, so this problem ERR_UNESCAPED_CHARACTERS
normally raises when to try request a URL with spaces then you must escape it or unsupported file extension.
https://nodejs.org/api/errors.html#errors_err_unescaped_characters
from image-to-base64.
Related Issues (20)
- Invalid base 64 string [Help Wanted] HOT 1
- one typo in README.md HOT 3
- is there way I can run it synchronously? HOT 5
- Error message not meaningful HOT 3
- Cors-Policy Error HOT 1
- Typescript support HOT 5
- Create a new release and publish on NPM HOT 1
- e.buffer is not a function HOT 9
- How to return the Base64 from object imageToBase64 HOT 1
- statSync issue due to too large image size HOT 9
- don't have time to take care of him, Can someone take care of it? HOT 3
- invalid regular expression in safari HOT 6
- Cannot find module 'fs' in 'image-to-base64' HOT 4
- CORS error when using imageToBase64 HOT 1
- Cannot find module 'fs' in 'image-to-base64' HOT 1
- Invalid regular expression: invalid group specifier name HOT 2
- Base64 image converter is not valid HOT 5
- CORS policy: No 'Access-Control-Allow-Origin' in react js HOT 1
- Blank Page in Safari : Create React APP project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-to-base64.