1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-02-12 11:46:10 +02:00
This commit is contained in:
DarthSim 2023-11-17 16:43:24 +03:00
parent 1291369de3
commit b90f73c4b5
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ func prepare(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptio
pctx.wscale, pctx.hscale, pctx.dprScale = calcScale(widthToScale, heightToScale, po, pctx.imgtype)
// The size of a vector image are not checked during download, yet it can be very large.
// The size of a vector image is not checked during download, yet it can be very large.
// So we should scale it down to the maximum allowed resolution
if !pctx.trimmed && imgdata != nil && imgdata.Type.IsVector() && !po.Enlarge {
resolution := imath.Round((float64(img.Width()*img.Height()) * pctx.wscale * pctx.hscale))

View File

@ -13,7 +13,7 @@ func trim(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions,
return nil
}
// The size of a vector image are not checked during download, yet it can be very large.
// The size of a vector image is not checked during download, yet it can be very large.
// So we should scale it down to the maximum allowed resolution
if imgdata != nil && imgdata.Type.IsVector() {
if resolution := img.Width() * img.Height(); resolution > po.SecurityOptions.MaxSrcResolution {