Socket
Socket
Sign inDemoInstall

grunt-image-normalize

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grunt-image-normalize

Grunt task to normalize images into a preset size


Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Install size
1.24 MB
Created
Weekly downloads
 

Readme

Source

grunt-image-normalize

Normalize images to some predetermined height and width (https://github.com/dancingplatypus/grunt-imageNormalize).

Overview

Inside your grunt.js file add a section named imageNormalize. This section specifies images to normalize and the size of those images.

Pre-requisites

You will need to have GraphicsMagick installed and available in your path

Parameters
files object

This defines what files this task will process and should contain key:value pairs.

The key (destination) should be an unique filepath (supports grunt.template) and the value (source) should be a filepath or an array of filepaths (supports minimatch).

options object

This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.

Options
height integer

The height of the resulting image in pixels. If the aspect ratio does not match, it will be padded with a transparent background

width integer

The width of the resulting image in pixels. If the aspect ratio does not match, it will be padded with a transparent background

preserveDirectories boolean

If this is false, then any files found in the sources will be flattened. Files of the same name will clobber one another

base_path string

The offset into the source directory to use when preserving directories

Config Example
imageNormalize: {
  target: {
    options: {
      height: 640,
      width: 640,
      preserveDirectories: true,
      baseDirectory: "src"
    },
    src: [
        "src/images/**/*.png": "
    ],
    dest: "public/images"
  }
}

Keywords

FAQs

Last updated on 02 Oct 2012

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc