eZ Community » Blogs » A Fowler

Member since: 01/04/2011

Blog entries
  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Rounded corners for user avatars

Tuesday 22 November 2011 09:11

by A Fowler  | 4 comments

I believe I have found an improvement for creating images with rounded corners.  Although various methods for doing this are discussed on these forums, there are various drawbacks, such as the need to use an image mask, or having to apply the filter to all images.

The approach documented below uses only an ImageMagick filter specified in image.ini.append.php, and does not need an image mask file.  It also adjusts to different image sizes automatically, even to rectangular sizes (though it has a fixed corner radius size which you can specify).  Because it's a filter, you can use it on any image alias you like.

Its main downside appears to be that it can only output PNG images-- but I prefer PNG anyways, especially for images this small.  And in many cases, with rounded corners you want the transparency that PNG provides.

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

is_empty for strings

Friday 04 November 2011 05:11

by A Fowler  | 8 comments

A template operator for testing for empty strings would be nice, for testing whether string attributes have any valid value.  I'm thinking of something like empty($val) or is_empty($val).  I can't believe it's not there-- am I missing it somewhere?

UPDATE: You can use PHP's empty() function by enabling it in template.ini.append.php.  In my example, I rename it to is_empty to match the other similar template operators such as is_set:

[PHP]
PHPOperatorList[is_empty]=empty

You must be logged in to track the activity of this blog!

Proudly Developed with from