code: function (img) {
                  // set preview pane dimensions
                  this.previewDimensions = this.calculateDimensions(img.width, img.height);
                  this.previewCanvas.nativeElement.width = this.previewDimensions.width;
                  this.previewCanvas.nativeElement.height = this.previewDimensions.height;
                  this.imageResizeRatio = this.previewDimensions.width / img.width;
                  this.imageDivStyle = {
                      width: this.previewDimensions.width + this.options.cropToolDimensions.width + 'px',
                      height: this.previewDimensions.height + this.options.cropToolDimensions.height + 'px',
                      'margin-left': "calc((100% - " + (this.previewDimensions.width + 10) + "px) / 2 + " + this.options.cropToolDimensions.width / 2 + "px)",
                      'margin-right': "calc((100% - " + (this.previewDimensions.width + 10) + "px) / 2 - " + this.options.cropToolDimensions.width / 2 + "px)",
                  };
                  this.limitsService.setPaneDimensions({ width: this.previewDimensions.width, height: this.previewDimensions.height });
              }
docs: *************** // Utility Methods // *************** // 
  set preview canvas dimensions according to the canvas element of the original image
  @private
  @param {?} img
  @return {?}