mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
The binary search found the right quality but sharp(buffer).toBuffer() re-encoded at default quality 80, inflating the output (e.g. 50KB target producing 90KB). Replaced buffer-wrapping with proper Sharp pipelines that include .toFormat() with the proven quality. Also added progressive dimension reduction when quality alone cannot reach the target, and tightened tolerance to only accept at-or-below-target results.