views:

47

answers:

3

I'm searching for a class or function, to convert, add borders and text (using ttf fonts) to an uploaded image before the image is saved on the server. Do you know something?

+2  A: 

ImageMagick is incredible and has many libraries for PHP

Mike B
If you can use ImageMagick, go for it. It handles TTF rendering way better than plain GD.
Pekka
+1  A: 

You could try the GD library.

You can convert image types using the imagecreatefromjpeg/png/gif and imagejpeg/png/gif functions.

imagerectangle for adding a border (draw a rectangle behind your image).

imagettftext for adding text.

Lots of tutorials online, good luck!

Richard Nguyen
What should I check in the uploaded image to make it hack save?
tom
Sorry Tom, I don't quite understand your question.
Richard Nguyen
Basically, if the tool of your choice manages to open a file and add a watermark to it, you can safely assume that it is a valid image. As long as you use move_uploaded_file() and consorts, there are no specific security risks that come to mind.
Pekka
+2  A: 

Check WideImage and Asido.

Alix Axel