private double getCropScaleFactor ( ) { RenditionMetadata original = getOriginalRendition ( ) ; RenditionMetadata webEnabled = AutoCropping . getWebRenditionForCropping ( getAsset ( ) ) ; if ( original == null || webEnabled == null || original . getWidth ( ) == 0 || webEnabled . getWidth ( ) == 0 ) { return 1d ; } return ( double ) original . getWidth ( ) / ( double ) webEnabled . getWidth ( ) ; }
The cropping coordinates are stored with coordinates relating to the web - enabled rendition . But we want to crop the original image so we have to scale those values to match the coordinates in the original image .