Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@resvg/resvg-js-darwin-x64
Advanced tools
A high-performance SVG renderer and toolkit, powered by Rust based resvg and napi-rs
@resvg/resvg-js-darwin-x64
This is the x86_64-apple-darwin binary for @resvg/resvg-js
[2.1.0] - 2022-07-03
Add imagesToResolve()
and resolveImage()
APIs to load image URL. By @zimond in #102
xlink:href
starting with http://
or https://
.In order to support loading image URL, we forked the rust side of resvg and made some improvements.
Now please witness the magic moment:
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
FAQs
A high-performance SVG renderer and toolkit, powered by Rust based resvg and napi-rs
The npm package @resvg/resvg-js-darwin-x64 receives a total of 42,879 weekly downloads. As such, @resvg/resvg-js-darwin-x64 popularity was classified as popular.
We found that @resvg/resvg-js-darwin-x64 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.