1

I've an issue with the following line in IE9:

canvas.toDataURL('image/png')

When I run this line, IE9 doesn't display my PNG and gives me this error:

SCRIPT122: La zone de données passée à un appel système est insuffisante

Does it mean that the URL is too long to be correctly interpreted? How can I fix that?

Any help is appreciated. Thank you in advance…

kangax
  • 38,898
  • 13
  • 99
  • 135
Zorkzyd
  • 929
  • 3
  • 12
  • 30
  • Are you sure your canvas variable is a proper canvas with >0 dimensions ? And are you sure it doesn't contain cross-domain data ? Have you opened your file in http:// (versus file://) ? – Denys Séguret May 31 '12 at 16:50
  • Yes, my canvas has dimensions >0. I'm sur it doesn't contain cross-domain data. I don't have a file to open. It's generated by the browser :) – Zorkzyd May 31 '12 at 17:34
  • [Just in case](http://stackoverflow.com/questions/10305631/ie9-float-with-overflowhidden-and-table-width-100-not-displaying-properly). I guess you tested it on Chrome and it worked, alright ? – Denys Séguret May 31 '12 at 17:39
  • I tested it on Firefox, Opera, Safari and Chrome, yes. – Zorkzyd Jun 01 '12 at 09:49
  • And you tested the headers I provided in precedent comment ? – Denys Séguret Jun 01 '12 at 09:56
  • Thank you for your help dystroy but I finally found a solution here: http://danielmclaren.com/node/90 I modify this function to retrieve a $_POST value instead of $_SERVER["QUERY_STRING"] because the URL length is limited in IE9. However, thank you very much for your help and your answers. – Zorkzyd Jun 01 '12 at 11:58
  • You should post your comment (enhanced) as answer and accept it, so that this could help somebody else. And you might be interested by [this](http://area51.stackexchange.com/proposals/12692/stack-overflow-in-french?referrer=adVDNkMqm5jZeiYutxUqXw2)... – Denys Séguret Jun 01 '12 at 12:07
  • My English isn't good enough? … Sorry about that. My solution is here: https://github.com/kangax/fabric.js/issues/172#issuecomment-6058563 – Zorkzyd Jun 01 '12 at 12:30
  • Your English is probably better than mine. I was just supposing that this community could interest you, not that you weren't good enough for the original SO... – Denys Séguret Jun 01 '12 at 12:31
  • Sure that I'm interested in this community :) Thanks for all. – Zorkzyd Jun 01 '12 at 12:34

1 Answers1

1

Thanks to this link ( danielmclaren.com/node/90 ), I finally found a solution to display PNG in IE9.

The thing is I have to use $_POST to retrieve the data of the image instead of using the URL and a $_GET. IE9 doesn't support very long URL and cut off the data.

All the process is described on the GitHub of FabricJS:
github.com/kangax/fabric.js/issues/172#issuecomment-6058563

Zorkzyd
  • 929
  • 3
  • 12
  • 30