Importing SVG images

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4007
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Importing SVG images

Post by bn » Tue Apr 18, 2023 10:36 am

Hi Richmond,

It probably all depends on the interpretation/meaning of licensee
* Redistribution in source form, with or without modification, is permitted
* to other licensees of the LiveCode product provided that the following
* conditions are met:
One could argue that as a license holder of 9.6.3 you qualify as a "licensee".

Only Edinburgh would know what is meant.

KInd regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9404
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing SVG images

Post by richmond62 » Tue Apr 18, 2023 10:48 am

Thank you, Bernd: I have contacted LC directly re this matter.

Best, Richmond.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9404
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing SVG images

Post by richmond62 » Tue Apr 18, 2023 11:29 am

I have been informed"

"Versions of all source files present in 9.6.4 and onwards are not available under a dual license- only under a restricted commercial license as laid out in the commercial license agreement and thus are incompatible with LiveCode Community (9.6.3 and before) and any derivatives of it. Specifically, the versions of all source files in 9.6.4 and above are not available as GPLv3 licensed versions and are incompatible with that license."

So I will tell 'Chewbacca' to go back where he came from.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1211
Joined: Thu Apr 11, 2013 11:27 am

Re: Importing SVG images

Post by LCMark » Tue Apr 18, 2023 12:29 pm

Irksome legal bit:
One could argue that as a license holder of 9.6.3 you qualify as a "licensee".
The only licenses which exist to the 'LiveCode product' (i.e. 9.6.4 and above) which are referred to are commercial licenses - and they are all 'time limited'. i.e. Someone is only a licensee of the 'LiveCode product' for as long as they hold an active commercial subscription to said 'LiveCode product'.

The terms in that header are really just a (minor) clarification of the rights on use endowed upon you by agreeing to the commercial license which you agree to uphold while using the 'LiveCode product' (the only product which exists from 9.6.4 onwards). They basically reinforce the fact that there is no issue with certain files whose source you can see and access in LiveCode being modified and shared with others who also hold such a commercial license.

In terms of the relationship the GPLv3 licensed editions of LiveCode Community - then what the specific details of what 'licensee' means is a moot point.

The GPLv3 is incompatible with any other license which imposes limits beyond those present in the GPLv3.

Those comments impose restrictions on what you can do with the source text to which they are attached, and thus render the source text incompatible with the GPLv3.

------

So re the actual issue here...

Its actually just a 'too strict validation' case in the drawing library.

If you try this (variant of Bernd's cut down version) in a 'stock' (unmodified) 9.6.3 then it should work fine:

Code: Select all

<?xml version="1.0"?>
<svg viewBox="0 0 150 150">
<circle fill="#EDEDED" cx="72.592" cy="70.827" r="65.697"/>
<linearGradient id="XMLID4" gradientUnits="userSpaceOnUse" x1="20.9092" y1="14.6113" x2="128.0485" y2="131.1494">
<stop  offset="0" style="stop-color:#FFC10E"/>
<stop  offset="1" style="stop-color:#F16422"/>
</linearGradient>
<circle fill="url(#XMLID4)" cx="72.592" cy="70.827" r="63.159"/>
</svg>
Notice that the only difference is that I've removed the '_' from the id which names the gradient.

The drawing library uses a regex to extract the id from 'gradient url references' and it was just a little bit too strict previously, so I suggest something along the following lines:

Code: Select all

1. Open a completely unmodified version of LiveCode Community 9.6.3
2. In the message box do:
        edit script of stack "com.livecode.library.drawing"
3. Search for:
        "^url\s*\(\s*#([a-zA-Z][a-zA-Z0-9]*)*\)(.*)$"
    and replace it with:
        "^url\s*\(\s*#([a-zA-Z][a-zA-Z0-9_-]*)\)(.*)$"
4. Save the script and convey it to someone appropriate.
Do make absolutely sure it is an unmodified version of 9.6.3 (i.e. the exact version of the drawing library as it was in that version) as otherwise the derived file will not be under a GPLv3 compatible license. (Further there may be other changes in that file since 9.6.3 which the above sequence of steps is *not* in any way a grant to use in [a derivation of] LiveCode Community 9.6.3 - not least the header comment!).

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9404
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing SVG images

Post by richmond62 » Tue Apr 18, 2023 12:40 pm

Thank you very much indeed: that is most helpful and generous.

Best, Richmond.

P.S. While I'd have no great difficulty locating the stack "com.livecode.library.drawing"
in the Mac app package, I'd be hard put to locate it in a Linux install.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1211
Joined: Thu Apr 11, 2013 11:27 am

Re: Importing SVG images

Post by LCMark » Tue Apr 18, 2023 2:21 pm

richmond62 wrote:
Tue Apr 18, 2023 12:40 pm
P.S. While I'd have no great difficulty locating the stack "com.livecode.library.drawing"
in the Mac app package, I'd be hard put to locate it in a Linux install.
Stackfiles (which have been loaded from disk) know where they are even if you don't... In the message box try:

Code: Select all

put the filename of stack "com.livecode.library.drawing"

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9404
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing SVG images

Post by richmond62 » Tue Apr 18, 2023 4:23 pm

Thank you for initiating me into the inner mysteries.

Best, Richmond.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9404
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing SVG images

Post by richmond62 » Sat Apr 22, 2023 1:26 pm

Just to say a BIG THANK YOU to Mark Waddingham as that script
modification works superbly. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9404
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing SVG images

Post by richmond62 » Sat May 06, 2023 9:54 am

For those who might be fussed about things (probably not that many people)
I would like to point out that:

Code: Select all

"^url\s*\(\s*#([a-zA-Z][a-zA-Z0-9_-]*)\)(.*)$"
while importing colored SVG images into LC with their colours intact,
does not do that well in other respects:
-
SShot 2023-05-06 at 11.49.23.png
-
This is an EPS image exported from Inkscape as an SVG image.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”