Reputation: 95900
I am wondering whats the best way to programmatically make rounded corners for images. This can be either using PHP or javascript. An algorithm will also do for the same and I can code it with Image::Magick or GD.
Thank you for your time.
Upvotes: 1
Views: 1635
Reputation: 55956
Use border-radius
.
It is supported in IE9+, Firefox 4+, Chrome, Safari 5+, and Opera.
For the best possible browser support, you should prefix with -webkit-
and -moz-
:
.round {
/* Safari 3-4, iOS 1-3.2, Android 1.6- */
-webkit-border-radius: 12px;
/* Firefox 1-3.6 */
-moz-border-radius: 12px;
/* Opera 10.5, IE 9, Safari 5, Chrome, Firefox 4, iOS 4, Android 2.1+ */
border-radius: 12px;
}
If you need a JavaScript solution for older browsers check out jQuery Corner.
Upvotes: 2
Reputation: 272106
Here are links for two PHP based solutions:
Upvotes: 1
Reputation: 9511
use JavaScript to programatically get round corners
OR
you can use mozilla and safaris browser extensions to get round corners using CSS but it will work only in Mozilla and Safari
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
Upvotes: 1
Reputation: 214
You can use the above mention tags with CSS, and for IE, use DDRoundies with some jquery code to make it work in IE. It is what I had to do to get it working. Good example of this is http://swiftmailer.org/ site. they make use of what I mentioned.
Upvotes: 1
Reputation: 83599
Well, it depends what exactly you need. Do you want the corners to be transparent, or filled in some color? Which image format?
Here is some help for making rounded corners: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=8401
Check it out, and if it does not help, update your question with the specific problem. Then we can probably help :-):
Upvotes: 1