!452 修复自定义矩形裁剪异常、清除文件缓存接口导致文件缓存失效
Merge pull request !452 from zgf/master
This commit is contained in:
commit
a1e8e0b15f
|
@ -1,3 +1,7 @@
|
||||||
|
## 3.2.1-rc.0
|
||||||
|
- Fix bug: CropTransformation is used to crop the original image
|
||||||
|
- Fix bug: After calling the clear all file cache interfaces, the file cache becomes invalid
|
||||||
|
|
||||||
## 3.2.0
|
## 3.2.0
|
||||||
- When successfully requesting the network, return the httpcode as well
|
- When successfully requesting the network, return the httpcode as well
|
||||||
- Fix bug: Network error code httpCode returns no data
|
- Fix bug: Network error code httpCode returns no data
|
||||||
|
|
|
@ -398,13 +398,13 @@ struct ImageTransformation {
|
||||||
transformations.push(new CropSquareTransformation());
|
transformations.push(new CropSquareTransformation());
|
||||||
}
|
}
|
||||||
if (this.isCropTop) {
|
if (this.isCropTop) {
|
||||||
transformations.push(new CropTransformation(25, 25, 0));
|
transformations.push(new CropTransformation(100, 100, 0));
|
||||||
}
|
}
|
||||||
if (this.isCropCenter) {
|
if (this.isCropCenter) {
|
||||||
transformations.push(new CropTransformation(25, 25, 1));
|
transformations.push(new CropTransformation(100, 100, 1));
|
||||||
}
|
}
|
||||||
if (this.isCropBottom) {
|
if (this.isCropBottom) {
|
||||||
transformations.push(new CropTransformation(25, 25, 2));
|
transformations.push(new CropTransformation(100, 100, 2));
|
||||||
}
|
}
|
||||||
if (this.isSepia) {
|
if (this.isSepia) {
|
||||||
transformations.push(new SepiaTransformation());
|
transformations.push(new SepiaTransformation());
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"main": "index.ets",
|
"main": "index.ets",
|
||||||
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
|
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "3.2.0",
|
"version": "3.2.1-rc.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ohos/gpu_transform": "^1.0.2"
|
"@ohos/gpu_transform": "^1.0.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -192,7 +192,6 @@ export class FileCache {
|
||||||
if (!this.isInited) {
|
if (!this.isInited) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.isInited = false
|
|
||||||
this.lruCache.clear()
|
this.lruCache.clear()
|
||||||
this.currentMemory = 0;
|
this.currentMemory = 0;
|
||||||
|
|
||||||
|
|
|
@ -56,11 +56,12 @@ export class CropTransformation extends PixelMapTransformation {
|
||||||
let scaledWidth: number = scale * pixelMapWidth;
|
let scaledWidth: number = scale * pixelMapWidth;
|
||||||
let scaledHeight: number = scale * pixelMapHeight;
|
let scaledHeight: number = scale * pixelMapHeight;
|
||||||
let left: number = (this.mWidth - scaledWidth) / 2;
|
let left: number = (this.mWidth - scaledWidth) / 2;
|
||||||
let top: number = Math.abs(this.getTop(pixelMapHeight));
|
let top: number = Math.abs(this.getTop(scaledHeight));
|
||||||
|
toTransform.scaleSync(scale,scale)
|
||||||
let region: image.Region = {
|
let region: image.Region = {
|
||||||
size: {
|
size: {
|
||||||
width: scaledWidth > pixelMapWidth ? pixelMapWidth : scaledWidth,
|
width: this.mWidth,
|
||||||
height: scaledHeight > pixelMapHeight ? pixelMapHeight : scaledHeight
|
height: this.mHeight
|
||||||
},
|
},
|
||||||
x: left < 0 ? 0 : left,
|
x: left < 0 ? 0 : left,
|
||||||
y: top < 0 ? 0 : top
|
y: top < 0 ? 0 : top
|
||||||
|
|
Loading…
Reference in New Issue