kimoa / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
3 stars 0 forks source link

Data URL conversion FAILED with svg-edit logo.png #851

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Launch svg-edit in Firefox 6.0 on OSX 10.6.8
2. Click on Main Menu and select Image Library
3. Select Demo Library Local
4. Select logo.png

What is the expected output? 

svg-edit logo.png will appear within canvas.

What do you see instead?

Data URL conversion failed: [Exception... "Security error"  code: "1000" 
nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: 
"file:///Volumes/RamDisk/svg-edit_aid_r2038-2011-08-26/extensions/imagelib/index
.html Line: 44"]

In what browser did you experience this problem? (ALL, Firefox, Opera, etc)

Firefox 6.0 on OSX 10.6.8

In what version of SVG-edit does the problem occur? (Latest trunk, 2.5.1,
etc)

svg-edit - Revision 2038: /trunk/editor

Please provide any additional information below.

Above steps and insert of logo.png has worked on previous versions of Firefox 
on OSX 10.6.8 and earlier with svg-edit - Revision 2038: /trunk/editor.

Attempt to load logo.png from "image library"

results in Data URL conversion failed: [Exception... "Security error"  code: 
"1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: 
"file:///Volumes/RamDisk/svg-edit_aid_r2038-2011-08-26/extensions/imagelib/index
.html Line: 43"]

Perhaps better error use with this type of try/catch script for firefox.
Replace the "var imgd = ctx.getImageData(x, y, 1, 1)" with your getImageData 
declaration:

try {
 try { 
var imgd = ctx.getImageData(x, y, 1, 1)  
    } 
catch (e) { 
        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
var imgd = ctx.getImageData(x, y, 1, 1) 
   }
 } catch (e) {throw new Error("unable to access image data: " + e)
}

However, a complete fix to restore usability is preferred!

Thank you.

Original issue reported on code.google.com by jlmtest...@yahoo.com on 31 Aug 2011 at 2:35

GoogleCodeExporter commented 9 years ago
Is this still occurring for you?

Original comment by bret...@gmail.com on 8 Apr 2014 at 2:18

GoogleCodeExporter commented 9 years ago

Original comment by bret...@gmail.com on 8 Apr 2014 at 2:19

GoogleCodeExporter commented 9 years ago

Original comment by bret...@gmail.com on 8 Apr 2014 at 2:20