I'm using grails j2d which in turns uses GraphicsBuilder to make a simple service to scale an image. My problem is specifically accessing the downloaded image height and width attributes in order to pass the correct parameters to the scale method. How do I access these attributes inside the transformations closure?
Controller{
def scale = {
def targetW = new Integer(params?.w?:64)
def targetH = new Integer(params?.h?:48)
renderImage( [width: targetW ,height: targetH ] ) {
image( url: params?.url ){
transformations {
scale( x: 1 , y: 1 , interpolation: 'bicubic' )
}
}
}
}
}