Giter VIP home page Giter VIP logo

image-optimizer's People

Contributors

arsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

image-optimizer's Issues

Do you use lossy compression?

The compression this tool achieves is awesome compared to ImageOptim without lossy compression. As soon as I allow ImageOptim to execute using lossy compression, I get similar results.

tmp directory not cleaned up after process is run under windows

When the process runs it creates a tmp. directory which because of the dot at the end is an invalid name so it cannot be deleted at the end of the process. The trailing dot occurs because the results.files array contains relative paths that start with dots (eg ./images/file01.png) and this is appended to the ./tmp string to create the temporary directory.

The fix is to remove the leading dot prior to appending to the ./tmp variable.

This change needs to be made in several places within the image-optimize.js file. The reason I have not submitted this change as a pull request is that I am not in a position to test that the change still functions under Linux (or OSX) so I raised the issue here.

I have attached my altered file (please note that my changes were done in a rush to get the utility to work so I apologise if they are not elegant).

image-optimize.zip

Thanks for developing such a handy tool.

Negative compression percentages show as NaN%

Using image-optimizer on a folder that was already optimized resulted in some files being bigger and having a negative percentage reduction. Instead of showing the negative percentage the program showed NaN%

`### Before optimizing ###
Files: 14
Total Size: 42kb

  1. Processing file: images/1.png ... done! (0%)
  2. Processing file: images/2.png ... done! (33%)
  3. Processing file: images/3.png ... done! (NaN%)
  4. Processing file: images/4.png ... done! (0%)
  5. Processing file: images/5.png ... done! (NaN%)
  6. Processing file: images/6.png ... done! (NaN%)
  7. Processing file: images/7.png ... done! (52%)
  8. Processing file: images/8.png ... done! (0%)
  9. Processing file: images/9.png ... done! (0%)
  10. Processing file: images/10.png ... done! (0%)
  11. Processing file: images/11.png ... done! (0%)
  12. Processing file: images/12.png ... done! (0%)
  13. Processing file: images/13.png ... done! (NaN%)
  14. Processing file: images/14.png ... done! (NaN%)

    After optimizing

    Files: 14
    Total Size: 24kb
    Total size reduced by: 17kb (42%)
    #########################
    Done copying files back to original location`

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.