Thumbnails for the code app

This commit is contained in:
yflory
2017-10-24 18:49:58 +02:00
parent bac10472f3
commit f4adbd980e
7 changed files with 94 additions and 42 deletions

View File

@@ -247,18 +247,11 @@ define([
if (!Thumb.isSupportedType(file.type)) { return finish(); }
// make a resized thumbnail from the image..
Thumb.fromBlob(file, function (e, thumb_blob) {
Thumb.fromBlob(file, function (e, thumb64) {
if (e) { console.error(e); }
if (!thumb_blob) { return finish(); }
blobToArrayBuffer(thumb_blob, function (e, buffer) {
if (e) {
console.error(e);
return finish();
}
thumb = arrayBufferToString(buffer);
finish();
});
if (!thumb64) { return finish(); }
thumb = thumb64;
finish();
});
});
};