Welcome Guest, Not a member yet? Register   Sign In
Dynamic image generation
#11

[eluser]vitoco[/eluser]
that's because i put the text from the input in the "encode" function, to transform to the unwanted chars in the url. Another option is send it encoded with base64, that doest conflict with CI
#12

[eluser]slowgary[/eluser]
That's a thought... in your "create_image.php" script, instead of outputting the image data, base64_encode it and then echo. In your ajax callback, set it as the images src using the data URI scheme, like so:

Code:
//this is what the actual image markup should look like
<img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub/
/ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcpp
V0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7">

//in create_image.php
echo base64_encode($imageData);

//ajax callback
function(data){
     $('#your_image').attr('src', 'data:image/gif;base64,' + data);
}

I think that should work.
#13

[eluser]vitoco[/eluser]
i think "data:image/gif;base64" doesn't work in IE.
#14

[eluser]slowgary[/eluser]
People still use IE? Doh!

It's supported in IE8, but there's a 32kb limit on the data.
#15

[eluser]vitoco[/eluser]
[quote author="slowgary" date="1271811475"]People still use IE? Doh!

It's supported in IE8, but there's a 32kb limit on the data.[/quote]

it's a shame but it's true..."some" people still use it
btw...i love your image, LOL.




Theme © iAndrew 2016 - Forum software by © MyBB