Miss any of our Open RFC calls?Watch the recordings here! »

exif-size-loader

0.4.0 • Public • Published

EXIF-Loader

Extract EXIF- & size data from your JPGs during build-time.

Install

npm install --save-dev exif-size-loader

Usage

You can use the EXIF-loader as a standalone loader:

webpack.config.js

module.exports = {
  module: {
    rules: [{
      test: /\.jpg$/,
      use: ['exif-size-loader']
    }]
  }
}

modules/a.js

import { exif } from './some-image.jpg';
 

You can also use the load in tandem with the url-loader.

webpack.config.js

module.exports = {
  module: {
    rules: [{
      test: /\.jpg$/,
      use: ['exif-size-loader', 'url-loader']
    }]
  }
}

You can also use the load in tandem with the file-loader.

webpack.config.js

module.exports = {
  module: {
    rules: [{
      test: /\.jpg$/,
      use: ['exif-size-loader', 'file-loader']
    }]
  }
}

modules/b.js

import { exif, iptc, file } from './some-image.jpg';
 
const { imageWidth } = exif.image;
 
export default function () {
    return (<figure>
        <img src={file} width={imageWidth} alt="" />
        <figcaption>{object_name}</figcaption>
    </figure>);
}

Install

npm i exif-size-loader

DownloadsWeekly Downloads

21

Version

0.4.0

License

MIT

Unpacked Size

884 kB

Total Files

10

Last publish

Collaborators

  • avatar
  • avatar