0.2.4 • Published 4 years ago

s3img v0.2.4

Weekly downloads
5
License
GPL
Repository
github
Last release
4 years ago

s3img - An Amazon S3 Image Processing and Uploading Tool

NPM

Purpose

s3img is a CLI tool based on Node.JS. Its original purpose is to convert and process images using ImageMagick and to upload those images to Amazon S3. The intention behind this is to provide different image resultions (thumbnails, preview, fullscale, etc.) for online shop systems.

Configuration

The configuration file includes various options.

{
	"s3": {
		"keyid"    : "your-key-id",
		"secret"   : "your-key-secret",
		"bucket"   : "bucket name",
		"region"   : "your region"
	},
	"cache"        : 315360000,
	"acl"          : "public-read",
	"extension"    : ".jpg",
	"threads"      : 1,
	"convertbin"   : "convert",
	"resizecmd"    : "%convertbin% %input% -trim -geometry %dimensions% -gravity center -background %bgcolor% -extent %dimensions% %output%",
	"sizes": {
		"thumb"    : [64, 50, "%convertbin% %input% -thumbnail %dimensions%^ -gravity center -extent %dimensions% %output%"],
		"preview"  : [165, 165],
		"full"     : [370, 370],
		"lightbox" : [1000, 1000]
	},
	"target"       : "./",
	"source"       : "./src",
	"magick": [
		"command1 %output%"
	]
}
  • The s3 object containse the access information for Amazon S3.
  • convertbin is the ImageMagick binary used for the convertion process
  • resizecmd specifies the default resize command. The following replacement options exist: - input: The input file path - output: The output file path - source: The source directory - target: The target directory - convertbin: The convert command - bgcolor: The background fill color. If not specified, the color of the first pixel will be used. - dimensions: The dimensions
  • sizes specifies an object consisting of the target with and height. An optional third parameter can be used to specify a custom resizecmd
  • source points to the source directory
  • target points to the target directory
  • magic is an array consisting of addtional commands that will be executed after the convertion operation. You can use the same variables as in resizecmd

Usage

s3img [OPTIONS]

CLI Options:

ParameterTypeDescription
helpbooleanShow help
configstringConfiguration file (Type "s3img --config --help" for more)
keyidstringS3 key ID
secretstringS3 key secret
bucketstringS3 bucket ID
regionstringS3 region (see http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
dirstringThe image directory
sourcestringThe source directory for the original images
uploadbool/stringPush images to S3
convertbool/stringConvert images
overwriteboolOverwrite existing images (default: skip)
threadsnumberNumber of parallel AWS threads (default: 1)

Convert images

Convert all images:

s3img -c ./config.json --convert

Convert a specific image set:

s3img -c ./config.json --convert=thumb

Upload images

Upload all images:

s3img -c ./config.json --upload

Upload a specific image set:

s3img -c ./config.json --upload=thumb

Requirements

Node.js with NPM (Tested with Node Version 0.10.22)

License

This work is licensed under the GNU Lesser General Public License (LGPL). You may also get a copy of the GNU Lesser General Public License from http://www.gnu.org/licenses/lgpl.txt.

0.2.4

4 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago