aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjd242018-04-26 09:42:39 +0100
committercjd242018-04-26 09:42:39 +0100
commit1aeec5a70fa2de8a63e09425f440a79fd602f53d (patch)
treeca1f788a1fd031a6a506c36415ca84ea56891e60
parentfixing the call to create a scalable for the scn's (diff)
downloadmedicine-1aeec5a70fa2de8a63e09425f440a79fd602f53d.tar.gz
medicine-1aeec5a70fa2de8a63e09425f440a79fd602f53d.zip

another bug for mimetype

-rw-r--r--src/files.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/files.ts b/src/files.ts
index aaccb8c..6b3145e 100644
--- a/src/files.ts
+++ b/src/files.ts
@@ -460,9 +460,14 @@ export const views: {
var buffer = new Buffer(10);
fs.read(fd, buffer, 0, 10, 0, async function(err, num) {
logger.debug(buffer.toString('utf8', 0, num));
- file.originalMimetype = 'image/czi';
+ let type: string = buffer.toString('utf8', 0, num);
+ if (type === 'ZISRAWFILE') {
+ file.originalMimetype = 'image/zeiss';
+ } else {
+ file.originalMimetype = 'image/lecia';
+ }
await file.save();
- res(buffer.toString('utf8', 0, num) === 'ZISRAWFILE');
+ res(type === 'ZISRAWFILE');
});
});
});