mirror of
https://github.com/sdsykes/fastimage.git
synced 2025-09-20 00:01:59 -04:00
Identify svg files that start with white spaces
This commit is contained in:
parent
a440798854
commit
fcf871e637
@ -547,7 +547,7 @@ class FastImage
|
||||
:webp if @stream.peek(12)[8..11] == "WEBP"
|
||||
when "<s"
|
||||
:svg if @stream.peek(4) == "<svg"
|
||||
when /<[?!]/
|
||||
when /\s\s|\s<|<[?!]/
|
||||
# Peek 10 more chars each time, and if end of file is reached just raise
|
||||
# unknown. We assume the <svg tag cannot be within 10 chars of the end of
|
||||
# the file, and is within the first 250 chars.
|
||||
|
1
test/fixtures/test5.svg
vendored
Normal file
1
test/fixtures/test5.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 6.9 KiB |
@ -39,6 +39,7 @@ GoodFixtures = {
|
||||
"test2.svg" => [:svg, [366, 271]],
|
||||
"test3.svg" => [:svg, [255, 48]],
|
||||
"test4.svg" => [:svg, [271, 271]],
|
||||
"test5.svg" => [:svg, [255, 48]],
|
||||
"orient_6.jpg"=>[:jpeg, [1250,2500]]
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user