Skip to content

Commit

Permalink
Add support for gzip compressed SVG images
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Jan 17, 2023
1 parent 2eed1c3 commit 49e233d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ node --version
${ENABLE_MODULES:+-Dmodules=enabled} -Dcgif=enabled -Dexif=enabled ${ENABLE_AVIF:+-Dheif=enabled} \
-Dheif-module=enabled -Dimagequant=enabled -Djpeg=enabled ${ENABLE_JXL:+-Djpeg-xl=enabled} \
-Djpeg-xl-module=enabled -Dlcms=enabled ${ENABLE_SVG:+-Dresvg=enabled} -Dresvg-module=enabled \
-Dspng=enabled -Dtiff=enabled -Dwebp=enabled -Dnsgif=true -Dppm=true -Danalyze=true -Dradiance=true
-Dspng=enabled -Dtiff=enabled -Dwebp=enabled -Dnsgif=true -Dppm=true -Danalyze=true -Dradiance=true \
-Dzlib=enabled
meson install -C _build --tag runtime,devel
# Emscripten requires linking to side modules to find the necessary symbols to export
module_dir=$(printf '%s\n' $TARGET/lib/vips-modules-* | sort -n | tail -1)
Expand Down
5 changes: 2 additions & 3 deletions test/unit/test_foreign.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,7 @@ describe('foreign', () => {
fileLoader('svgload', Helpers.svgFile, svgValid);
bufferLoader('svgload_buffer', Helpers.svgFile, svgValid);

// FIXME(kleisauke): resvg doesn't seem to support gzip compressed SVG images.
/* fileLoader('svgload', Helpers.svgzFile, svgValid);
fileLoader('svgload', Helpers.svgzFile, svgValid);
bufferLoader('svgload_buffer', Helpers.svgzFile, svgValid);

fileLoader('svgload', Helpers.svgGzFile, svgValid);
Expand All @@ -894,7 +893,7 @@ describe('foreign', () => {
im = vips.Image.newFromFile(Helpers.svgzFile);
x = vips.Image.newFromFile(Helpers.svgzFile, { dpi: 144 });
expect(Math.abs(im.width * 2 - x.width)).to.be.below(2);
expect(Math.abs(im.height * 2 - x.height)).to.be.below(2); */
expect(Math.abs(im.height * 2 - x.height)).to.be.below(2);

Helpers.expectCppException(() => {
const svg = '<svg viewBox="0 0 0 0"></svg>';
Expand Down

0 comments on commit 49e233d

Please sign in to comment.