Cherry-picked from upstream PR #465 Resolved conflicts: merged crop parameter with existing progressCallback, kept local dimension calculation and edge luminance caching logic
Cherry-picked from upstream PR #465 Resolved conflicts: merged crop parameter with existing progressCallback, kept local dimension calculation and edge luminance caching logic