All Projects → Turistforeningen → Node S3 Uploader

Turistforeningen / Node S3 Uploader

Licence: mit
Flexible and efficient resize, rename, and upload images to Amazon S3 disk storage. Uses the official AWS Node SDK for transfer, and ImageMagick for image processing. Support for multiple image versions targets.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node S3 Uploader

Image processing
High-level image processing wrapper for libvips and ImageMagick/GraphicsMagick
Stars: ✭ 600 (+153.16%)
Mutual labels:  image-processing, imagemagick, thumbnails
Kafka Connect Storage Cloud
Kafka Connect suite of connectors for Cloud storage (Amazon S3)
Stars: ✭ 153 (-35.44%)
Mutual labels:  aws, s3, aws-s3
Rome
Carthage cache for S3, Minio, Ceph, Google Storage, Artifactory and many others
Stars: ✭ 724 (+205.49%)
Mutual labels:  aws, s3, aws-s3
S3mock
A simple mock implementation of the AWS S3 API startable as Docker image, JUnit 4 rule, or JUnit Jupiter extension
Stars: ✭ 332 (+40.08%)
Mutual labels:  aws, s3, aws-s3
Sbt S3 Resolver
☁️Amazon S3-based resolver for sbt
Stars: ✭ 112 (-52.74%)
Mutual labels:  aws, s3, aws-s3
Discharge
⚡️ A simple, easy way to deploy static websites to Amazon S3.
Stars: ✭ 483 (+103.8%)
Mutual labels:  aws, s3, aws-s3
Awslib scala
An idiomatic Scala wrapper around the AWS Java SDK
Stars: ✭ 20 (-91.56%)
Mutual labels:  aws, s3, aws-s3
S3 Permission Checker
Check read, write permissions on S3 buckets in your account
Stars: ✭ 18 (-92.41%)
Mutual labels:  aws, s3, aws-s3
Retinal
🏙 Retinal is a Serverless AWS Lambda service for resizing images on-demand or event-triggered
Stars: ✭ 208 (-12.24%)
Mutual labels:  aws, aws-s3, image-processing
Serverless Image Processor
AWS Lambda image processor
Stars: ✭ 106 (-55.27%)
Mutual labels:  aws, aws-s3, image-processing
Aws.s3
Amazon Simple Storage Service (S3) API Client
Stars: ✭ 302 (+27.43%)
Mutual labels:  aws, s3, aws-s3
Terraform Aws S3 Bucket
Terraform module which creates S3 bucket resources on AWS
Stars: ✭ 130 (-45.15%)
Mutual labels:  aws, s3, aws-s3
ionic-image-upload
Ionic Plugin for Uploading Images to Amazon S3
Stars: ✭ 26 (-89.03%)
Mutual labels:  aws-s3, s3, npm-package
S3 Sync Action
🔄 GitHub Action to sync a directory with a remote S3 bucket 🧺
Stars: ✭ 497 (+109.7%)
Mutual labels:  aws, s3, aws-s3
lamba-thumbnailer
AWS S3 Video Thumbnailer with Lambda
Stars: ✭ 21 (-91.14%)
Mutual labels:  thumbnails, aws-s3, s3
Aws S3 Scala
Scala client for Amazon S3
Stars: ✭ 35 (-85.23%)
Mutual labels:  aws, s3, aws-s3
Serverless Docker Image Resize
Simple serverless image resize on-the-fly - Deploy with one command - Built with AWS Lambda and S3
Stars: ✭ 114 (-51.9%)
Mutual labels:  aws, aws-s3, image-processing
0x4447 product s3 email
📫 A serverless email server on AWS using S3 and SES
Stars: ✭ 2,905 (+1125.74%)
Mutual labels:  aws, s3, aws-s3
Php Legofy
Transform your images as if they were made out of LEGO bricks.
Stars: ✭ 161 (-32.07%)
Mutual labels:  image-processing, imagemagick
Are We Consistent Yet
Compare eventual consistency of object stores
Stars: ✭ 157 (-33.76%)
Mutual labels:  s3, aws-s3

AWS S3 Image Uploader

Documentation for [email protected] can be found here.

Build status Codacy grade Codacy coverage NPM downloads NPM version Node version Dependency status Join the chat

Flexible and efficient image resize, rename, and upload to Amazon S3 disk storage. Uses the official AWS Node SDK, and im-resize and im-metadata for image processing.

Overview of image upload to AWS S3

Changelog

All changes are documentated on the releases page. Changes for latest release can be found here.

Install

npm install s3-uploader --save

Requirements

  • Node.JS >= v4.0.0
  • ImageMagic >= v6.8

API

var Upload = require('s3-uploader');

new Upload(string awsBucketName, object opts)

  • string awsBucketName - name of Amazon S3 bucket
  • object opts - global upload options
    • object cleanup

      • boolean original - remove original image after successful upload (default: false)
      • boolean versions - remove thumbnail versions after sucessful upload (default: false)
    • boolean returnExif - return exif data for original image (default false)

    • string url - custom public url (default build from region and awsBucketName)

    • object aws - see note

      • string region - region for you bucket (default us-east-1)
      • string path - path within your bucket (default "")
      • string acl - default ACL for uploaded images (default private)
      • string accessKeyId - AWS access key ID override
      • string secretAccessKey - AWS secret access key override
    • object resize

      • string path - local directory for resized images (default: same as original image)
      • string prefix - local file name prefix for resized images (default: "")
      • integer quality - default quality for resized images (default: 70)
    • object[] versions

      • string suffix - image file name suffix (default "")
      • number quality - image resize quality
      • string format - force output image file format (default format of original image)
      • number maxWidth - max width for resized image
      • number maxHeight - max height for resized image
      • string aspect - force aspect ratio for resized image (example: 4:3
      • string background - set background for transparent images (example: red)
      • boolean flatten - flatten backgrund for transparent images
      • string awsImageAcl - access control for AWS S3 upload (example: private)
      • number awsImageExpires - add Expires header to image version
      • number awsImageMaxAge - add Cache-Control: max-age header to image version
    • object original

      • string awsImageAcl - access control for AWS S3 upload (example: private)
      • number awsImageExpires - add Expires header to image version
      • number awsImageMaxAge - add Cache-Control: max-age header to image version
    • function randomPath - custom random path function

AWS note

The aws object is passed directly to aws-sdk. You can add any of these options in order to fine tune the connection – if you know what you are doing.

Example

var client = new Upload('my_s3_bucket', {
  aws: {
    path: 'images/',
    region: 'us-east-1',
    acl: 'public-read'
  },

  cleanup: {
    versions: true,
    original: false
  },

  original: {
    awsImageAcl: 'private'
  },

  versions: [{
    maxHeight: 1040,
    maxWidth: 1040,
    format: 'jpg',
    suffix: '-large',
    quality: 80,
    awsImageExpires: 31536000,
    awsImageMaxAge: 31536000
  },{
    maxWidth: 780,
    aspect: '3:2!h',
    suffix: '-medium'
  },{
    maxWidth: 320,
    aspect: '16:9!h',
    suffix: '-small'
  },{
    maxHeight: 100,
    aspect: '1:1',
    format: 'png',
    suffix: '-thumb1'
  },{
    maxHeight: 250,
    maxWidth: 250,
    aspect: '1:1',
    suffix: '-thumb2'
  }]
});

#upload(string src, object opts, function cb)

  • string src - path to the image you want to upload

  • object opts

    • string awsPath - override the path on AWS set through opts.aws.path
    • string path - set absolute path for uploaded image (disables random path)
  • function cb - callback function (Error err, object[] versions, object meta)

    • Error err - null if everything went fine
    • object[] versions - original and resized images with path/location
    • object meta - metadata for original image

Example

client.upload('/some/image.jpg', {}, function(err, versions, meta) {
  if (err) { throw err; }

  versions.forEach(function(image) {
    console.log(image.width, image.height, image.url);
    // 1024 760 https://my-bucket.s3.amazonaws.com/path/110ec58a-a0f2-4ac4-8393-c866d813b8d1.jpg
  });
});

Algorithm

A
+-- B
    `-- C
    `-- D
    `-- E

Where A is the original image uploaded by the user. An mpc image is created, B,
which is used to crate the thumbnails C, D, and E.

Collaborators

Individuals making significant and valuable contributions are made Collaborators and given commit-access to the project. These individuals are identified by the existing Collaborators and their addition as Collaborators is discussed as a pull request to this project's README.md.

Note: If you make a significant contribution and are not considered for commit-access log an issue or contact one of the Collaborators directly.

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].