Skip to content

SciDevs/imagemagick-prebuilt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageMagick Prebuilt

Install Node Package

npm install --save imagemagick-prebuilt

Install ImageMagick within NodeJS

var imagemagick_prebuilt = require( 'imagemagick-prebuilt' );

var child_process = require( 'child_process' );

exports.handler = function( event, context ) {
    imagemagick_prebuilt()
        .then( function( imagemagick_bin_location ) {
            // ImageMagick logo creation test:
            // convert logo: logo.gif
            var convert_process = child_process
                .spawn( imagemagick_bin_location, [ 'logo:', 'logo.gif' ] )

            convert_process
                .on( 'close', function() {
                    context.success();
                } );
        } );
};

Or with q.async

var imagemagick_prebuilt = require( 'imagemagick-prebuilt' );

var child_process = require( 'child_process' );

exports.handler = function( event, context ) {
    return q
        .async( function *() {
            imagemagick_bin_location = yield imagemagick_prebuilt();
            console.log( `ImageMagick installed: ${imagemagick_bin_location}` );

            // ImageMagick logo creation test:
            // convert logo: logo.gif
            var convert_process = child_process
                .spawn( imagemagick_bin_location, [ 'logo:', 'logo.gif' ] )

            convert_process
                .on( 'close', function() {
                    context.success();
                } );
        } )();
};

Will be installed to /tmp/imagemagick

Build/Upload new version

./build.sh

Build is output to artifacts/imagemagick-prebuilt.tar.gz

./upload.sh ${verison_number}

About

Prebuilt version of ImageMagick for use on AWS Lambda

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 57.2%
  • Shell 42.8%