html5 - Canvas getImageData() after drawing image from file:// URI - need workaround for all browsers -



html5 - Canvas getImageData() after drawing image from file:// URI - need workaround for all browsers -

i'm developer of build 2, html5 game editor windows. it's @ http://www.scirra.com.

recently i've been trying add together feature modify image transforming on canvas. it's pretty straightforward - draw image canvas , phone call getimagedata() pixels.

when user clicks 'preview' in our application, files dumped temp file on disk , browser launched show it. uploading server not alternative previewing - games megabytes big.

however browsers block using getimagedata() pixels of any image loaded disk @ all. i've tried putting necessary image files in subdirectories mdn suggests in description of file:// access policies. doesn't work either!

chrome's --allow-file-access-from-files flag fixes it. however, need back upwards major browsers. there similar workaround @ to the lowest degree net explorer , firefox? have no thought net explorer, , wish there's doesn't involve manually going about:config in firefox, otherwise deluged in back upwards requests asking "why doesn't work in firefox?!".

also, why on earth security policy necessary?!? seems way on top , makes applications ours hard write.

any help appreciated.

your name sounds familiar hn.

this pretty laid out in stone in spec now, though upsets awful lot of people. http:// , file:// different origins, , tries set 1 on other dirty origin. noted file uri's have own set of rules create things trickier.

drawing canvas origin not same? bad, origin-clean flag henceforth false, disallows doing various things.

a finish list of things located in spec here.

but i'm sure know now. want around it.

i'd suggest ins instead of trying strong-arm browsers around it, bundle in kind of lightweight web service things appearing same origin. cause lot fewer headaches in future.

you'll want python simplehttpserver. decision depends on you've got included in product @ point.

html5 canvas same-origin-policy getimagedata file-uri

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -