7 Replies - 1891 Views - Last Post: 12 May 2013 - 05:09 PM

Is it possible to output stored text as images? (images of the text)

Posted 12 May 2013 - 01:12 PM

Hello,
I'm creating an online language learning site that provides language drills. One of the drills is simply a multiple choice question asking the meaning of the word, the user chooses the option (form submission) and through php checks right or wrong.

My problem is that there are software's out there that provide translation of the word when you hover over it (see Rikaichan). I could solve this if the text were an image. But because the database is huge I can't possibly manually convert each text into a screenshot image, cropp and re-store it.

Re: Is it possible to output stored text as images? (images of the text)

Posted 12 May 2013 - 01:46 PM

The PHP-GD library can convert text to images. There is a link on the left of the linked page to the ImageMagick library as well. I don't know the difference between these but I would guess that IM is more extensive.

Re: Is it possible to output stored text as images? (images of the text)

Posted 12 May 2013 - 01:47 PM

Hey.

There are ways you can have PHP generate an image based on text. See imagettftext, for example.

However, I have to ask. Why bother doing this in the first place? If the people using your site want to cheat, why waste time trying to stop them? It's not like they are hurting anybody but themselves, right?

Re: Is it possible to output stored text as images? (images of the text)

Posted 12 May 2013 - 05:09 PM

Fantastic! Thanks for the answers I will check out the php GD library and see what I can make of things!

With regards to cheating, yeah of course I won't prevent everyone from cheating haha. But it makes it more of a pain to cheat when you can't even copy and paste the word. It would probably be more effort cheating than it's worth, they'd might as well just guess the wrong answer.