Comparing version 1.3.0 to 1.3.1
## v1.3.1 - 06/06/2012 | ||
* fixed; thumb() alignment and cropping [thomaschaaf] | ||
* added; hint when graphicsmagick is not installed (#62) | ||
* fixed; minify() (#59) | ||
## v1.3.0 - 04/11/2012 | ||
@@ -3,0 +9,0 @@ |
@@ -110,4 +110,4 @@ // gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (MIT Licensed) | ||
// http://www.graphicsmagick.org/GraphicsMagick.html | ||
proto.minify = function minify (factor) { | ||
return this.in("-minify", factor || 1); | ||
proto.minify = function minify () { | ||
return this.in("-minify") | ||
} | ||
@@ -114,0 +114,0 @@ |
@@ -203,2 +203,3 @@ // gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (MIT Licensed) | ||
if (code !== 0 || signal !== null) { | ||
if (127 == code) stderr += '** Have you installed graphicsmagick? **\n'; | ||
err = new Error('Command failed: ' + stderr); | ||
@@ -205,0 +206,0 @@ err.code = code; |
@@ -10,3 +10,3 @@ | ||
proto.thumb = function thumb (w, h, name, quality, callback) { | ||
proto.thumb = function thumb (w, h, name, quality, align, callback) { | ||
var self = this | ||
@@ -20,2 +20,3 @@ , args = Array.prototype.slice.call(arguments); | ||
quality = args.shift() || 63; | ||
align = args.shift() || 'topleft'; | ||
@@ -31,2 +32,4 @@ self.size(function (err, size) { | ||
var w1, h1; | ||
var xoffset = 0; | ||
var yoffset = 0; | ||
@@ -48,6 +51,16 @@ if (size.width < size.height) { | ||
} else if (size.width == size.height) { | ||
w1 = w; | ||
h1 = h; | ||
var bigger = (w>h?w:h); | ||
w1 = bigger; | ||
h1 = bigger; | ||
} | ||
if (align == 'center') { | ||
if (w < w1) { | ||
xoffset = (w1-w)/2; | ||
} | ||
if (h < h1) { | ||
yoffset = (h1-h)/2; | ||
} | ||
} | ||
self | ||
@@ -57,3 +70,3 @@ .quality(quality) | ||
.scale(w1, h1) | ||
.crop(w, h) | ||
.crop(w, h, xoffset, yoffset) | ||
.noProfile() | ||
@@ -60,0 +73,0 @@ .write(name, function () { |
{ "name": "gm" | ||
, "description": "Graphics Magick for node." | ||
, "version": "1.3.0" | ||
, "version": "1.3.1" | ||
, "author": "Aaron Heckmann <aaron.heckmann+github@gmail.com>" | ||
@@ -5,0 +5,0 @@ , "keywords": ["nodejs", "graphics magick", "graphics", "magick", "image", "graphicsmagick", "imagemagick"] |
@@ -5,3 +5,3 @@ | ||
module.exports = function (gm, dir, finish) { | ||
return finish(); | ||
if (gm._options.imageMagick) return finish(); | ||
@@ -8,0 +8,0 @@ gm |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
211058
2637