Skip to content

HeikkiAlanen/grunt-hal-image-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

grunt-hal-image-optimizer

Simple plugin to optimize images for web usage.

Getting Started

This plugin requires Grunt ~0.4.5

npm install grunt-hal-image-optimizer --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-hal-image-optimizer');

The "hal_image_optimizer" task

Overview

Following example optimizes images from the test folder and places thumbnail images to the given destination folder.

grunt.initConfig({
    hal_image_optimizer: {
      example: {
        options: {
            width: 200,
            height: 200
        },
        files: {'./imgThumbs': './node_modules/hal-image-optimizer/test/test_images' }
      }
    }
});

Options

options.width

Type: Integer Default value: 100

Width of the generated image.

options.heigth

Type: Integer Default value: 100

Heigth of the generated image.

files

The path to the destination (key), the path to the source files.

Release History

###v1.0.1:

  • Corrected usage of source and destination.

###v1.0.0:

  • First version.

License

Copyright (c) HeikkiAlanen

Licensed under the MIT license.