An svg file is Scalable Vector Graphics. imageLoader doesn’t support that file format, so the file fails.
A 403 error is common to get if you pass an image path that points to a directory that is not viewable on the server. Viewing is forbidden; you are trying to load a bad url.
Often, 401 is “Show me your id first”, 404 is “Not found”, 403 is just “Nope.”
PShape bot;
void setup() {
size(640, 360);
// The file "bot1.svg" must be in the data folder
// of the current sketch to load successfully
bot = loadShape("https://openclipart.org/download/279040/CigCardHoudanCock.svg");
}
void draw(){
background(102);
shape(bot, 110, 90, 100, 100); // Draw at coordinate (110, 90) at size 100 x 100
shape(bot, 280, 40); // Draw at coordinate (280, 40) at the default size
}
I think the goal here is to use ImageLoader to interact with Google. Google sometimes returns svg files, which it did not use to do. ImageLoader passes them to PApplet.loadImage, here, e.g. here:
…which then throws an error, because PApplet.loadImage can’t handle svg:
I don’t think that ImageLoader can be changed to dynamically call loadShape because that would require rewriting the whole library – for example, ImageList isn’t set up to store PShapes.
Another approach would be to have ImageLoader throw the errors in a way that lets you recover a list of svg files as a separate output if you also want to manually load svg urls into shapes yourself – keeping in mind that some svgs will still fail because loadShape can’t handle them.