Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
changeDPI provides 2 utility functions that can change the dpi of canvas-generated image, of either dataUrl or Blob formats. The functions work on separating the header from the image data, converting and manipulating just the header, then sticking the header back on the file. In this way, very large images can be converted fast without having to convert the entire contents of an image file. This process is non-destructive—image data does not get modified in the process.
This project depends on node and npm.
npm install --save changedpi
From a canvas element dataUrl:
// create the dataUrl at standard 72dpi
var dataUrl = canvas.toDataURL('image/jpeg', 0.92);
var daurl150dpi = changeDpiDataUrl(dataUrl, 150);
From a canvas element blob:
// create the blob at standard 72dpi
canvas.toBlob(function(blob) {
changeDpiBlob(blob, 300).then(function(blob){
// use your changed blob
})
},'image/jpeg', 0.92);
TODO add example with file reader.
This module uses ES6. To see a compiled ES5 version, run npm run build
and look in dist/
.
npm install .
npm run test
Please do contribute! Open an issue or submit a pull request.
The project falls under @Shutterstock's Code of Conduct.
MIT.
FAQs
Quickly change the dpi for an image without re enconding
We found that changedpi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.