Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

image-size-parser

hipush15MIT1.0.0

Parse the size of an image from a string.

parser, image, size

readme

image-size-parser

Build Status Dependency Status devDependency Status

Parse the size of an image from a string. '120x20@2x' → {width: 240, height: 40}

Install

npm install image-size-parser

Usage

var parseImageSize = require('image-size-parser').parse;

parseImageSize('10x10'); // {width: 10, height: 10}
parseImageSize('120x20@2x'); // {width: 240, height: 40}
parseImageSize('10x20@5x'); // {width: 50, height: 100}

License

MIT