提交 Downsampler 类 报错修改

This commit is contained in:
sijainguo 2024-04-26 22:20:29 +08:00
parent 22f79c3588
commit 9c40365fc4
1 changed files with 7 additions and 5 deletions

View File

@ -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