There is a function in R (trim) which removes the NODATA situated in the outer rim of a raster (entire external row or column made of nodata). It is realy simple but quite slow. I am looking afor a similar function or algorithm in gdal to do that. Any idea?