Giter VIP home page Giter VIP logo

pngmin's People

Contributors

diamondo25 avatar freeqaz avatar gwicksted avatar patricknelson avatar zauni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pngmin's Issues

Fatal error: Reduce of empty array with no initial value

Dear developers... :)

I'm getting a fatal error when grunting with this tool. :(

MY GRUNT CODE:
pngmin: {
files: {
src: '<%= paths.dist %><%= pkg.widget.name %>-sprite.png',
dest: '<%= paths.dist %><%= pkg.widget.name %>-sprite.png'
}
}

MY TERMINAL OUTPUT:
Running "pngmin:files" (pngmin) task
Verifying property pngmin.files exists in config...OK
Files: ../../distribution/sdk-demo-widget-sprite.png -> ../../distribution/sdk-demo-widget-sprite.png
Options: binary="bin/pngquant", concurrency=4, colors=256, ext="-fs8.png", force=false, speed=3, iebug=false, transbug=false
Reading ../../distribution/sdk-demo-widget-sprite.png...OK
Writing /tmp/tmp-8218a72nlww.png...OK
Fatal error: Reduce of empty array with no initial value

Any idea on how I can correct this?

-Ryan

p.s. I've also installed pngquant as well...
pngquant, version 1.0 of 5 April 2002, by Greg Roelofs.
Compiled with libpng 1.2.46; using libpng 1.2.49.
Compiled with zlib 1.2.3.4; using zlib 1.2.7.

Revert optimization for files where optimization saved 0%

Hi!

You are already reverting the optimization for images that would get bigger by pngmin
Optimization would increase file size by 1 % so optimization was skipped on file xyz.png

For me it would make sense if you also revert the optimization for images where the optimization saved 0%
Optimized xyz.png [saved 0 % - 622 B → 622 B]
because otherwise these files are still recognized by git as "modified" because the timestamp changed.

No error handling when pngquant fails.

Hi, thanks for the library! I'll work on a PR to address this issue but for now I'll submit the issue in case there's any delay or if my PR isn't suitable.

The problem:

I found that pngquant was failing to execute because I didn't have the libpng-dev package installed (Alpine linux docker container). I noticed this because I would see the following output with no explanation at all, so I had no insight at all on why it was failing:

Running "pngmin:sprites" (pngmin) task
Overall savings: 0 % | 0 B

Done.

After some digging, I found this was using pngquant-bin so I ran ./node_modules/.bin/pngquant directly, which resulted in a very long error (expand to see full contents):

error Error: Error loading shared library libpng16.so.16: No such file or directory (needed by /var/www/html/node_modules/pngquant-bin/vendor/pngquant)
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_IHDR: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_create_write_struct: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_write_info: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_user_chunk_ptr: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_write_fn: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_keep_unknown_chunks: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_destroy_write_struct: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_gray_to_rgb: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_IHDR: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_read_image: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_option: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_rowbytes: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_compression_mem_level: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_destroy_read_struct: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_iCCP: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_create_info_struct: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_interlace_handling: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_read_user_chunk_fn: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_write_end: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_gAMA: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_write_image: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_PLTE: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_error_ptr: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_read_fn: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_cHRM: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_read_info: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_gAMA: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_valid: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_unknown_chunks: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_filler: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_expand: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_filter: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_read_update_info: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_init_io: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_sRGB: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_create_read_struct: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_error: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_io_ptr: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_strip_16: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_tRNS: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_get_header_ver: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_compression_level: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_set_packing: symbol not found
Error relocating /var/www/html/node_modules/pngquant-bin/vendor/pngquant: png_read_end: symbol not found

Proposed solution:

IMHO, a failure should also result in the grunt command failing as well. On one hand, since this is a bug, it should be fixed in the same major version. However, failing a command that previously was working is IMHO a very serious semver violation (despite resulting from a bug fix). So, I propose addressing this in two simple phases:

  1. Always output the error details to the console via console.error. Then, add an option like options.failOnError which defaults to false for [email protected]. If
  2. Start a version 2 (i.e. [email protected] and default this option to true (and then document this change in the README.md release history).

Diff between Win & Mac OS?

When using grunt pngmin we get two different output png files under Win & Mac OS, why?

ps: graphicsmagick has been installed on both of those two system.
check out the diff screenshot below, thx.

diff

win

error v0.6.3

Hi,

The “watch” task doesn't work in the new 0.6.3 version. The plugin freezes after some images are added. If I run “watch” via a direct command, it processes 3-4 images and stops working, though there are more images left.
http://screen.w3.ua/Nov14/364702125.png

In the 0.6.1 version everything worked well. Could you help me out with this?

Fatal error: spawn EACCES

I came up against this error when writing the files:

Fatal error: spawn EACCES

When I run the task with --verbose I see the task lists all the files that I would expect for it to operate on, and then it outputs this (I tuned concurrency to 1 just for debugging):

Options: binary="/Users/jrz/labs/facebook-trove/node_modules/grunt-pngmin/node_modules/node-pngquant-bin/vendor/osx/pngquant", concurrency=1, colors=256, ext=".png", quality=null, force, speed=3, iebug=false, transbug=false
Reading client/images/anon-follow.png...OK
Writing /var/folders/gf/0fyyc1ms35b2dwbp1m_xv2kc0000gp/T/tmp-19224rrh5f9c.png...OK
Fatal error: spawn EACCES

I checked the permissions of the tmp folder and they seem be good (700):

jrz@jrz ~/l/facebook-trove [grunt-imagemin]> ls -halG /var/folders/gf/0fyyc1ms35b2dwbp1m_xv2kc0000gp/T
total 12000
drwx------  235 jrz  staff   7.8K Jul  2 10:05 .

Do you have any ideas about what I could be doing wrong?

Some PNG images are not affected

Hello,
I found a problem with some PNG files. I have a many folders with PNG files and all of them are exported from photoshop by same method. But some of them are not affected by pngmin task. Do you know, where may be a problem? File "auto.png" (car) is ok, but "dum.png" (house) in same location is ignored. I tryied to rename it, crop and resave, but without success.
Thank You
Tom
dum
auto

Version 0.6.3 freezes grunt sequence

Hello,
today I updated plugin to latest version and I found a problem. The grunt task will freeze after minimizes some images. This is not dependent on some specific image, it will stop after for approx 12 images (folder contains 40), but if I have only one inside the folder, it freezes too with message "Process finished with exit code 0". Version 0.6.2 is working fine. (If You remember, I reported problem with images with version 0.6.1).
(If it helps You, our task contains these other plugins: sourcemap, clen, compress, concat, copy, uglify, yuidoc, ffmpeg, open, rename, replace and Your pngmin)
Bye,
Tomas

Aborted due to warnings - too many files?

I'm running pngmin on all files in a directory and grunt is aborting:

pngmin: {
default_options: {
options: {
binary: '/usr/bin/pngquant',
ext: '.png',
force: true
},
files: [
{
src: 'build/supercar/images/*.png',
dest: 'build/supercar/images/'
}
]
}
}

Running "pngmin:default_options" (pngmin) task
Warning: spawn EMFILE Use --force to continue.

Aborted due to warnings.

However on further inspection I'm noticing that the files are actually being optimized even though grunt aborts. There are about 296 files in the directory and there are a few sub-directories, less than half are .png. I notices if I delete a bunch of files from the directory I don't have the issue. I tried removing sub-directories first, but still had the problem so it possibly seems to be related to the number of files.

Support grunt 1.0.1

Please update the peerDependency listed in the package.json to support grunt 1.0.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.