Skip to content

Commit

Permalink
provide correct buffer object for image type detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny committed Nov 22, 2024
1 parent 14f8823 commit 07be4b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web/src/engine/websites/KadoComi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ export default class extends DecoratableMangaScraper {

for (let a = 0; a < r; a += 1)
o[a] = t[a] ^ e[a % i];
return o;
return o.buffer;
}
}
2 changes: 1 addition & 1 deletion web/src/engine/websites/MangaParkPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ export default class extends DecoratableMangaScraper {

for (let a = 0; a < r; a += 1)
o[a] = sourceArray[a] ^ e[a % i];
return o;
return o.buffer;
}
}
8 changes: 4 additions & 4 deletions web/src/engine/websites/NicoNicoSeiga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ export default class extends DecoratableMangaScraper {
}

private async DecryptImage(blob: Blob, key: string): Promise<Blob> {
const buffer = new Uint8Array(await blob.arrayBuffer());
const bytes = new Uint8Array(await blob.arrayBuffer());
const xorkey = new Uint8Array(key.slice(0, 16).match(/.{1,2}/g).map(e => parseInt(e, 16)));
for (let n = 0; n < buffer.length; n++)
buffer[n] = buffer[n] ^ xorkey[n % 8];
return Common.GetTypedData(buffer);
for (let n = 0; n < bytes.length; n++)
bytes[n] = bytes[n] ^ xorkey[n % 8];
return Common.GetTypedData(bytes.buffer);
}
}

0 comments on commit 07be4b4

Please sign in to comment.