Socket
Socket
Sign inDemoInstall

@resvg/resvg-js-linux-arm64-gnu

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@resvg/resvg-js-linux-arm64-gnu - npm Package Versions

13

2.1.0

Diff

Changelog

Source

[2.1.0] - 2022-07-03

Added

  • Add imagesToResolve() and resolveImage() APIs to load image URL. By @zimond in #102

    • Supports PNG, JPEG and GIF formats.
    • This only works for xlink:href starting with http:// or https://.
    • See example for more details.

    In order to support loading image URL, we forked the rust side of resvg and made some improvements.

    Now please witness the magic moment:

    load image URL Demo

  • Add innerBBox() API. By @yisibl in #105

    Calculate a maximum bounding box of all visible elements in this SVG. (Note: path bounding box are approx values).

  • Add getBBox() API. By @yisibl in #108

    We designed it to correspond to the SVGGraphicsElement.getBBox() method in the browser.

    This is different from the innerBBox() API, by default it does apply transform calculations and gets the BBox with curves exactly. This works well in most use cases, the only drawback is that it does not calculate BBoxes with stroke correctly.

  • Add cropByBBox() API. By @yisibl in #108

    With this API, we can crop the generated bitmap based on the BBox(bounding box).

    <img width="550" alt="cropByBBox Demo" src="https://user-images.githubusercontent.com/2784308/177039185-5c1a8014-9e44-4c18-aae2-8f509163da56.gif">
    const fs = require('fs')
    const { Resvg } = require('@resvg/resvg-js')
    const svg = '' // some SVG string or file.
    const resvg = new Resvg(svg)
    const innerBBox = resvg.innerBBox()
    const bbox = resvg.getBBox()
    
    // Crop the bitmap according to bbox,
    // The argument to the `.cropByBBox()` method accepts `bbox` or `innerBBox`.
    if (bbox) resvg.cropByBBox(bbox)
    const pngData = resvg.render()
    const pngBuffer = pngData.asPng()
    
    console.info('SVG BBox: ', `${bbox.width} x ${bbox.height}`)
    fs.writeFileSync('out.png', pngBuffer)
    
  • feat: upgrade svgtypes to 0.8.1 to support 4 digits and 8 digits hex colors. By @yisibl in #127

Changed

  • feat: return undefined if bbox is invalid. By @zimond in #110
  • chore: use jimp-compact instead of jimp.
  • fix(deps): update rust crate napi to 2.5.0.
  • fix(deps): update rust crate mimalloc-rust to 0.2.
  • chore: export AR in android pipeline.
  • style: rust indent changed from 2 to 4 spaces.
yisi
published 2.0.1 •

Changelog

Source

[2.0.1] - 2022-05-07

Added

  • feat: add bbox related API. @zimond in #90

    This version does not yet implement Node.js or Wasm bindings, so it is not available for now.

Fixed

  • fix: rebuild Wasm to solve the problem of not working in the browser.
yisi
published 2.0.0 •

Changelog

Source

[2.0.0] - 2022-04-30

resvg-js now supports WebAssembly. 🎉

  • You can convert SVG to PNG in the browser or Web Worker
  • We provide Playground for direct use: https://resvg-js.vercel.app

With WebAssembly, resvg-js gains broader cross-platform compatibility, all by loading only about 1.2MB of Wasm files. And, the API is consistent with the Node.js side.

The current version of Wasm does not support loading fonts, so please submit an issue if you have a request.

Added

  • feat: support WebAssembly(wasm32 target) via wasm-bindgen (#51)
  • feat: add WebAssembly playground
  • feat: upgrade resvg to 0.21.0
  • feat: upgrade to napi-rs 2.1.0 (#60)
  • chore: improved error message when output PNG size is 0 (#58)
  • doc: add Node.js and WebAssembly usage documentation (#63)
yisi
published 2.0.0-beta.0 •

Changelog

Source

[2.0.0-beta.0] - 2022-04-02

The resvg-js API is now largely stable.

Changed

  • feat: render() result as a new class

    render() now no longer returns the Buffer directly, you need to get the buffer via the new render().asPng(), also added render().width and render().height to return the size of the PNG.

yisi
published 2.0.0-alpha.6 •

Changelog

Source

[2.0.0-alpha.6] - 2022-03-20

Changed

  • chore: add libc fields on linux platform packages

    On Linux, it is not possible to tell exactly what kind of C library a native modules depends on just by os/cpu, so yarn 3.2 and cnpm added libc fields to further distinguish this case. This avoids downloading both gnu and musl packages at the same time.

    Currently only yarn 3.2+ and cnpm are supported, the npm implementation is still under discussion.

yisi
published 2.0.0-alpha.5 •

Changelog

Source

[2.0.0-alpha.5] - 2022-03-19

Changed

  • feat: rounding width / height, this will further improve #61.

    Physical pixels cannot be decimal, and when SVG dimensions have decimals in them, the output PNG dimensions are rounded. This should be consistent when getting the PNG size through the width / height API.

yisi
published 2.0.0-alpha.4 •

Changelog

Source

[2.0.0-alpha.4] - 2022-03-14

Added

  • feat: strip text features and reduce the size of the generated wasm file.
    • Before: 1949570 bytes
    • After: 1266413 bytes
  • feat: upgrade to napi-rs 2.2.0.
yisi
published 2.0.0-alpha.3 •

Changelog

Source

[2.0.0-alpha.3] - 2022-03-01

Added

  • feat: add .width and .height to get the original size of the SVG.
  • feat: add toString() to convert SVG shapes or text to path.

Changed

  • refactor: change to Class API, now instead use new Resvg() to create the constructor.

    With the new Class API, we can avoid rendering the SVG again when getting the SVG size. It also makes it easier to extend new APIs.

Before
const { render } = require('@resvg/resvg-js')
const svg = '' // svg buffer or string
const pngData = render(svg, opts)
After
const { Resvg } = require('@resvg/resvg-js')
const svg = '' // svg buffer or string
const resvg = new Resvg(svg, opts)
const pngData = resvg.render()

// New!
console.info('Simplified svg string \n', resvg.toString())
console.info('SVG original size:', `${resvg.width} x ${resvg.height}px`)
yisi
published 2.0.0-alpha.2 •

Changelog

Source

[2.0.0-alpha.2] - 2022-02-21

Added

  • feat: upgrade resvg to 0.22.0

    Support svg referenced by <use>, this is often used in svg sprite.

    <svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
      <svg id="svg1" xmlns="http://www.w3.org/2000/svg">
        <rect width="50%" height="50%" fill="green" />
      </svg>
      <use id="use1" x="50%" y="50%" xlink:href="#svg1" />
    </svg>
    
  • feat: upgrade fontdb to 0.9.0, loading system fonts will become faster.

    There are many CJK fonts installed in my local OS, the test result is 2.5 times faster:

    • Before: Loaded 1085 font faces in 860.447ms.
    • After: Loaded 1085 font faces in 339.665ms.
yisi
published 2.0.0-alpha.1 •

Changelog

Source

[2.0.0-alpha.1] - 2022-02-17

Added

  • feat: playground uses unpkg.com's online resources

    <script src="https://unpkg.com/@resvg/resvg-wasm@2.0.0-alpha.2/index.min.js"></script>
    
  • feat: preload wasm in the playground

    <link rel="preload" as="fetch" type="application/wasm" href="https://unpkg.com/@resvg/resvg-wasm/index_bg.wasm" />
    
  • chore: upload wasm file to artifacts Switching from local to building in CI (Linux-x64-gnu) for .wasm files can reduce the file size a bit.

    • Local, Mac-x64-darwin: 1969225 bytes
    • CI, Linux-x64-gnu: 1949570 bytes

    After gzip compression, the .wasm file is only about 700kB.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc