diff --git a/samples/svg/src/main/java/com/bumptech/glide/samples/svg/SvgDecoder.java b/samples/svg/src/main/java/com/bumptech/glide/samples/svg/SvgDecoder.java index 215c4f7434..cb5fc47324 100644 --- a/samples/svg/src/main/java/com/bumptech/glide/samples/svg/SvgDecoder.java +++ b/samples/svg/src/main/java/com/bumptech/glide/samples/svg/SvgDecoder.java @@ -1,5 +1,7 @@ package com.bumptech.glide.samples.svg; +import static com.bumptech.glide.request.target.Target.SIZE_ORIGINAL; + import androidx.annotation.NonNull; import com.bumptech.glide.load.Options; import com.bumptech.glide.load.ResourceDecoder; @@ -24,6 +26,12 @@ public Resource decode( throws IOException { try { SVG svg = SVG.getFromInputStream(source); + if (width != SIZE_ORIGINAL) { + svg.setDocumentWidth(width); + } + if (height != SIZE_ORIGINAL) { + svg.setDocumentHeight(height); + } return new SimpleResource<>(svg); } catch (SVGParseException ex) { throw new IOException("Cannot load SVG from stream", ex);