Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blitline-resizer

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blitline-resizer

Resizes images using Blitline

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

Build Status

Blitline Image Resizer

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.

Why?

Created for resizing images for use on responsive websites, hence for now only fits width.

Usage

  1. Create a Blitline account and get a valid Application Id (a developer account is free).

  2. Set up permissions on an Amazon S3 bucket so that Blitline can put the results there.

  3. You will need a server that can receive and process the postback (think webhook) that Blitline posts to when image processing is complete.

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
}

Tests

Needs a config file ./test_config.json:

{
    "blitline_app_id": "YOUR_BLITLINE_APP_ID",
    "s3_bucket": "TEST_AMAZON_S3_BUCKET_NAME"
}

npm test

Todo

  • Better test coverage
  • Support polling to avoid needing postback server
  • Allow resizing to fit both height and width

Changelog

v0.1.0

Add options.retina to also create retina versions of images. Defaults to false. NB. Breaking change previously it created retina versions by default.

Keywords

FAQs

Package last updated on 28 Feb 2015

Did you know?

Socket

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.

Install

Related posts

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