<img src = " https://pencilcode.net/img/ ?????">

69 views
Skip to first unread message

rsf...@gmail.com

unread,
Sep 10, 2016, 5:58:16 PM9/10/16
to Pencil Code
How do I know what images are available? Is this documented somewhere?

Robert Gray

unread,
Sep 12, 2016, 3:43:19 PM9/12/16
to Pencil Code, rsf...@gmail.com
The only image on "pencilcode.net/image" is vpencil-20-64.png, as that is the Pencil Code thumbnail. 

If you're looking for the images that can be found using the "img" command, they are all found on the Wikimedia Commons. Check the reference page for the "img" command. 

jgr...@googlemail.com

unread,
Nov 12, 2016, 9:50:54 AM11/12/16
to Pencil Code, rsf...@gmail.com
I'm interested in learning more about this as I am having trouble getting images that are definitely in wikimedia commons.
For example, this code "draws" a random playing card and tries to show an image of that card using the syntax
wear '/img/card-8-of-spades'

http://jgplay.pencilcode.net/edit/class/randomCards

Searches on wikimedia commons show lots of images of this type:
8 of spades site:commons.wikimedia.org/

Note: This does work if the draw happens to be ace of spades, hearts, or diamonds, but no other card seems to work. Also, I've tried variations of the basic syntax ('/img/playing-cards-8-of-spades' and '/img/8-of-spades') but haven't found anything that works.

Message has been deleted

Robert Gray

unread,
Nov 13, 2016, 10:18:51 AM11/13/16
to Pencil Code, rsf...@gmail.com, jgr...@googlemail.com
Because of the way in which the Wikimedia Commons saves images, finding images using URLs isn't as simple as changing the name of the image in it. 

For example, the URLs for the 8 of spades and 9 of spades images' information pages are

But the images themselves are found under different URLs

Note that the URLs are also different before the file name. The 8 of spades image has "4/40/" before it, and the 9 of spades has "6/63/" before it. I have no idea what those numbers mean, but they make what you're trying to do more difficult. 

Luckily I found another source for these images on GitHub that does allow easy selection of images. 

See my edit of your code. 

jgr...@googlemail.com

unread,
Nov 13, 2016, 10:44:55 AM11/13/16
to Pencil Code, rsf...@gmail.com, jgr...@googlemail.com
Wow, thanks!

Carl Robert Gray

unread,
Nov 13, 2016, 11:39:12 AM11/13/16
to jgr...@googlemail.com, Pencil Code, rsf...@gmail.com
No problem. I'm always happy to help. 

--
You received this message because you are subscribed to a topic in the Google Groups "Pencil Code" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pencilcode/jJky25lY8AE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pencilcode+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages