Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compress not working instead making big size #366

Open
krishnaTORQUE opened this issue Aug 17, 2020 · 0 comments
Open

Compress not working instead making big size #366

krishnaTORQUE opened this issue Aug 17, 2020 · 0 comments

Comments

@krishnaTORQUE
Copy link

Instead of compress or minify the image size, it is making image size bigger.

const imagemin = require('imagemin')
const imageminJpegtran = require('imagemin-jpegtran')
const fs = require('fs').promises

Try 1

await imagemin(['./old/1.jpg'], {
    destination: './new',
    plugins: [imageminJpegtran()],
  })

Try 2

let oldFile = await fs.readFile('./old/1.jpg')
  let newFile = await imagemin.buffer(oldFile, {
    plugins: [imageminJpegtran()],
  })
  await fs.writeFile('./new/1.jpg', newFile)

In both cases image size is increasing. The image size is 175.3 kb after run its become 179.2 kb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant