diff --git a/CHANGELOG.md b/CHANGELOG.md index e2f35228ac..90948ef6cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All major and minor version changes will be documented in this file. Details of patch-level version changes can be found in [commit messages](https://github.com/gchq/CyberChef/commits/master). +### [8.18.0] - 2018-12-26 +- 'Split Colour Channels' operation added [@artemisbot] | [#449] + ### [8.17.0] - 2018-12-25 - 'Generate QR Code' and 'Parse QR Code' operations added [@j433866] | [#448] @@ -82,6 +85,7 @@ All major and minor version changes will be documented in this file. Details of +[8.18.0]: https://github.com/gchq/CyberChef/releases/tag/v8.18.0 [8.17.0]: https://github.com/gchq/CyberChef/releases/tag/v8.17.0 [8.16.0]: https://github.com/gchq/CyberChef/releases/tag/v8.16.0 [8.15.0]: https://github.com/gchq/CyberChef/releases/tag/v8.15.0 @@ -150,3 +154,4 @@ All major and minor version changes will be documented in this file. Details of [#443]: https://github.com/gchq/CyberChef/pull/443 [#446]: https://github.com/gchq/CyberChef/pull/446 [#448]: https://github.com/gchq/CyberChef/pull/448 +[#449]: https://github.com/gchq/CyberChef/pull/449 diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index 24f2d6616a..f70e29411b 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -5,7 +5,7 @@ */ import utf8 from "utf8"; -import {fromBase64} from "./lib/Base64"; +import {fromBase64, toBase64} from "./lib/Base64"; import {fromHex} from "./lib/Hex"; import {fromDecimal} from "./lib/Decimal"; import {fromBinary} from "./lib/Binary"; @@ -817,6 +817,17 @@ class Utils { return html; }; + const formatContent = function (buff, type) { + if (type.startsWith("image")) { + let dataURI = "data:"; + dataURI += type + ";"; + dataURI += "base64," + toBase64(buff); + return ""; + } else { + return `
${Utils.escapeHtml(Utils.arrayBufferToStr(buff.buffer))}`; + } + }; + const formatFile = async function(file, i) { const buff = await Utils.readFile(file); const blob = new Blob( @@ -846,7 +857,7 @@ class Utils {
${Utils.escapeHtml(Utils.arrayBufferToStr(buff.buffer))}+ ${formatContent(buff, file.type)}