diff --git a/docs/changelog.md b/docs/changelog.md index 778f3f51..cf149328 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -13,6 +13,9 @@ Requires libvips v8.9.1 [#2188](https://github.com/lovell/sharp/pull/2188) [@dimadeveatii](https://github.com/dimadeveatii) +* Allow SVG input with large inline images to be parsed. + [#2195](https://github.com/lovell/sharp/issues/2195) + ### v0.25.2 - 20th March 2020 * Provide prebuilt binaries for Linux ARM64v8. diff --git a/src/common.cc b/src/common.cc index 6c9c8a82..e3f7f6d6 100644 --- a/src/common.cc +++ b/src/common.cc @@ -279,6 +279,9 @@ namespace sharp { vips::VOption *option = VImage::option() ->set("access", descriptor->access) ->set("fail", descriptor->failOnError); + if (imageType == ImageType::SVG) { + option->set("unlimited", TRUE); + } if (imageType == ImageType::SVG || imageType == ImageType::PDF) { option->set("dpi", descriptor->density); } @@ -325,6 +328,9 @@ namespace sharp { vips::VOption *option = VImage::option() ->set("access", descriptor->access) ->set("fail", descriptor->failOnError); + if (imageType == ImageType::SVG) { + option->set("unlimited", TRUE); + } if (imageType == ImageType::SVG || imageType == ImageType::PDF) { option->set("dpi", descriptor->density); }