Page 1 of 3

SVG and PNG Clip Art Stack

Posted: Tue May 10, 2016 12:41 am
by ClipArtGuy
Capture.JPG
I have written this small stack as a front-end of sorts to http://www.openclipart.org using their API , available here: https://openclipart.org/developers
It also uses Bob Hall's FastJSON library which is included as a sub-stack. Available here:
https://github.com/bhall2001/fastjson/b ... astjson.lc

It allows you to search a library of almost 100,000 images and download up to 10 images at a time in both SVG and high quality PNG formats.
Most of the program is in the card script, I'd love to hear what you think.

https://www.dropbox.com/sh/lzsun4gg4lgz ... HwfDa?dl=0

ClipArtGuy

Re: SVG and PNG Clip Art Stack

Posted: Tue May 10, 2016 9:42 am
by Klaus
Very cool, thank you very much for sharing!

Re: SVG and PNG Clip Art Stack

Posted: Tue May 10, 2016 11:26 am
by richmond62
Wonderful: Thanks!

Re: SVG and PNG Clip Art Stack

Posted: Tue May 17, 2016 6:16 pm
by ClipArtGuy
Thanks to the new JSONimport() function, this stack no longer requires a 3rd party JSON library. It also seems to be a bit faster as well.

https://www.dropbox.com/sh/76z1nwrdl8fo ... O4Xka?dl=0

Re: SVG and PNG Clip Art Stack

Posted: Sat Jul 02, 2016 4:53 am
by capellan
Wonderful and really useful stack!
Many, many thanks for sharing :D

From your stack, How could we read or
search very specific data from svg source
code before downloading a file?

For example, Does exist some way to read
the svg source code to learn this information?

I am collecting svg files created using different apps,
(besides Inkscape and Ilustrator) and your stack
could help me in this task.

Thanks in advance!

Alejandro

Re: SVG and PNG Clip Art Stack

Posted: Mon Jul 04, 2016 9:19 pm
by [-hh]
Hi ClipArtGuy,
your stack is a jewel, both from scripts and the available actions. Thanks!
You should think about changing your nickname to ClipArtKing.

Re: SVG and PNG Clip Art Stack

Posted: Tue Jul 05, 2016 8:36 pm
by ClipArtGuy
capellan wrote:Wonderful and really useful stack!
Many, many thanks for sharing :D

From your stack, How could we read or
search very specific data from svg source
code before downloading a file?

For example, Does exist some way to read
the svg source code to learn this information?

I am collecting svg files created using different apps,
(besides Inkscape and Ilustrator) and your stack
could help me in this task.
The large preview area to left has a custom property called cSVGdownload that contains the URL of the SVG being previewed. (Actually all the gallery images have this property as well) So a simple way to see the text of the SVG would be as easy as:

Code: Select all

  get URL (the cSVGdownload of img "viewer")
 answer it 
I think this would be sufficient to see and search the SVG source. You could also loop through images "gallery1" through "gallery10" and grab the source of 10 at a time. I am fairly certain though, that most if not all images on OpenClipArt are passed through inkscape prior to being uploaded.
[-hh] wrote:Hi ClipArtGuy,
your stack is a jewel, both from scripts and the available actions. Thanks!
You should think about changing your nickname to ClipArtKing.
Thanks and Thank you for all great stacks for the Raspberry Pi!

Re: SVG and PNG Clip Art Stack

Posted: Thu Jul 07, 2016 4:43 am
by capellan
Great! :D After, I finish some pending work, I will add a small button with your code in the stack GUI.
Last time I checked, whole clipart collection from Openclipart is more than 10 Gb. :shock:

Hopefully, in a near future LiveCode will import SVG files as an image with transparency (like PNGs).

Have a nice week!

Alejandro

Re: SVG and PNG Clip Art Stack

Posted: Fri Jul 08, 2016 2:40 am
by ClipArtGuy
capellan wrote:Great! :D After, I finish some pending work, I will add a small button with your code in the stack GUI.
Last time I checked, whole clipart collection from Openclipart is more than 10 Gb. :shock:

Hopefully, in a near future LiveCode will import SVG files as an image with transparency (like PNGs).

Have a nice week!

Alejandro
I have added a "view SRC" button underneath the preview area. Clicking this button will get the SVG data and open it in a resizable substack called "sourceviewer" with an editable text field. The script is right in the button.

https://www.dropbox.com/sh/eo7k7g4jvdwp ... Bgypa?dl=0

Re: SVG and PNG Clip Art Stack

Posted: Sat Jul 09, 2016 2:14 am
by ClipArtGuy
I just added a "Save SVG" button to the source viewer stack, so now you can edit the source and then save as SVG if need be. It's the latest version in this dropbox folder (1.3 as of this writing). I will continue to push updated versions to this folder.

https://www.dropbox.com/sh/lzsun4gg4lgz ... HwfDa?dl=0

Re: SVG and PNG Clip Art Stack

Posted: Thu Sep 01, 2016 8:58 pm
by [-hh]
Hi "ClipArtGuy",

your excellent stack is soon getting lost in this big subforum.
TMHO, you should think about uploading it to revOnline (="Sample Stacks" from the revMenuBar).

Hermann

p.s. Alejandro, if you read this. The same is true for the great SVG stacks you created!

Re: SVG and PNG Clip Art Stack

Posted: Thu Sep 01, 2016 9:32 pm
by ClipArtGuy
[-hh] wrote:Hi "ClipArtGuy",

your excellent stack is soon getting lost in this big subforum.
TMHO, you should think about uploading it to revOnline (="Sample Stacks" from the revMenuBar).

Hermann

p.s. Alejandro, if you read this. The same is true for the great SVG stacks you created!
Thanks again Hermann! 8) It's definitely something I plan on doing, there are a few more things that I'd like to work on when I get a chance before doing so, hopefully soon.

Re: SVG and PNG Clip Art Stack

Posted: Wed Nov 30, 2016 8:48 pm
by [-hh]
Hi "ClipArtGuy",

your stack works *perfectly* in LC 8 but has several problems in LC 9.0.0-dp2 probably connected to networking only. Networking is _very_ slow, startup and "View SRC" need a full minute. Do you see why? You could then think about reporting this to QCC.

Hermann

Re: SVG and PNG Clip Art Stack

Posted: Wed Nov 30, 2016 8:53 pm
by richmond62
I wonder why, when I downloaded the downloader stack 1.3 onto my Mac Livecode told me it was not a stack?

Would be grateful if you could upload it in a zip file.

Re: SVG and PNG Clip Art Stack

Posted: Wed Nov 30, 2016 10:00 pm
by Klaus
Just downloaded the stack from his Dropbox and did not have any problems!?