andismith / grunt-responsive-images

Produce images at different sizes for responsive websites.
http://www.andismith.com/grunt-responsive-images/
MIT License
719 stars 96 forks source link

Density units *may* be incorrect #132

Open CodeWithOz opened 5 years ago

CodeWithOz commented 5 years ago

@andismith I suspect there's something about the way the conversion works that I don't understand. I have only just begun using GraphicsMagick/this grunt plugin. Thanks in advance šŸ™Œ .

Expected Behaviour

For an image generated with density: 150, GraphicsMagick should report its resolution as 150x150 pixels (which I believe means dpi).

Actual Behaviour

GraphicsMagick reports its resolution as 150x150 pixels/centimeter, which converts to 381 dpi. See screenshot below.

gm_resolution

Steps to Reproduce

grunt responsive_images See Gruntfile.js config below

PC/Mac and Graphics Engine used

PC (Windows 10), GraphicsMagick

Grunt Configuration


    responsive_images: {
      dev: {
        options: {
          sizes: [
            {
              quality: 60,
              width: 350,
              density: 150,
              name: '1x'
            }
          ]
        },

        files: [{
          expand: true,
          src: ['*.{jpg,png}', '!bitmoji_uche.jpg', '!real_uche.jpg'],
          cwd: 'images_sm/',
          dest: 'images_resp/sm/'
        }]
      }
    },