arsen / image-optimizer Goto Github PK
View Code? Open in Web Editor NEWNode based Image compressor.
Node based Image compressor.
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.
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).
Thanks for developing such a handy tool.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.