gruntjs / grunt-contrib-imagemin

Minify PNG, JPG, GIF and SVG images.
https://gruntjs.com
MIT License
1.21k stars 175 forks source link

Jpeg minimiser is destroying photos #153

Closed charmpitz closed 10 years ago

charmpitz commented 10 years ago

Running "imagemin:jpg" (imagemin) task Warning: ENOENT, no such file or directory 'static-html/assets/images/compressed/background.min.jpg' Use --force to continue.

Aborted due to warnings.

After running imagemin my jpegs have 0 bytes even when i overwrite them or when i create new ones with .min.jpg extension. Something is definetly wrong. First time i ran it worked perfectly but after that this happened.

This is my config:

imagemin: {
    png: {
        options: {
            optimizationLevel: 7
        },
        files: [
            {
                // Set to true to enable the following options…
                expand: true,
                // cwd is 'current working directory'
                cwd: 'static-html/assets/images/',
                src: ['**/*.png'],
                // Could also match cwd line above. i.e. project-directory/img/
                dest: 'static-html/assets/images',
                ext: '.png'
            }
        ]
    },
    jpg: {
        options: {
            progressive: true
        },
        files: [
            {
                // Set to true to enable the following options…
                expand: true,
                // cwd is 'current working directory'
                cwd: 'static-html/assets/images/',
                src: ['**/*.jpg'],
                // Could also match cwd. i.e. project-directory/img/
                dest: 'static-html/assets/images/compressed/',
                ext: '.min.jpg'
            }
        ]
    }
},
maboiteaspam commented 10 years ago

is cache:false would fix it ? It is not an option (at least not yet), it has be set into the source file of the package installed locally, ie: node_modules/grunt-contrib-img-min/tasks/imagemin.js.

covertg commented 10 years ago

Have you read through Issue 140? Could be the same issue you're experiencing...

jamesplease commented 10 years ago

Closing as a duplicate of #140.

@charmpitz if that issue doesn't accurately describe what you're experiencing just comment here and this issue will be reopened.