You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
This is my code block
transforms: [
{
id: 'original',
key: function (req, file, cb) {
SHA256(Date.now().toString() + Math.random().toString()).then(Hash => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Hash +'.webp');
}).catch(err => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Math.random().toString() +'.webp');
})
},
transform: function (req, file, cb) {
cb(null, sharp().webp());
},
},
{
id: 'thumbnail',
key: function (req, file, cb) {
SHA256(Date.now().toString() + Math.random().toString()).then(Hash => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Hash +'.webp');
}).catch(err => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Math.random().toString() +'.webp');
})
},
transform: function (req, file, cb) {
cb(null, sharp().resize(100, 100).jpg())
}
}
],
Now the issue is what i want is thumbnail image name to be original-thumbnail.
but as there is no way to pass variables, it's not possible for me to do this.
Is there any way to achieve this ?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is my code block
transforms: [
{
id: 'original',
key: function (req, file, cb) {
SHA256(Date.now().toString() + Math.random().toString()).then(Hash => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Hash +'.webp');
}).catch(err => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Math.random().toString() +'.webp');
})
},
transform: function (req, file, cb) {
cb(null, sharp().webp());
},
},
{
id: 'thumbnail',
key: function (req, file, cb) {
SHA256(Date.now().toString() + Math.random().toString()).then(Hash => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Hash +'.webp');
}).catch(err => {
cb(null, new Date().toISOString().slice(0, 10) + '-' + Math.random().toString() +'.webp');
})
},
transform: function (req, file, cb) {
cb(null, sharp().resize(100, 100).jpg())
}
}
],
Now the issue is what i want is thumbnail image name to be original-thumbnail.
but as there is no way to pass variables, it's not possible for me to do this.
Is there any way to achieve this ?
The text was updated successfully, but these errors were encountered: