We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpProcessing Implementations › someone could help me?problems load image
Page Index Toggle Pages: 1
someone could help me?problems load image (Read 1877 times)
someone could help me?problems load image
Mar 11th, 2010, 4:48am
 
Hello,
Sorry my english isn´t good...
I don´t know if someone might help.
I´m beginner with processing.js, I´m working with canvas and html 5.
I have problems when I want to load an image on the canvas, the mistake gives me in the file processing.js, I am trying it in firefox, even I have downoaded the examples of processing.js, processing-js-0.6-examples. The example that I need is processing-js-0.6-examples\examples\topics\imagebutton.html and it also give me errors.
The error on firefox:

Error: uncaught exception: [Exception... "Security error"  code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "file:///C:/Documents%20and%20Settings/MGON035/Mis%20documentos/HTLM%205%20(CANV
AS)/processing-js-0.6-examples/processing.js Line: 248"]

Someone might say to me what´s happens or   how  I can load an image in the canvas with (html, javascritp) processing.js?
Thanks.
Re: someone could help me?problems load image
Reply #1 - Mar 11th, 2010, 4:55am
 
It is more a question for the Processing Implementations section (I will move it eventually).
The look of the error might be related to the "same origin" security policy: AFAIK, to avoid security issues, a JavaScript program cannot load a resource (other JS script, images, applets...) from a site different from the one serving the HTML page.
Apparently, you run the JS file from your hard disk. I think you cannot load an image from your hard disk, because it implies JS could read nearly any file from there (and maybe send the info on another site in Russia, China or elsewhere...).

One solution, if you can, is to upload JS files and images to a site you have access to and run from there.
Another solution is to install a Web server (eg. using the Wamp distribution) and run the script from localhost.
Re: someone could help me?problems load image
Reply #2 - Mar 12th, 2010, 5:01am
 
Thanks PhiLho,  it was the problem, I am too absent-minded.
Thanks.

Page Index Toggle Pages: 1