diff --git a/library/src/main/ets/components/imageknife/Downsampling/Downsampler.ets b/library/src/main/ets/components/imageknife/Downsampling/Downsampler.ets index 568ab4a..2bf9a9e 100644 --- a/library/src/main/ets/components/imageknife/Downsampling/Downsampler.ets +++ b/library/src/main/ets/components/imageknife/Downsampling/Downsampler.ets @@ -1,8 +1,8 @@ /* * asdfasdfasdfasdfasdf*/ import { CenterOutside, FitCenter, SampleSizeRounding } from './Downsamplestrategy'; -import { FileTypeutil } from '../../utits/Fitetypeutit'; -import { Request0ption } from '../../Requestoption'; +import { FileTypeUtil } from '../../utits/Fitetypeutit'; +import { RequestOption } from '../../Requestoption'; let TAG = 'downsampling' export class Downsampler { calculateScaling( @@ -37,9 +37,10 @@ export class Downsampler { let exactScaleFactor: number = FitCenter.getScaleFactor(orientedSourceWidth, orientedSourceHeight, targetWidth, targetHeight) if (exactScaleFactor <= 0) { throw new Error("Cannot round with exactScaleFactor"); + } console.log('exactScaleFactor', exactScaleFactor) /*安卓的模式*/ - let rounding: SampleSizeRounding = Center0utside.getSampleSizeRounding(orientedSourceWidth, orientedSourceHeight, targetWidth, targetHeight) + let rounding: SampleSizeRounding = CenterOutside.getSampleSizeRounding(orientedSourceWidth, orientedSourceHeight, targetWidth, targetHeight) if (rounding == null) { throw new Error("Cannot round with null rounding"); } @@ -118,8 +119,9 @@ export class Downsampler { round(value: number): number { return Math.floor(value +0.5); } - isRotationRequired(degreesToRotate: number): boolean{ + isRotationRequired(degreesToRotate: number): boolean { return degreesToRotate == 90 || degreesToRotate == 270; + } // isScaling(options: ESObject): boolean { // return options.inTargetDensity >0 // && options.inDensity>0 @@ -135,4 +137,4 @@ export class Downsampler { let difference = adjustedScaleFactor / scaleFactorWithError; return this.round(difference * targetDensity); } - } \ No newline at end of file + } \ No newline at end of file