I just extended my “image.php”-script (which I have written about in a previous post) to be able to add borders on images. Nothing special really – except the script also supports doing it with rounded corners. Its actually just extending the rounded-corners-function, because it would be a hell doing it manually on a picture, after it had gotten rounded corners.
Its done by adding “edgeborder=htmlcolor”. Like this:
https://www.kaspernj.org/image.php?picture=temp/kasper_test_blog.jpg&edgeborder=0000ff&edgesize=35&bgcolor=000000&force=true&width=400
…which will result in:

This enables me to make nice rounded images with borders – without having to send tons of HTML to the client. The image is even cached through the image.php-cache – saving both the server and the client for tons of calculations. Just sending a cached image to every clinet – wee