Burning Image 0.3 released
Posted by admin - 24/02/10 at 11:02:05 pmNew version of Grails plugin for image manipulation released. Current version allows to:
- scale image with approximate width and height
- scale image with accurate width and height
- add image watermark
- crop image
- write text on image
- mark domain class as image container by using @FileImageContainer annotation
- save image binded to domain class by using ImageUpladService
- validate uploaded image
To read more go to project home page.
Groovy exercises – text wrapping
Posted by admin - 10/02/10 at 12:02:08 amThis is my groovy solution for simple text wrapping problem:
def input = "The quick brown fox jumps over the lazy dog. " String.metaClass.wrap = {token, length -> def line = token def elements = delegate.tokenize().reverse() while(elements.size()){ if ((line + elements.last()).size() < length){ line += ' ' + elements.pop() } else { println line line = token } } if (line != token){ println line } } (input * 10).wrap('>', 72)
February 10, 2010 | In Groovy | No Comments
Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds.
Valid XHTML and CSS.