Hello, I am Marcus, and go by the name Oldek online. The nickname inherits from an old name generator, and I believe it was 10 years ago when I was quite young and played Tibia (http://www.tibia.com). In my opinion today, this game is a very interesting game. It made me understand so many things. I was partially involved in some OpenTibia movement, which was a reverse engineering of the real Tibia, although it never actually got any large crowd, it made my senses work. As OpenTibia was just a server implementation, you had to create monsters and maps by yourself. By creating maps and following this systems development I was being introduced to what was about to become my life. I saw patters, and items became numbers and variables, I started working with XML and Lua to form my own items and characters/monsters. When I had experimented with this loosely for a year I decided to look into the code itself but got too overwhelmed. I ended up coding websites instead, leading to amazing results for almost no work at all. I have never fancied design, although I have a great interest in architecture.
After a few years with PHP programming it turned out that I had a project comming up. I was to develop the most advanced function I have ever heard of, and it seemed to be so hard, but still doable. I was supposed to develop an image upload and thumbnail script (I didn’t know there was any to just download) and on top of that, create an image with 4 layers with customized font and letter spacing. However, there were some commands to calculate how large each letter was and thereby be able to center the text by a formula. After many hours of no success att all I almost gave up, but it turned out that there was to be another break just before I gave up, every single time. After almost being able to render an image, I had to tell the customer that there is no way to do this. One month later I was done with the function, and it also included a caching of the images so that it woulden’t have to compute a new image every time it was shown in the page.
What I created was:
What is involved is background is white, then there is an image in the first layer of a large 1 with white background. Then there is a header that explains that ”First price goes to:” followed by a new text stating the winner. And there is no such thing as specifying center, or newline, everything is manually calculated.
The trick was:
The image is generated through PHP ImageMagick (http://www.imagemagick.org/)
The font is a special font, which I don’t remember
The url I used to generate these was: <address>/class/make_winner.php?w=1&n=Oldek (there is also a &s=1.0 for letterspacing)
This image is cached through saving the file to: save(‘folder’, md5(w.n.s).’.jpg’); (function is not correct, but you get the idea with the variables).
When accessing the /class/make_winner.php?w=1&n=Oldek address I check if file_exists(‘/img/winners/’.md5(w.n.s).’.jpg’);
And if it does exists then load it instead of creating a new one.
Simple as that I made my first really advanced function, using library ImageMagick. However I was not able to reuse anything of what I created. Everything is trapped in that project, and if I want to do similar functions again I would use a more advanced library that enables me to develop this faster, otherwise create one myself so I can share it with others and reuse it in every project.
First introduction of me and who I am and what I do.
