Skip to content

Commit

Permalink
fix(utils): improve compression logic and status details
Browse files Browse the repository at this point in the history
Removed lossless option from format method to enhance flexibility in compression levels. Updated status detail message for better clarity on compression results.

(This commit message was AI-generated.)

Signed-off-by: Jens Oliver Meiert <[email protected]>
  • Loading branch information
j9t committed Oct 7, 2024
1 parent 0c78615 commit cc1087a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const compression = async (filename, dry) => {
execFileSync(gifsicle, ['-O3', filename, '-o', tempFilePath])
} else {
await sharp(filename)
.toFormat(outputFormat, { lossless: true, quality: 100 })
.toFormat(outputFormat, { quality: 100 })
.toFile(tempFilePath)
}

Expand All @@ -61,7 +61,7 @@ const compression = async (filename, dry) => {
} else if (fileSizeAfter > fileSizeBefore) {
color = 'blue'
status = 'Skipped'
details = 'even more compressed'
details = 'already better compressed'
}

if (dry) {
Expand Down

0 comments on commit cc1087a

Please sign in to comment.