pictor is simple image upload/convert/download server.
The name of pictor comes from Pictor, a constellation.
Local storages and traffic are expensive, especially in cloud environment.
There're many cheap and large cloud/remote storage services, most of them provide cheap and fast HTTP access.
ex. Amazon S3, FTP+HTTP Static Image Hosting Services...
pictor is designed for these environment.
pictor basically works as following:
- upload is accomplished by pictor. cloud/remote storage can do if possible.
- convert is accomplished by pictor.
- download is accomlished by cloud/remote storage. pictor can do if you want.
- all files are stored in cloud/remote storage. local storage can do if you want.
- all variant files(generated by pictor) could be deleted at any anytime. pictor will generate it on demand.
- install prerequisites
for mac osx:
for debian/ubuntu linux:
$ brew install graphicsmagick
or else see http://graphicsmagick.org
$ apt-get install graphicsmagick
- download & install pictor
install with npm:
or get source from github:
$ npm install pictor
$ git clone email@example.com:iolo/pictor.git
- startup pictor server
start as standalone:
or startup with pm2
$ ./bin/pictor --host=0.0.0.0 --port=3001
$ npm install pm2 -g $ pm2 start -i 4 -n pictor ./bin/pictor -- --host=0.0.0.0 --port=3001
- test run in browser
$ open http://localhost:3001
- test run in console
configuration files are located in
config directory for various environment.
you should specify the environment with
NODE_ENV environment variable.
you could specify the absolute path to the configuration file with
PICTOR_CONFIG environment variable also.
for more details, see source code of default configuration.
- embedding pictor in other expressjs app
- custom storage
- custom converter
- to show debug logs
DEBUG environment variable to
pictor:* and run pictor.
$ DEBUG='*' ./bin/pictor
external dependencies for converters
- convert/resize/thumbnail/rotate/crop/resizecrop/meta/exif/holder: graphicsmagick(or imagemagick))
- optimize jpeg: jpegtran (already included via jpegtran-bin nodejs module)
- optimize png: optipng (already included via optipng-bin nodejs moudle)
- optimize gif: gifsicle (already included via gifsicle nodejs module)
project directory structure
- to generate api documents from source
grunt apidoc open build/app/docs/api/index.html
- to generate source code documents from source
grunt doxx open build/app/docs/api/index.html
that's all folks...
may the source be with you...