-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty images after running imagemin repeatedly #140
Comments
I'm also having the same issue. Same setup as above. Version 0.4.1 works as expected. Version 0.5.0 breaks. |
I am getting empty images as well. I tried deleteing files in the destination directory before running the command again but I still get empty files on subsequent runs of the command. |
I'm experiencing the same issue, as @Nooshu mentions, 0.4.1 works as expected. |
Does |
yeah that works! |
It didn't work for me, I have a feeling I need to clear imagemin cache, where can I find that? |
@nazimjamil !!! uncanny to see a fellow Proferian here! what are the chances eh? |
@darryl-snow I thought to myself.. 'that couldn't be the darryl-snow I know'! Hope all is well!! |
Adding cache: false to the files: object did not work, however when I added it to the options: block it works fine again, thanks. |
As @nigeljohnwade, adding cache: false to options has worked for me. |
+1 for issue and |
There is an active bug in imagemin where if you run the task repeatedly it can start outputting empty files. Currently, the easiest way to get around it is to set the cache option to false. gruntjs/grunt-contrib-imagemin#140
There is an active bug in imagemin where if you run the task repeatedly it can start outputting empty files. Currently, the easiest way to get around it is to set the cache option to false. gruntjs/grunt-contrib-imagemin#140
+1 cache:false is working for me too. |
+1 cache: false in options fixes this. |
Same issue here, +1 for options: { cache: false } fix Is this desired behavior though? |
+1 options: { cache: false } works for 0.4.1 & 0.5.0, however, make sure that you do not copy the files before the imagemin task, as described in this issue: #69 It's seems like grunt-contrib-imagemin overwrites the default cache: false of image-min library |
Thanks cache:false fixes problem, seemed to start when new file was introduced |
I'm also having this problem. Running Grunt 0.4.2 and grunt-contrib-imagemin 0.5.0 on Win7x64.
Adding the |
|
There is an active bug in imagemin where if you run the task repeatedly it can start outputting empty files. Currently, the easiest way to get around it is to set the cache option to false. gruntjs/grunt-contrib-imagemin#140
Also getting this issue and it also seems as though setting |
+1 to the cache:false solution, got exactly the same problem when i upgraded to 0.5.0 |
affects me, too. |
This affects me as well. |
Same here. cache: false worked for me too |
@chaselee, did you try tschaub/grunt-newer ? could make the work. |
will definitely look into that. thanks @maboiteaspam! |
using grunt-newer worked great. thanks again @maboiteaspam. |
As req. for imagemin has been bumped, we can process gif with it. The "cache: false" option is because there's a bug in imagemin 0.5.0: gruntjs/grunt-contrib-imagemin#140
Given the config @darryl-snow pasted will make Grunt return a list of files that include the optimized ones. I.e. after the first run, the next time you run imagemin the source files will include the previously created optimized files as well, and that's hardly what you want. Try changing the config to this:
That should exclude the generated files from the list of source files to process. |
Yeah, this is weird, I am running 4.1 on windows 7 and haven't had any problems until today. Our CI server does an npm install on every build and ran into build failures ENONET. My local dev box can still use imagemin even after I upgrade to 5.0 version. Taking it out of the build until I can figure out what changed all of a sudden. |
I've published new versions today. Could you specify where the problem occur? |
k, I just deleted my 4.1 imagemin and npm installed save dev of the latest 5.0 version and I get this error on a forced build to try and get a better error status: Running "imagemin:main" (imagemin) task |
Try version |
Using 0.6.0-pre this morning, on Win 7 64 bit, node v 0.10.25 . With these settings in gruntfile
and this is its output. On the 5.0 version, when I forced the build, due to the error, it would give more specifics on the imagemin task failure. on the .6-pre version, forcing does not add any details to the failure. $ grunt build
Running "clean:before" (clean) task Running "less:production" (less) task Running "dom_munger:readcss" (dom_munger) task Processing index.html Running "dom_munger:readscripts" (dom_munger) task Processing index.html Running "ngtemplates:main" (ngtemplates) task Running "cssmin:main" (cssmin) task Running "concat:main" (concat) task Running "ngmin:main" (ngmin) task Running "uglify:main" (uglify) task Running "copy:main" (copy) task Running "dom_munger:removecss" (dom_munger) task Processing dist/index.html Running "dom_munger:addcss" (dom_munger) task Processing dist/index.html Running "dom_munger:removescripts" (dom_munger) task Processing dist/index.html Running "dom_munger:addscript" (dom_munger) task Processing dist/index.html Running "htmlmin:main" (htmlmin) task Running "imagemin:main" (imagemin) task |
Found something interesting, this is likely a Windows specific issue on Node and what modules you use for child processes |
Having the same issue here, On Ubuntu 12.04 My imagemin config (in a separate imagemin.js file, through load-grunt-config)
A call to grunt -v yields
The file I want to optimize is turned into a 0byte file. Thanks in advance |
Having literally the identical issue to @CaptainQuirk right now, also Ubuntu 12.04. |
Same issue than @CaptainQuirk , ubuntu 13.10 |
Seems to be a issue with optipng version, with ubuntu we have optipng 0.6.4 installed, if you update it to 0.7.4 and run imagemin, everything will work fine Upgrading optipng -> http://kb.imakewebsites.ca/2012/10/16/installing-optipng-0-7-3-on-ubuntu-12-04/ Related issue -> #180 Upgrading optipng solves all the shit |
No it doesn't. Downloaded optipng 0.7.4 and I still get the Fatal Error : spawn ENOENT issue |
Try upgrading to node v0.10.26 (It's what i have) And I'm sorry I missread your comment, my problem was with PNG not JPG. Thats why i told about optipng |
jpegtran -v |
Neither the use of grunt newer nor the installation of optipng 0.7.4 solves this for me. I still get this ENOENT error and any file ends up empty. |
For jpeg only, aint it? Check your jpegtran version plis, doland |
Mine dies on png files. The weird thing is that I've been using it for days, without modifying my grunt setup at all it just stopped working. I think this is somehow related to files because I did modify a significant number of files in my image directory. |
/images
folder (1 image is 427kb)grunt:imagemin
orgrunt
the first time results in over-optimised (blurry) images in theimages/optimised
folder. The 427kb jpeg reduced to 66kb, although the CLI reports "(saved 426.80 kB)".The text was updated successfully, but these errors were encountered: