Comparing version 0.0.1 to 0.1.0
@@ -22,2 +22,4 @@ 'use strict'; | ||
showImage(touchup.scale(imageElement, 2.0, 2.0), 'scale(2,2)'); | ||
showImage(touchup.scale(imageElement, 4.0, 4.0), 'scale(4,4)'); | ||
showImage(touchup.scale(imageElement, 4.0, 4.0, 'nearest-neighbor'), 'scale(4,4,"nearest-neighbor")'); | ||
showImage(touchup.scale(imageElement, 3.0, 0.5), 'scale(3,0.5)'); | ||
@@ -24,0 +26,0 @@ showImage(touchup.repeat(imageElement, 7, 9), 'repeat(7,9)', |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.6.3 | ||
// Generated by CoffeeScript 1.7.0 | ||
(function() { | ||
@@ -25,3 +25,3 @@ var createCanvas, crop, overallSize, overlay, repeat, scale; | ||
scale = function(sourceImage, scaleX, scaleY) { | ||
scale = function(sourceImage, scaleX, scaleY, algorithm) { | ||
var canvas, context, destH, destW, _ref; | ||
@@ -31,2 +31,5 @@ destW = sourceImage.width * scaleX; | ||
_ref = createCanvas(destW, destH), canvas = _ref[0], context = _ref[1]; | ||
if (algorithm === 'nearest-neighbor') { | ||
context.imageSmoothingEnabled = false; | ||
} | ||
context.drawImage(sourceImage, 0, 0, destW, destH); | ||
@@ -33,0 +36,0 @@ return canvas.toDataURL(); |
{ | ||
"name": "touchup", | ||
"description": "quick & dirty image manipulation using HTML5 canvas", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -21,2 +21,6 @@ # touchup | ||
touchup.scale(sourceImage, scaleX, scaleY, 'nearest-neighbor') | ||
Resize an image with image smoothing disabled. | ||
touchup.crop(sourceImage, ox, oy, ow, oh) | ||
@@ -23,0 +27,0 @@ |
Sorry, the diff of this file is not supported yet
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
11570
121
44