Comments (2)
There's a lot going on here. Please can you provide more simple code, without any networking, that allows someone else to reproduce. You'll also need to provide a sample image.
from sharp.
Miss placed the console.log:
console.log(
`Before Compression ${fileName} (${calculateSizeInMB(
file.size
)} MB)`
);
// Convert the received compressed buffer back into a Blob
const compressedBlob = new Blob(
[new Uint8Array(compressedBuffer)],
{
type: file.type,
}
);
// Upload the compressed image using the signed URL
await fetch(signedUrl, {
method: 'PUT',
body: compressedBlob,
headers: {
'Content-Type': file.type, // Ensure correct content type
},
});
console.log(
`After Compression ${fileName} (${calculateSizeInMB(
compressedBlob.size
)} MB)`
);
It is working just need to chunk upload because the sum of the file array is >4.5mb
Before Compression:
a5e3d21d-0b37-4720-8e44-27b881a2c59c.png: 2.91 MB
9ee9e537-36b1-4dca-a506-21c37e9a3522.png: 5.37 MB
61edc47c-61ca-48d8-a385-eaff2bf882a8.png: 7.76 MB
0d6b19e7-b4d3-470d-a991-07d43e86a4df.png: 7.59 MB
e9e0e4b9-f0f0-4371-8ba1-6615027b3bd6.png: 6.27 MB
461cba61-0705-4432-b960-2fd023d8f84f.png: 7.94 MB
bdf49d45-5051-4d77-ac5b-5a9be5e77110.png: 6.96 MB
73c7fe7e-79cc-4b66-942e-edcabcda944b.png: 6.65 MB
39a430b4-1538-4c45-b100-680dc2899053.png: 6.45 MB
5c59f354-da8e-4ec0-9725-d8a2bcfd7779.png: 7.23 MB
ff54ff2d-a726-4a51-a289-37e5c0cdf53c.png: 8.02 MB
a465dc8b-dad6-4c44-ad1d-c172ad55db61.png: 7.70 MB
fa4deba0-04ea-49d5-9b0e-5c60363733aa.png: 8.32 MB
ed8ba8c3-57b1-485d-92fa-711671ab5371.png: 8.18 MB
811edfd1-b146-4f42-923f-176d93730e2a.png: 8.15 MB
859b7fdc-60b8-4995-82bc-be6a43eb5c89.png: 8.13 MB
7e84c0ea-e0b2-48d1-b56c-b2f8c7d2b6aa.png: 8.34 MB
f5520cc3-c758-48f2-ace7-35ffafcac054.png: 8.92 MB
be343eac-4b23-4697-8764-ee15b960539e.png: 8.35 MB
82c5102a-29fd-42a8-a72a-f7ccc471cdad.png: 8.55 MB
After Compression:
a5e3d21d-0b37-4720-8e44-27b881a2c59c.png: 0.22 MB
9ee9e537-36b1-4dca-a506-21c37e9a3522.png: 0.42 MB
61edc47c-61ca-48d8-a385-eaff2bf882a8.png: 0.70 MB
0d6b19e7-b4d3-470d-a991-07d43e86a4df.png: 0.66 MB
e9e0e4b9-f0f0-4371-8ba1-6615027b3bd6.png: 0.65 MB
461cba61-0705-4432-b960-2fd023d8f84f.png: 0.64 MB
bdf49d45-5051-4d77-ac5b-5a9be5e77110.png: 0.79 MB
73c7fe7e-79cc-4b66-942e-edcabcda944b.png: 0.80 MB
39a430b4-1538-4c45-b100-680dc2899053.png: 0.64 MB
5c59f354-da8e-4ec0-9725-d8a2bcfd7779.png: 0.74 MB
ff54ff2d-a726-4a51-a289-37e5c0cdf53c.png: 0.67 MB
a465dc8b-dad6-4c44-ad1d-c172ad55db61.png: 0.52 MB
fa4deba0-04ea-49d5-9b0e-5c60363733aa.png: 0.79 MB
ed8ba8c3-57b1-485d-92fa-711671ab5371.png: 0.73 MB
811edfd1-b146-4f42-923f-176d93730e2a.png: 0.70 MB
859b7fdc-60b8-4995-82bc-be6a43eb5c89.png: 0.70 MB
7e84c0ea-e0b2-48d1-b56c-b2f8c7d2b6aa.png: 0.75 MB
f5520cc3-c758-48f2-ace7-35ffafcac054.png: 0.73 MB
be343eac-4b23-4697-8764-ee15b960539e.png: 0.71 MB
82c5102a-29fd-42a8-a72a-f7ccc471cdad.png: 0.60 MB
from sharp.
Related Issues (20)
- Bug: type metadata.chromaSubsampling as union with undefined HOT 1
- Channel excluded from image manipulations, if the channel was `join`ed at later time HOT 4
- In network contrained environement we shoud have a diferent url for github like an artifactory proxy HOT 1
- Divide Blend HOT 2
- Help converting raw input with color-profile to srgb HOT 2
- How do make solid border around image instead of a blur? HOT 2
- WASM32 backend overrides global Worker HOT 2
- MacOS x86 libvips incompatibility with Sharp 0.33.5 HOT 1
- How to maintain oiriginal image quality? HOT 1
- heif: Error while loading plugin: No decoding plugin installed for this compression format HOT 8
- App loading issue while using Sharp in React Native App HOT 2
- It's possible compile sharp to wasm32 using zig? HOT 2
- Using custom fonts from a ttf file HOT 5
- Composite keep tiling even if tile is false HOT 2
- Regarding convertion of an svg including several external urls of images HOT 1
- sharp not working in my AWS EC2
- sharp not working in my AWS EC2 HOT 4
- serverless + esbuild + npm not including required platform dependencies HOT 6
- Unable to run Sharp in AWS Amplify HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharp.