Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
blitline-resizer
Advanced tools
Resizes images using Blitline. Takes an array of image urls and an array of sizes and will copy all resized images to an Amazon S3 bucket. Right now sizes are for fit to width. Images need to be online and publicly accessible.
Created for resizing images for use on responsive websites, hence for now only fits width.
Create a Blitline account and get a valid Application Id (a developer account is free).
Set up permissions on an Amazon S3 bucket so that Blitline can put the results there.
If you submit a postbackUrl you will need a server that can receive and process the postback (think webhook) that Blitline posts to when image processing is complete.
If you set options.postbackUrl
then resize()
will return an array of hashes with job_id according to https://www.blitline.com/docs/api#returnData - one job for each image you submit.
If you do not set options.postbackUrl
then it should return an array of results for each image as described http://www.blitline.com/docs/postback - this is not guaranteed though, the request can timeout. Using a postbackUrl is more reliable.
var config = {
blitlineAppId: 'YOUR_BLITLINE_APP_ID',
postbackUrl: 'http://valid.url/to/receive/postback',
s3Bucket: 'AMAZON_S3_BUCKET_NAME'
}
var resize = require('blitline-resizer')(config);
var options = {
images: [ 'array', 'of', 'valid', 'image', 'urls'],
sizes: [ 100, 200 ] // array of widths to resize to
}
resize(options, function(err, response) {
console.log(response);
// responds with a hash or results with job_ids see https://www.blitline.com/docs/api
}
Needs the following environment variables set:
BLITLINE_APP_ID=_your blitline app id_
S3_KEY=_s3 key ID for test user_
S3_SECRET=_s3 secret key for test user_
S3_BUCKET=_test s3 bucket_ # NB. Blitline should have PutObject permissions, your S3 test user should have DeleteObject permissions
npm test
Can set secret on initial config, rather than each task
Support for long polling without a postback
Add options.retina
to also create retina versions of images. Defaults to false. NB. Breaking change previously it created retina versions by default.
FAQs
Resizes images using Blitline
We found that blitline-resizer demonstrated a not healthy version release cadence and project activity because the last version was released 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.