From d31499a860b6e567b41c030132853eb1cb1a01b3 Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Fri, 3 Feb 2017 18:29:09 -0700
Subject: [PATCH] Fix tests rewriting `logo.png`
---
src/image.js | 3 +++
src/user/picture.js | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/image.js b/src/image.js
index 1cfbdccbe3..0ab68e5a23 100644
--- a/src/image.js
+++ b/src/image.js
@@ -65,6 +65,9 @@ image.resizeImage = function (data, callback) {
}
},
function (image, next) {
+ if (data.write === false) {
+ return next();
+ }
image.write(data.target || data.path, next);
}
], function (err) {
diff --git a/src/user/picture.js b/src/user/picture.js
index 0fd1d1a3bd..273a5dd413 100644
--- a/src/user/picture.js
+++ b/src/user/picture.js
@@ -57,7 +57,8 @@ module.exports = function (User) {
path: picture.path,
extension: extension,
width: imageDimension,
- height: imageDimension
+ height: imageDimension,
+ write: false,
}, next);
},
function (next) {