Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
jpeg-turbo-scaler
Advanced tools
Readme
Native C++ Node.js module which uses libjpeg-turbo for extremely fast JPEG compression and decompression.
The module have been tested to build correctly only on OS X and requires libjpeg-turbo to be installed manually via Homebrew. It should be pretty easy to build it on any system, the only dependency is libjpeg-turbo library which you can easily install using your favorite package manager and simply add include and lib directories to bindings.gyp
file.
Installation sequence:
brew install jpeg-turbo
npm install jpeg-turbo-scaler
function decompress(path
, targetWidth
, targetHeight
, callback
)
Reads a JPEG file referenced by path
from local file system and resizes it to fit into targetWidth
xtargetHeight
box keeping original aspect ratio.
path
: a string containing JPEG image file path (absolute or relative).
targetWidth
and targetHeight
: desired dimensions of decompressed image.
callback
: function(bitmap
, width
, height
) where bitmap
is a Buffer with RGBA pixels data.
function scale(path
, targetWidth
, targetHeight
, callback
)
Reads a JPEG file referenced by path
from local file system, resizes it to fit into targetWidth
xtargetHeight
box keeping original aspect ratio, and compresses the result to JPEG.
path
: a string containing JPEG image file path (absolute or relative).
targetWidth
and targetHeight
: desired dimensions of decompressed image.
callback
: function(jpeg
, width
, height
) where bitmap
is a JPEG file data.
var jpeg = require('jpeg-turbo-scaler');
jpeg.decompress('image.jpg', 300, 300, function(bitmap, width, height) {
console.log('Got ' + bitmap.length + ' bytes RGBA bitmap');
});
jpeg.scale('image.jpg', 300, 300, function(jpeg, width, height) {
console.log('Got ' + jpeg.length + ' scaled JPEG file');
require('fs').writeFileSync('output.jpg', jpeg);
});
FAQs
Extremely fast JPEG scaling module based on libjpeg-turbo
The npm package jpeg-turbo-scaler receives a total of 3 weekly downloads. As such, jpeg-turbo-scaler popularity was classified as not popular.
We found that jpeg-turbo-scaler 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.