0

I am working on a small project on my university and I met a problem with applying grayscale to externally loaded images from Google's Picasa servers in my banner. I try to create a greyscale canvas of any image loaded but when trying to get image data i can see Security Error.

I am using jQuery, HTML, PHP and Ajax languages.

Whole project you can find here: Google Code Project

I tried to use this library: $getImageData

But i get an information that my request cannot be handled. I also tried many other libraries and codes but without result.

nkr
  • 3,026
  • 7
  • 31
  • 39

2 Answers2

0

You are making a cross-domain request using the "json" datatype which isn't a valid cross-domain data-type. You should be getting a same origin error. You need to switch to the jsonp datatype.

jQuery('.container').ready(function() {
    jQuery.ajax({
        type: 'GET',
        dataType:'jsonp',
        url: 'https://picasaweb.google.com/data/feed/base/user/115131339234962778181/album/jsite?access=public&kind=photo&alt=json-in-script',

Note, i also changed the url, don't miss that change, it's important.

https://developers.google.com/gdata/docs/json

Kevin B
  • 94,570
  • 16
  • 163
  • 180
0

When you paint external data onto a canvas, it is marked as tainted. Tainting disables your ability to get the image data back from the canvas. However, you should be able to change that behavior using the .crossOrigin attribute

marcus erronius
  • 3,613
  • 1
  • 16
  • 32