Initial commit

This commit is contained in:
meusinfirmary
2025-04-22 14:33:37 +07:00
commit b9891d2f81
1305 changed files with 452033 additions and 0 deletions

42
public/assets/js/worker/jimp_multiple.js vendored Executable file
View File

@ -0,0 +1,42 @@
importScripts('https://cdn.jsdelivr.net/npm/jimp@0.16.0/browser/lib/jimp.js');
self.addEventListener('message', function (e) {
const { dataURL, importantKey } = e.data;
// dataURL => dataURL
Jimp.read(dataURL)
.then(image => {
var width = image.bitmap.width
if (width > 900) {
width = 900
}
image
.resize(width, Jimp.AUTO)
.quality(60)
.getBase64Async(Jimp.MIME_JPEG)
.then((dataURL) => {
res = {
stts: true,
data: dataURL, // base64
importantKey
}
self.postMessage(res)
})
.catch(err => {
res = {
stts: false,
data: err,
importantKey
}
self.postMessage(res)
})
})
.catch(err => {
res = {
stts: false,
data: err,
importantKey
}
self.postMessage(res)
})
})