mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: integer problem
This commit is contained in:
parent
4bee340d24
commit
ef01c37cdf
1 changed files with 2 additions and 2 deletions
|
|
@ -67,8 +67,8 @@ async function resizeAndCropImage (inputFilePath, outputFilePath, size = 512) {
|
|||
const maxDimension = Math.max(metadata.width, metadata.height)
|
||||
logger.mark(`original picture size is ${metadata.width} x ${metadata.height}`)
|
||||
// Calculate the required dimensions for the output image
|
||||
const outputWidth = size * metadata.width / maxDimension
|
||||
const outputHeight = size * metadata.height / maxDimension
|
||||
const outputWidth = Math.round(size * metadata.width / maxDimension)
|
||||
const outputHeight = Math.round(size * metadata.height / maxDimension)
|
||||
|
||||
// Resize the image to the required dimensions
|
||||
await sharp(inputFilePath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue