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
Correctly read the arraybuffer in the development environment after webpack packaging, and correctly process the trimmed output arraybuffer
Current Behavior
Crop the center of the picture with jimp
asyncfunctionsplitImage(buffer){// Load the image from bufferconstimage=awaitJimp.read(buffer);// Get image dimensionsconst{ width, height }=image.bitmap;// Calculate half width and half heightconsthalfWidth=Math.floor(width/2);consthalfHeight=Math.floor(height/2);// Crop and encode each quadrant as base64constlti=image.clone().crop(0,0,halfWidth,halfHeight).getBufferAsync(Jimp.MIME_JPEG);constrti=image.clone().crop(halfWidth,0,halfWidth,halfHeight).getBufferAsync(Jimp.MIME_JPEG);constlbi=image.clone().crop(0,halfHeight,halfWidth,halfHeight).getBufferAsync(Jimp.MIME_JPEG);constrbi=image.clone().crop(halfWidth,halfHeight,halfWidth,halfHeight).getBufferAsync(Jimp.MIME_JPEG);// Wait for all quadrant images to be encoded as base64// const [lt, rt, lb, rb] = await Promise.all([lti, rti, lbi, rbi]);console.log('Image split into quadrants and encoded as base64 successfully.');returnawaitPromise.all([lti,rti,lbi,rbi]);}
Everything is normal in the development environment, but once packaged, an error will occur
It uses the framework of electron-reactboiler-plate, including the configuration of electron, webpack, etc. Packaged as an asar and encrypted the asar file with asarmor
This also happens when sharp is used again. issue: lovell/sharp#3924
Failure Information (for bugs)
(node:22532) UnhandledPromiseRejectionWarning: TypeError: en.read is not a function
at dn (A:\ai-storyboard\resources\app.asar\dist\main\main.js:2:1290045)
at IpcMainImpl.<anonymous> (A:\ai-storyboard\resources\app.asar\dist\main\main.js:2:1294662)
at IpcMainImpl.emit (node:events:513:28)
at WebContents.<anonymous> (node:electron/js2c/browser_init:2:88759)
at WebContents.emit (node:events:513:28)
(node:22532) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
Steps to Reproduce
Context
Jimp Version: 0.22.10
Operating System: Windows 11
Node version: 20.10.0
Failure Logs
The text was updated successfully, but these errors were encountered:
Expected Behavior
Correctly read the arraybuffer in the development environment after webpack packaging, and correctly process the trimmed output arraybuffer
Current Behavior
Crop the center of the picture with jimp
Everything is normal in the development environment, but once packaged, an error will occur
It uses the framework of electron-reactboiler-plate, including the configuration of electron, webpack, etc. Packaged as an
asar
and encrypted theasar
file withasarmor
This also happens when sharp is used again. issue: lovell/sharp#3924
Failure Information (for bugs)
Steps to Reproduce
Context
Failure Logs
The text was updated successfully, but these errors were encountered: