Permalink
Browse files

Merge branch 'dev'

  • Loading branch information...
deepsweet committed Apr 5, 2013
2 parents 55a5e23 + f01c7f4 commit 9559c7e678f7d49ac5b55f149b6599e75c61e7d7
Showing with 757 additions and 258 deletions.
  1. +14 −8 .svgo.yml
  2. +3 −0 CHANGELOG.md
  3. +3 −3 README.md
  4. +3 −3 README.ru.md
  5. +9 −17 lib/svgo/coa.js
  6. +1 −4 lib/svgo/config.js
  7. +1 −1 package.json
  8. +492 −0 plugins/_path.js
  9. +7 −222 plugins/convertPathData.js
  10. +224 −0 plugins/cropAndCenterAlongPath.js
View
@@ -80,10 +80,6 @@ plugins:
active: true
type: perItem
- - name: cleanupEnableBackground
- active: true
- type: perItem
-
- name: removeHiddenElems
active: true
type: perItem
@@ -115,6 +111,10 @@ plugins:
active: true
type: perItemReverse
+ - name: collapseGroups
+ active: true
+ type: perItemReverse
+
- name: moveGroupAttrsToElems
active: true
type: perItemReverse
@@ -163,14 +163,20 @@ plugins:
remove: true
minify: true
- - name: collapseGroups
- active: true
- type: perItemReverse
-
- name: removeUnusedNS
active: true
type: full
+ - name: cropAndCenterAlongPath
+ active: false
+ type: full
+ params:
+ hcrop: true
+ vcenter: true
+ floatPrecision: 3
+ leadingZero: true
+ negativeExtraSpace: true
+
svg2js:
strict: true
View
@@ -1,3 +1,6 @@
+### [ [>](https://github.com/svg/svgo/tree/v0.2.4) ] 0.2.4 / 05.04.2013
+* new plugin [plugins/cropAndCenterAlongPath](https://github.com/svg/svgo/blob/master/plugins/cropAndCenterAlongPath.js) for the [Fontello](https://github.com/fontello) project
+
### [ [>](https://github.com/svg/svgo/tree/v0.2.3) ] 0.2.3 / 22.02.2013
* new plugin [plugins/removeNonInheritableGroupAttrs](https://github.com/svg/svgo/blob/master/plugins/removeNonInheritableGroupAttrs.js) (fix [#101](https://github.com/svg/svgo/issues/101))
* new plugin [plugins/removeRasterImages](https://github.com/svg/svgo/blob/master/plugins/removeRasterImages.js) (close [#98](https://github.com/svg/svgo/issues/98))
View
@@ -1,9 +1,9 @@
**english** | [русский](https://github.com/svg/svgo/blob/master/README.ru.md)
- - -
-<img src="http://soulshine.in/svgo/logo.svg?v3" width="200" height="200" alt="logo"/>
+<img src="http://soulshine.in/svgo.svg" width="200" height="200" alt="logo"/>
-## SVGO v0.2.3 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
+## SVGO v0.2.4 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
**SVG O**ptimizer is a Nodejs-based tool for optimizing SVG vector graphics files.
![](https://mc.yandex.ru/watch/18431326)
@@ -64,7 +64,7 @@ Options:
-s STRING, --string=STRING : Input SVG data string
-f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files
-o OUTPUT, --output=OUTPUT : Output file (by default the same as the input), "-" for STDOUT
- -c CONFIG, --config=CONFIG : Local config file to extend default
+ -c CONFIG, --config=CONFIG : Local config file
--disable=DISABLE : Disable plugin by name
--enable=ENABLE : Enable plugin by name
--datauri : Output as Data URI base64 string
View
@@ -1,9 +1,9 @@
[english](https://github.com/svg/svgo/blob/master/README.md) | **русский**
- - -
-<img src="http://soulshine.in/svgo/logo.svg?v3" width="200" height="200" alt="logo"/>
+<img src="http://soulshine.in/svgo.svg" width="200" height="200" alt="logo"/>
-## SVGO v0.2.2 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
+## SVGO v0.2.4 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
**SVG** **O**ptimizer – это инструмент для оптимизации векторной графики в формате SVG, написанный на Node.js.
![](https://mc.yandex.ru/watch/18431326)
@@ -64,7 +64,7 @@ Options:
-s STRING, --string=STRING : Input SVG data string
-f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files
-o OUTPUT, --output=OUTPUT : Output file (by default the same as the input), "-" for STDOUT
- -c CONFIG, --config=CONFIG : Local config file to extend default
+ -c CONFIG, --config=CONFIG : Local config file
--disable=DISABLE : Disable plugin by name
--enable=ENABLE : Enable plugin by name
--datauri : Output as Data URI base64 string
View
@@ -57,7 +57,7 @@ module.exports = require('coa').Cmd()
})
.end()
.opt()
- .name('config').title('Local config file to extend default')
+ .name('config').title('Local config file')
.short('c').long('config')
.val(function(val) {
return val || this.reject('Option --config must have a value.');
@@ -172,24 +172,16 @@ module.exports = require('coa').Cmd()
*/
function saveFileAndPrintInfo(result, output, pretty) {
- if (!pretty && result.info.outBytes >= result.info.inBytes) {
+ // output file
+ output = FS.createWriteStream(output, { encoding: 'utf8' });
+ output.write(result.data);
+ output.end();
- UTIL.puts('There is nothing to optimize!\n'.yellow);
+ // print time info
+ printTimeInfo(result.info.time);
- } else {
-
- // output file
- output = FS.createWriteStream(output, { encoding: 'utf8' });
- output.write(result.data);
- output.end();
-
- // print time info
- printTimeInfo(result.info.time);
-
- // print optimization profit info
- printProfitInfo(result.info.inBytes, result.info.outBytes);
-
- }
+ // print optimization profit info
+ printProfitInfo(result.info.inBytes, result.info.outBytes);
}
View
@@ -73,10 +73,7 @@ function _getConfig(params) {
if (!exist) return defaultConfig;
// if it exists then return extended default
- return readConfig(localConfigPath)
- .then(function(localConfig) {
- return extend(true, defaultConfig, localConfig);
- });
+ return readConfig(localConfigPath);
});
}
View
@@ -1,6 +1,6 @@
{
"name": "svgo",
- "version": "0.2.3",
+ "version": "0.2.4",
"description": "Nodejs-based tool for optimizing SVG vector graphics files",
"keywords": [ "svgo", "svg", "optimize", "minify" ],
"homepage": "http://svg.github.com/svgo/",
Oops, something went wrong.

0 comments on commit 9559c7e

Please sign in to comment.