diff --git a/src/util/misc/svgParsing.ts b/src/util/misc/svgParsing.ts index fc2355e8cec..2c8ea233e1f 100644 --- a/src/util/misc/svgParsing.ts +++ b/src/util/misc/svgParsing.ts @@ -98,7 +98,7 @@ type TPreserveArParsed = { // align can be either none or undefined or a combination of mid/max const parseAlign = (align: string): MinMidMax[] => { //divide align in alignX and alignY - if (align !== MinMidMax.none) { + if (align && align !== MinMidMax.none) { return [ align.slice(1, 4) as MinMidMax, align.slice(5, 8) as MinMidMax, diff --git a/test/unit/image.js b/test/unit/image.js index e712ebbabed..7a1d0234210 100644 --- a/test/unit/image.js +++ b/test/unit/image.js @@ -647,7 +647,7 @@ y: '0', width: '70', height: '170', - preserveAspectRatio: 'meet xMidYMid', + preserveAspectRatio: 'xMidYMid meet', 'xlink:href': IMAGE_DATA_URL }); @@ -676,7 +676,7 @@ y: '0', width: '70', height: '170', - preserveAspectRatio: 'meet xMidYMax', + preserveAspectRatio: 'xMidYMax meet', 'xlink:href': IMAGE_DATA_URL }); @@ -705,7 +705,7 @@ y: '0', width: '70', height: '170', - preserveAspectRatio: 'meet xMidYMin', + preserveAspectRatio: 'xMidYMin meet', 'xlink:href': IMAGE_DATA_URL }); @@ -734,7 +734,7 @@ y: '0', width: '140', height: '85', - preserveAspectRatio: 'meet xMinYMin', + preserveAspectRatio: 'xMinYMin meet', 'xlink:href': IMAGE_DATA_URL }); @@ -763,7 +763,7 @@ y: '0', width: '140', height: '85', - preserveAspectRatio: 'meet xMidYMin', + preserveAspectRatio: 'xMidYMin meet', 'xlink:href': IMAGE_DATA_URL }); @@ -792,7 +792,7 @@ y: '0', width: '140', height: '85', - preserveAspectRatio: 'meet xMaxYMin', + preserveAspectRatio: 'xMaxYMin meet', 'xlink:href': IMAGE_DATA_URL });