Open mdayeen opened 1 year ago
@mdayeen Can you provide the config you use and the image as a zip file?
I face the same issue, png file compression doesn't respect maxSizeMB
limit. here is my configuration:
{
maxSizeMB: 0.5,
maxWidthOrHeight: 1200,
alwaysKeepResolution: true,
}
if I increase the maxIteration
to 100, then it works. For png images the default 10 iterations is not enough
the sample png image:
@imtiazShakil I tried adding the maxIterations parameter as 100. However I am facing the same issue. It is not getting compressed. I am using browser-image-compression version 0.0.1. Any ideas are welcome. Thank you
const options = { useWebWorker: true, maxSizeMB: 2, initialQuality: 0.7, // Lower initial quality to reduce file size maxIterations: 100 };
PNG files are not being compress to size specified.