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

App does not accept SVG files created in Inkscape #216

Closed
wessven opened this issue Dec 18, 2024 · 3 comments
Closed

App does not accept SVG files created in Inkscape #216

wessven opened this issue Dec 18, 2024 · 3 comments
Assignees
Labels
1.4.1 bug Something isn't working

Comments

@wessven
Copy link

wessven commented Dec 18, 2024

I haven't been able to get any SVG files created in / saved from Inkscape to import in the Chance app. When I try to load the image, the app gives a message "Invalid SVG".

The files are saved as "plain" SVG conforming to version 1.1 of the spec, not the Inkscape flavour of SVG.

According to the svgcheck utility, the file is valid SVG:

(svgcheck)$ head test.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   width="210mm"
   height="210mm"
   viewBox="0 0 210 210"
   version="1.1"
   id="svg1694"
   xmlns="http://www.w3.org/2000/svg"
(svgcheck)$ svgcheck test.svg
test.svg:24: Style property 'fill' promoted to attribute
test.svg:24: Style property 'stroke-width' promoted to attribute
test.svg:28: Style property 'fill' promoted to attribute
test.svg:28: Style property 'stroke' promoted to attribute
test.svg:28: Style property 'stroke-width' promoted to attribute
test.svg:32: Style property 'fill' promoted to attribute
test.svg:32: Style property 'stroke' promoted to attribute
test.svg:32: Style property 'stroke-width' promoted to attribute
test.svg:36: Style property 'fill' promoted to attribute
test.svg:36: Style property 'stroke' promoted to attribute
test.svg:36: Style property 'stroke-width' promoted to attribute
test.svg:40: Style property 'fill' promoted to attribute
test.svg:40: Style property 'stroke' promoted to attribute
test.svg:40: Style property 'stroke-width' promoted to attribute
test.svg:44: Style property 'fill' promoted to attribute
test.svg:44: Style property 'stroke' promoted to attribute
test.svg:44: Style property 'stroke-width' promoted to attribute
INFO: File conforms to SVG requirements.

validator.nu also shows that the file is valid.

The app does load an SVG file created in Adobe Illustrator, even though the svgcheck utility does not think it is valid SVG:

(svgcheck)$ head test2.svg
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 25.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	width="665px" height="720px" viewBox="0 0 665 720" enable-background="new 0 0 665 720" xml:space="preserve">
<path d="M657.9,67.611c-0.494-3.986-0.939-8.047-1.37-11.975c-0.673-6.14-1.368-12.49-2.269-18.707
	c-1.111-7.661-4.48-11.802-9.742-11.975c-4.173-0.143-8.849,2.534-12.833,5.168c-2.155,1.421-3.839,3.567-5.467,5.643
	c-0.776,0.988-1.577,2.01-2.416,2.933c-14.336,15.798-28.68,31.59-43.216,47.592l-15.7,17.285c-0.599-0.505-1.09-0.9-1.503-1.232
	c-0.78-0.629-1.252-1.009-1.63-1.458c-24.454-29.083-56.113-51.421-99.635-70.302C389.037-1.121,320.426-6.874,252.37,12.999
	C184.835,32.717,139.641,58.896,105.83,97.882c-1.804,2.08-3.447,3.098-5.024,3.112c-0.011,0-0.023,0-0.033,0
	c-1.686,0-3.428-1.103-5.646-3.571c-11.338-12.62-23-25.328-34.279-37.618l-2.732-2.979c-2.117-2.306-4.221-4.622-6.326-6.939
(svgcheck)$ svgcheck test2.svg
test2.svg:4: The element 'svg' does not allow the attribute 'enable-background', attribute to be removed.
ERROR: File does not conform to SVG requirements

I've been using v1.4 of the app.

Attached is the SVG file that I created in Inkscape.
test

@jameshnsears
Copy link
Owner

Hi - thank you for taking the time for reporting this, and in such a detailed way.

I will investigate now and update this ticket as I progress.

@jameshnsears jameshnsears self-assigned this Dec 19, 2024
@jameshnsears jameshnsears moved this from Backlog to In progress in Chance - raised by users :-) Dec 19, 2024
@jameshnsears jameshnsears added bug Something isn't working 1.4.1 labels Dec 19, 2024
@jameshnsears
Copy link
Owner

OK - I've coded a unit test (with this svg) and found that a function I wrote is too tight it how it expects the svg file contents to look.

All the other images I use - most of them I created in Inkscape - are formatted slightly differently than yours. This is why my tests didn't pick this up.

I've relaxed the affected function; all tests pass; and I did a quick manual check, and things seem OK:

Image

I've tagged the code, and F-Droid should pick up the new release - 1.4.1 - in a few days, or so.

I'll keep this issue open for a week or so, just in case anything else related crops up.

Apologies for the hassle I've caused you - the app is early in its lifecycle, so bumps like this are, alas, kind of to be expected.

Thank you for helping make the app better :-) I appreciate it.

@jameshnsears jameshnsears moved this from In progress to Done in Chance - raised by users :-) Dec 19, 2024
@jameshnsears jameshnsears closed this as completed by moving to Done in Chance - raised by users :-) Dec 19, 2024
@jameshnsears jameshnsears moved this from Done to In review in Chance - raised by users :-) Dec 19, 2024
@wessven
Copy link
Author

wessven commented Dec 19, 2024

Great, thank you for the quick response and prompt action! Glad I could help, and thanks for making this. :-) Going to use it for generating story scenarios for my kids.

@jameshnsears jameshnsears moved this from In review (Released) to Done (Closed) in Chance - raised by users :-) Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.4.1 bug Something isn't working
Projects
Status: Done (Closed)
Development

No branches or pull requests

2 participants