do not run imgbundler unnecessarily

This commit is contained in:
Alexander Wang 2024-05-23 13:20:06 -06:00
parent 0a54cb48f1
commit 4989a95906
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927

View file

@ -52,6 +52,10 @@ func bundle(ctx context.Context, l simplelog.Logger, inputPath string, svg []byt
imgs := imageRegex.FindAllSubmatch(svg, -1)
imgs = filterImageElements(imgs, isRemote)
if len(imgs) == 0 {
return svg, nil
}
ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
defer cancel()