Don't check dimensions for vector formats; Simplify guard scale of vector images

This commit is contained in:
DarthSim
2025-08-16 19:54:50 +03:00
parent cac693c2db
commit e5c72270bb
7 changed files with 47 additions and 28 deletions

View File

@@ -19,6 +19,7 @@ import (
)
var mainPipeline = pipeline{
vectorGuardScale,
trim,
prepare,
scaleOnLoad,
@@ -298,8 +299,11 @@ func ProcessImage(ctx context.Context, imgdata imagedata.ImageData, po *options.
}
originWidth, originHeight := getImageSize(img)
if err := security.CheckDimensions(originWidth, originHeight, 1, po.SecurityOptions); err != nil {
return nil, err
if !imgdata.Format().IsVector() {
if err := security.CheckDimensions(originWidth, originHeight, 1, po.SecurityOptions); err != nil {
return nil, err
}
}
// Let's check if we should skip standard processing