StringBuilder assembleConfig ( boolean meta ) { StringBuilder builder = new StringBuilder ( ) ; if ( meta ) { builder . append ( PREFIX_META ) ; } if ( isTrim ) { builder . append ( PART_TRIM ) ; if ( trimPixelColor != null ) { builder . append ( ":" ) . append ( trimPixelColor . value ) ; if ( trimColorTolerance > 0 ) { builder . append ( ":" ) . append ( trimColorTolerance ) ; } } builder . append ( "/" ) ; } if ( hasCrop ) { builder . append ( cropLeft ) . append ( "x" ) . append ( cropTop ) // . append ( ":" ) . append ( cropRight ) . append ( "x" ) . append ( cropBottom ) ; builder . append ( "/" ) ; } if ( hasResize ) { if ( fitInStyle != null ) { builder . append ( fitInStyle . value ) . append ( "/" ) ; } if ( flipHorizontally ) { builder . append ( "-" ) ; } if ( resizeWidth == ORIGINAL_SIZE ) { builder . append ( "orig" ) ; } else { builder . append ( resizeWidth ) ; } builder . append ( "x" ) ; if ( flipVertically ) { builder . append ( "-" ) ; } if ( resizeHeight == ORIGINAL_SIZE ) { builder . append ( "orig" ) ; } else { builder . append ( resizeHeight ) ; } if ( isSmart ) { builder . append ( "/" ) . append ( PART_SMART ) ; } else { if ( cropHorizontalAlign != null ) { builder . append ( "/" ) . append ( cropHorizontalAlign . value ) ; } if ( cropVerticalAlign != null ) { builder . append ( "/" ) . append ( cropVerticalAlign . value ) ; } } builder . append ( "/" ) ; } if ( filters != null ) { builder . append ( PART_FILTERS ) ; for ( String filter : filters ) { builder . append ( ":" ) . append ( filter ) ; } builder . append ( "/" ) ; } builder . append ( isLegacy ? md5 ( image ) : image ) ; return builder ; }
Assemble the configuration section of the URL .