gulp.spritesmith
Advanced tools
Comparing version 4.1.2 to 4.2.0
# gulp.spritesmith changelog | ||
4.2.0 - Moved to emitting errors rather than assert to be more gulp-like. Fixes #73 | ||
4.1.2 - Added `foundry` for release | ||
@@ -3,0 +5,0 @@ |
@@ -153,6 +153,13 @@ // Load our dependencies | ||
// If we have a different amount of normal and retina images, complain and leave | ||
assert(images.length === retinaImages.length, | ||
'Retina settings detected but ' + retinaImages.length + ' retina images were found. ' + | ||
'We have ' + images.length + ' normal images and expect these numbers to line up. ' + | ||
'Please double check `retinaSrcFilter`.'); | ||
if (images.length !== retinaImages.length) { | ||
var err = new Error('Retina settings detected but ' + retinaImages.length + ' retina images were found. ' + | ||
'We have ' + images.length + ' normal images and expect these numbers to line up. ' + | ||
'Please double check `retinaSrcFilter`.'); | ||
err.images = images; | ||
err.retinaImages = retinaImages; | ||
this.emit('error', err); | ||
imgStream.push(null); | ||
cssStream.push(null); | ||
return cb(); | ||
} | ||
} | ||
@@ -286,9 +293,15 @@ | ||
// Generate groups for our coordinates | ||
var errorEncountered = false; | ||
retinaGroups = cleanCoords.map(function getRetinaGroups (normalSprite, i) { | ||
// Assert that image sizes line up for debugging purposes | ||
var retinaSprite = retinaCleanCoords[i]; | ||
assert(retinaSprite.width === normalSprite.width * 2 && retinaSprite.height === normalSprite.height * 2, | ||
'Normal sprite has inconsistent size with retina sprite. ' + | ||
'"' + normalSprite.name + '" is ' + normalSprite.width + 'x' + normalSprite.height + ' while ' + | ||
'"' + retinaSprite.name + '" is ' + retinaSprite.width + 'x' + retinaSprite.height + '.'); | ||
if (retinaSprite.width !== normalSprite.width * 2 || retinaSprite.height !== normalSprite.height * 2) { | ||
errorEncountered = true; | ||
var err = new Error('Normal sprite has inconsistent size with retina sprite. ' + | ||
'"' + normalSprite.name + '" is ' + normalSprite.width + 'x' + normalSprite.height + ' while ' + | ||
'"' + retinaSprite.name + '" is ' + retinaSprite.width + 'x' + retinaSprite.height + '.'); | ||
err.normalSprite = normalSprite; | ||
err.retinaSprite = retinaSprite; | ||
that.emit('error', err); | ||
} | ||
@@ -302,2 +315,9 @@ // Generate our group | ||
}); | ||
// If there was an error, then bail out | ||
if (errorEncountered) { | ||
imgStream.push(null); | ||
cssStream.push(null); | ||
return cb(); | ||
} | ||
} | ||
@@ -304,0 +324,0 @@ |
{ | ||
"name": "gulp.spritesmith", | ||
"description": "Convert a set of images into a spritesheet and CSS variables via gulp", | ||
"version": "4.1.2", | ||
"version": "4.2.0", | ||
"homepage": "https://github.com/twolfson/gulp.spritesmith", | ||
@@ -6,0 +6,0 @@ "author": { |
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
280978
976