Forum Scripting How to use Player.IO's captcha in Unity?

Post your problems and discussions relating to scripting in Unity here.

How to use Player.IO's captcha in Unity?

Postby TheStrategist » July 21st, 2013, 3:00 am

Hello Player.IO Unity community,

I am wondering how can Player.IO's captcha be used in Unity?

Player.IO's captcha generator outputs a GIF image, which cannot be applied to textures in Unity. In addition, such classes in Unity such as WWW (using the LoadImageIntoTexture function, or WWW's texture variable) only accept JPG and PNG formatted data.

I am curious to know how other Unity developers have crossed this hurdle (using captcha in their games). The Unity game I am developing with Player.IO support is a web build (using Unity's Web Player), so I am also unable to save the file to disc. I would need a way of doing this all at run-time and without saving anything to disc.

I would really like to be able to take advantage of this feature and use it in my game, for security purposes. Using Unity's WWW class I am able to get the GIF data into a byte[] but without proper conversion this is useless.

I am grateful and appreciative to anyone who can provide more insight into this, thanks in advance.
Posts: 5
Joined: March 23rd, 2013, 11:53 pm

Re: How to use Player.IO's captcha in Unity?

Postby blitzen » August 3rd, 2013, 5:05 pm

Bump. I've just arrived at this hurdle myself, and come to the same findings.

I've been trying to see what can be done with Texture2D to convert from GIF with something like:
Code: Select all

But unfortunately by the time the WWW instance finishes downloading (without error), the data in its "texture" field is merely the default 8x8 RGB24 question mark that it spits in lieu of holding a valid image. Thus the conversion battle it seems is won or lost on the WWW download.

There's an "Image" class that pops up in searches and might show promise of doing some conversions but seems to be part of some non-standard package and thus I wouldn't know how to compile it with Unity.

One can't help but be curious about PlayerIO's decision to generate Captcha images in GIF format, one of the least-supported and licensure-restricted of the major formats out there, in lieu of plain, simple Jpeg. As Unity is half your supported platform base, I wouldn't imagine you'd do something like that to cut it off from the Captcha utility on SimpleUser registration.

Has anyone managed a solution to this that doesn't involve saving on the client's hard drive?
Posts: 12
Joined: February 6th, 2013, 4:48 am

Return to Scripting