Skip to content

Commit

Permalink
pako package installed to compress images
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Oct 30, 2023
1 parent 8cb46dd commit 641cef4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/forms/NewBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,9 @@ export function FormNewBook() {
reader.onload = function () {
const arrayBuffer = reader.result as ArrayBuffer;
const uint8Array = new Uint8Array(arrayBuffer);
const byteArray = [...uint8Array];
// const compressedArrayBuffer = pako.deflate(
// new Uint8Array(arrayBuffer),
// );
// const byteArray = [...new Uint8Array(compressedArrayBuffer)];
// console.log(arrayBuffer);
// console.log(uint8Array);
// console.log(byteArray);
const compressedArrayBuffer = pako.deflate(uint8Array);
const byteArray = [...new Uint8Array(compressedArrayBuffer)];

setBooks((prevBooks) => ({
...prevBooks,
image: {
Expand Down

1 comment on commit 641cef4

@vercel
Copy link

@vercel vercel bot commented on 641cef4 Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

xbu – ./

xbu-git-main-franqsanz.vercel.app
xbu-franqsanz.vercel.app
xbu.vercel.app

Please sign in to comment.