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

CLI option "quality" for the "convert-svg-to-jpeg" does not work #65

Closed
zdenko opened this issue Aug 29, 2019 · 2 comments
Closed

CLI option "quality" for the "convert-svg-to-jpeg" does not work #65

zdenko opened this issue Aug 29, 2019 · 2 comments

Comments

@zdenko
Copy link

zdenko commented Aug 29, 2019

The package convert-svg-to-jpeg has incorrect CLI settings for the quality argument option.

Error example:

$ convert-svg-to-jpeg --quality 70 --width 2000 --height 2600  tmp/test2.svg
convert-svg-to-jpeg failed: Error: Expected options.quality to be a number but found string

It seems that method getCLIOptions of the JPEGProvider class doesn't return correct values.
I think that instead of

  getCLIOptions() {
    return [
      {
        flags: '--quality <value>',
        description: `specify quality for ${this.getFormat()} [100]`,
        parseInt
      }
    ];
  }

it should be

  getCLIOptions() {
    return [
      {
        flags: '--quality <value>',
        description: `specify quality for ${this.getFormat()} [100]`,
        transformer: parseInt
      }
    ];
  }
@ethubert
Copy link

ethubert commented Oct 9, 2019

Agreed, found the same bug when running tests, needs a PR

@neocotic neocotic mentioned this issue Apr 28, 2022
neocotic added a commit that referenced this issue Apr 28, 2022
* **Breaking Change:** All packages now require Node.js version 12.20.0 or newer
* Support UTF-8 characters in SVG
* Support SVG dimensions (width, height) that use `pt` units
* Add `rounding` API and CLI option to control how dimensions are rounded (defaults to `"round"`)
* Fix [CVE-2021-23631](https://nvd.nist.gov/vuln/detail/CVE-2021-23631) by improving input validation
* `quality` CLI option for JPEG not passed correctly [#65](#65)
* Bump dependencies (incl. major for Puppeteer)
* Bump devDependencies
* Skip inconsistent tests
@neocotic
Copy link
Owner

I'm sorry for the incredibly long delay in replying in responding to you but life sometimes gets in the way of OSS development. I thank you for your patience and, although I'm closing this issue out, I hope you'll be glad to know that I believe this issue has been resolved in with today's 0.6.0 release.

If you continue to have this problem, please raise a new ticket with an SVG to reproduce the problem and, where possible, an expected and actual file of the output. I hope you can understand my delay.

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

3 participants