Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hundreads of possible broken SVG files #1255

Open
qarmin opened this issue Aug 26, 2022 · 15 comments
Open

Hundreads of possible broken SVG files #1255

qarmin opened this issue Aug 26, 2022 · 15 comments
Labels
bug Something isn't working svg SVG features

Comments

@qarmin
Copy link
Contributor

qarmin commented Aug 26, 2022

This files were found programmatically, so not all this images are invalid.

To check if png created from svg is valid I:

  • Created png file from svg with inkscape (inkscape --export-type=png -h 500)
  • Created png file from with svg2png (svg2png -r 500x500)
  • Compared png files with each other

This is not ideal comparison, because for some files inkscape generate invalid png files.

Even if files looks in file browser preview similar, then I suggest to look at them closer, because probably they differ in shadows or other less visible things.

SVG.zip
Screenshot from 2022-08-26 16-25-58

@mgrudzinska
Copy link
Collaborator

ABCD_297.svg:
before nothing was drawn, now (#1266) we have this - still not exactly as it should look like:
aftt

so we are one step (from hundreds) closer to the perfect lib :D

@qarmin
Copy link
Contributor Author

qarmin commented Sep 2, 2022

New list with svg files that are not square and without any text - NotText.zip

@hermet hermet added the v0.9 label Nov 27, 2022
@hermet hermet removed the v0.9 label Apr 6, 2023
@qarmin
Copy link
Contributor Author

qarmin commented Apr 17, 2023

New pack of 84 svg files in which differences are clearly visible - BrokenSVG.zip (master branch with applied patch from #1375)

Screenshot from 2023-04-17 14-16-03

In this list are only files without:

  • text <text>
  • images <image>
  • filters <filter>

@mgrudzinska
Copy link
Collaborator

why without <image> ?
I'll take a look on each one of them later, but it seams that not all of them are really broken:
KOSZ_8786 from tvg:
d

mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Apr 18, 2023
In a case where both the clipper and the clippee
are transformed, the final clipper transformation
matrix should be calculated as the multiplication
of both matrices.

@issue: thorvg#1255
@qarmin
Copy link
Contributor Author

qarmin commented Apr 18, 2023

In most of the time I use compiled version of thorvg without images support(without any reason), later I may enable it to find more differences

KOSZ_8786 example is strange, because I used automatic generation for this image with command svg2png file.svg -r 400x400 and now everything works fine - most of the time).

Looks that this files only draws partially due #1370 (In 1000 tested same files I got 3 AddressSanitizer crashes and also 3 same broken files were produced)

mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Apr 19, 2023
In a case where both the clipper and the clippee
are transformed, the final clipper transformation
matrix should be calculated as the multiplication
of both matrices.

@issue: thorvg#1255
hermet pushed a commit that referenced this issue Apr 19, 2023
In a case where both the clipper and the clippee
are transformed, the final clipper transformation
matrix should be calculated as the multiplication
of both matrices.

@issue: #1255
@qarmin
Copy link
Contributor Author

qarmin commented Apr 21, 2023

Broken files(png files which looks different than with rsvg) and problematic files(files which cause crashes or cannot be parsed by this tool) will now be automatically found by CI once per week - https://github.com/qarmin/SVG-regression-finder/actions

List of broken files should be available as artifacts of CI job like in - https://github.com/qarmin/SVG-regression-finder/actions/runs/4766345140

Currently due #1370 sometimes thorvg freeze, so until this issue is fixed, CI will likely fail most of the time.

@fire
Copy link
Collaborator

fire commented Apr 21, 2023

Is it possible to separate into two ci actions that pass tests and pass failing tests

@qarmin
Copy link
Contributor Author

qarmin commented Apr 21, 2023

Probably this should be quite easy to do, but I don't see too but I don't see good reason to do it.

Such a list would have to be reviewed and corrected from time to time (when, for example, something broke, or something was fixed) and bugs in subsequent versions should be reported for repair.

I don't think I or anyone else would want to look in a separate repo to see if anything has gone wrong with this repo in the meantime.

In my opinion, this repo(thorvg) should have a method in the CI to check for regression e.g. via comparing output of MR and develop(using my app or a simplified version).

Rsvg already uses a CI that compares the versions of the app by how many pixels they differ in examples svg files.

mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 7, 2023
The directive is used to give a specific style property
higher priority, ensuring that it overrides other style
declarations for the same property.

@issue: thorvg#1255
@mgrudzinska
Copy link
Collaborator

KOSZ_998
KOSZ_2032
KOSZ_25039
KOSZ_27811
KOSZ_27934
KOSZ_4260
all of them contain the <!ENTITY> which is a xml std and it's not widely supported inside svg.
@qarmin I think we can skip this one, but if not please open a separate issue.

KOSZ_31974 - deprecated 'flowRoot' - this was a feature described in one of the svg tiny versions pkt 4, but was removed from the latter versions.

KOSZ_6250 - nested svgs - not supported for now (and no plans?)

KOSZ_23134 - !important directive - #1426

KOSZ_5527 - TODO/check
KOSZ_7171 - TODO/check

@qarmin could you please confirm that for now only the two files (KOSZ_5527 and KOSZ_7171) are problematic (I mean and all the other I listed above :) but I don;t think that we want to fix the other ones )? I could miss something

@qarmin
Copy link
Contributor Author

qarmin commented May 9, 2023

With disabled entity, flowroot, nested svg and important directive I see different results in 7 files

KOSZ_21064.svg
KOSZ_23970.svg
KOSZ_23971.svg
KOSZ_5527.svg
KOSZ_5632.svg
KOSZ_7171.svg
KOSZ_9398.svg

I prepared new pack of 62 files with disabled items with specific features - BrokenSVG2.zip

Screenshot from 2023-05-09 21-39-12

@mgrudzinska
Copy link
Collaborator

it's like never ending story :D
thx, I'll check it

mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 16, 2023
The directive is used to give a specific style property
higher priority, ensuring that it overrides other style
declarations for the same property.

@issue: thorvg#1255
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jul 25, 2023
The directive is used to give a specific style property
higher priority, ensuring that it overrides other style
declarations for the same property.

@issue: thorvg#1255
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jul 25, 2023
The directive is used to give a specific style property
higher priority, ensuring that it overrides other style
declarations for the same property.

@issue: thorvg#1255
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jul 25, 2023
The directive is used to give a specific style property
higher priority, ensuring that it overrides other style
declarations for the same property.
Custom _strndup function introduced.

@issue: thorvg#1255
hermet pushed a commit that referenced this issue Mar 20, 2024
The if-check to skip-rule when drawing an arc path is already checked in line 476.
In addition, since the float type equal check is performed in the range of 1/256,
unintentional skiped may occur. Therefore, remove duplicate code.
https://www.w3.org/TR/SVG2/paths.html#ArcOutOfRangeParameters

test file: SVG_FILE_147893.svg
related issue: #1255
hermet pushed a commit that referenced this issue Mar 21, 2024
The if-check to skip-rule when drawing an arc path is already checked in line 476.
In addition, since the float type equal check is performed in the range of 1/256,
unintentional skiped may occur. Therefore, remove duplicate code.
https://www.w3.org/TR/SVG2/paths.html#ArcOutOfRangeParameters

test file: SVG_FILE_147893.svg
related issue: #1255
@JSUYA
Copy link
Member

JSUYA commented Mar 26, 2024

Pack of visually different images - broken-images.zip

And unsupported features

SVG_FILE_157828.svg - mix-blend-mode:multiply

SVG_FILE_158921.svg - x:href
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href

SVG_FILE_153630.svg - switch / foreignObject

SVG_FILE_153521.svg - switch

SVG_FILE_153433.svg - mix-blend-mode:multiply

SVG_FILE_152977.svg - pattern

@qarmin
Copy link
Contributor Author

qarmin commented Mar 27, 2024

New pack of broken files - broken-images.7z.zip
(7zip archive, not zip)

Disabled elements

"<foreignObject", // https://github.com/thorvg/thorvg/issues/1255#issuecomment-2019804429
"<pattern", // https://github.com/thorvg/thorvg/issues/1255#issuecomment-2019804429
"<switch",// https://github.com/thorvg/thorvg/issues/1255#issuecomment-2019804429
"x:href", // https://github.com/thorvg/thorvg/issues/1255#issuecomment-2019804429
"mix-blend-mode:multiply", // https://github.com/thorvg/thorvg/issues/1255#issuecomment-2019804429
"<text",     // Fonts are not implemented
"<filter",   // Filters are not implemented in thorvg - but some may be implemented
"<image",    // Used by me build not support images, but can in future
"<!ENTITY", // <!ENTITY> is a xml std and it's not widely supported inside svg. https://github.com/thorvg/thorvg/issues/1255#issuecomment-1537563461
"<flowRoot", // this was a feature described in one of the svg tiny versions pkt 4, but was removed from the latter versions. - https://github.com/thorvg/thorvg/issues/1255#issuecomment-1537563461 -  https://www.w3.org/TR/2004/WD-SVG12-20041027/
]
.iter()
.any(|e| t.contains(e))
// Nested svg files are not supported - https://github.com/thorvg/thorvg/issues/1255#issuecomment-1537563461
|| t.matches("<svg").count() > 1

JSUYA added a commit to JSUYA/thorvg that referenced this issue Mar 29, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: thorvg#1255
JSUYA added a commit to JSUYA/thorvg that referenced this issue Mar 29, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: thorvg#1255
JSUYA added a commit to JSUYA/thorvg that referenced this issue Mar 29, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: thorvg#1255
JSUYA added a commit to JSUYA/thorvg that referenced this issue Apr 1, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: thorvg#1255
JSUYA added a commit to JSUYA/thorvg that referenced this issue Apr 1, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: thorvg#1255
JSUYA added a commit to JSUYA/thorvg that referenced this issue Apr 2, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: thorvg#1255
hermet pushed a commit that referenced this issue Apr 2, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
hermet pushed a commit that referenced this issue Apr 2, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
JSUYA added a commit that referenced this issue Apr 3, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
hermet pushed a commit that referenced this issue Apr 3, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
hermet pushed a commit that referenced this issue Apr 3, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
hermet pushed a commit that referenced this issue Apr 3, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
hermet pushed a commit that referenced this issue Apr 5, 2024
The if-check to skip-rule when drawing an arc path is already checked in line 476.
In addition, since the float type equal check is performed in the range of 1/256,
unintentional skiped may occur. Therefore, remove duplicate code.
https://www.w3.org/TR/SVG2/paths.html#ArcOutOfRangeParameters

test file: SVG_FILE_147893.svg
related issue: #1255
hermet pushed a commit that referenced this issue Apr 5, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
hermet pushed a commit that referenced this issue Apr 6, 2024
The if-check to skip-rule when drawing an arc path is already checked in line 476.
In addition, since the float type equal check is performed in the range of 1/256,
unintentional skiped may occur. Therefore, remove duplicate code.
https://www.w3.org/TR/SVG2/paths.html#ArcOutOfRangeParameters

test file: SVG_FILE_147893.svg
related issue: #1255
hermet pushed a commit that referenced this issue Apr 6, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
hermet pushed a commit that referenced this issue Apr 6, 2024
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: #1255
@qarmin
Copy link
Contributor Author

qarmin commented Apr 20, 2024

New pack - broken-images.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working svg SVG features
Projects
Status: No status
Development

No branches or pull requests

5 participants