mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 22:21:01 +01:00
Add maximum limit to the thumbnail image size
This commit is contained in:
parent
eb5809fd17
commit
7bf8467637
@ -699,12 +699,13 @@ class InputWaiter {
|
||||
*/
|
||||
displayFilePreview() {
|
||||
const inputNum = this.getActiveTab(),
|
||||
input = this.getInput(inputNum),
|
||||
inputText = document.getElementById("input-text"),
|
||||
fileSlice = this.getInput(inputNum).slice(0, 4096),
|
||||
fileSlice = input.slice(0, 4096),
|
||||
fileThumb = document.getElementById("input-file-thumbnail"),
|
||||
arrBuffer = new Uint8Array(this.getInput(inputNum)),
|
||||
arrBuffer = new Uint8Array(input),
|
||||
type = isImage(arrBuffer);
|
||||
if (type && type !== "image/tiff" && this.app.options.imagePreview) {
|
||||
if (type && type !== "image/tiff" && this.app.options.imagePreview && input.byteLength < 1024000) {
|
||||
// Don't show TIFFs as not much supports them
|
||||
fileThumb.src = `data:${type};base64,${toBase64(arrBuffer)}`;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user