gre / transitions.glsl.io

WE HAVE MOVED TO
https://gl-transitions.com/
Other
91 stars 10 forks source link

imgur for user images #72

Closed gre closed 10 years ago

gre commented 10 years ago
rectalogic commented 10 years ago

I'm not sure imgur supports CORS which would be required for this to work. http://imgur.userecho.com/topic/105409-enable-cross-origin-resource-sharing-cors/

gre commented 10 years ago

You don't need CORS to be supported if you are requested the image anonymously with img.crossOrigin="Anonymous".

I've just tested with a random image from imgur and it works.

gre commented 10 years ago

screen shot 2014-06-18 at 21 11 33

gre commented 10 years ago

https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image

rectalogic commented 10 years ago

Oh, actually it looks like imgur does support CORS. Just did a test image with crossorigin and got these response headers:

HTTP/1.1 200 OK
Date: Wed, 18 Jun 2014 19:25:00 GMT
Server: cat factory 1.0
Last-Modified: Wed, 18 Jun 2014 07:50:49 GMT
ETag: "e765f2c68628170252b82301797e408e"
Content-Type: image/jpeg
cache-control: public, max-age=31536000
Content-Length: 103247
Accept-Ranges: bytes
Age: 41651
X-Served-By: cache-iad2127-IAD, cache-lax1433-LAX
X-Cache: MISS, HIT
X-Cache-Hits: 0, 17855
X-Timer: S1403119500.841635,VS0,VE0
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Origin: *
Keep-Alive: timeout=10, max=50
Connection: Keep-Alive

Without CORS you may be able to load the texture but the canvas would be tainted.

gre commented 10 years ago

ok cool

gre commented 10 years ago

imgur URL are supported, leaving the extra features for later, overkill for now.