Compare commits

..

1 Commits

Author SHA1 Message Date
stereobooster b873587e99
Merge 35e36b7a89 into f31082dec8 2023-10-04 12:38:51 +00:00
1 changed files with 6 additions and 6 deletions

View File

@ -44,18 +44,18 @@
{{ $height := ""}} {{ $height := ""}}
{{ if eq .MediaType.SubType "svg" }} {{ if eq .MediaType.SubType "svg" }}
{{ $svgContent := $resource.Content }} {{ $svgContent := $resource.Content }}
{{ range (findRESubmatch `<svg[^>]*width=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }} {{ range (findRESubmatch `width=["']?(\d*)` $svgContent 1) }}
{{ $width = index . 1 }} {{ $width = index . 1 }}
{{ end }} {{ end }}
{{ range (findRESubmatch `<svg[^>]*height=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }} {{ range (findRESubmatch `height=["']?(\d*)` $svgContent 1) }}
{{ $height = index . 1 }} {{ $height = index . 1 }}
{{ end }} {{ end }}
{{ if (eq "" $width $height) }} {{ if (eq "" $width $height) }}
{{ range (findRESubmatch `<svg[^>]*viewBox=["']?([.0-9]*) ([.0-9]*) ([.0-9]*) ([.0-9]*)` $svgContent 1) }} {{ range (findRESubmatch `viewBox=["']?(\d*) (\d*) (\d*) (\d*)` $svgContent 1) }}
{{ $width = index . 3 }} {{ $width = index . 3 }}
{{ $height = index . 4 }} {{ $height = index . 4 }}
{{ end }}
{{ end }} {{ end }}
{{ end }}
{{ else }} {{ else }}
{{ $width = .Width }} {{ $width = .Width }}
{{ $height = .Height }} {{ $height = .Height }}