1.image.createImageSource input parameter arraybuffer need to transform upwards to 'any'
Signed-off-by: zhoulisheng <635547767@qq.com>
This commit is contained in:
parent
8811341b75
commit
e060f02f8e
|
@ -84,7 +84,7 @@ export class Engine {
|
|||
return;
|
||||
}
|
||||
|
||||
var imageResource = image.createImageSource(buffer);
|
||||
var imageResource = image.createImageSource(buffer as any);
|
||||
imageResource.getImageInfo()
|
||||
.then(info => {
|
||||
var height = info.size.height;
|
||||
|
@ -123,7 +123,7 @@ export class Engine {
|
|||
if (!this.checkNeedCompress(buffer)) {
|
||||
return;
|
||||
}
|
||||
var imageResource = image.createImageSource(buffer);
|
||||
var imageResource = image.createImageSource(buffer as any);
|
||||
imageResource.getImageInfo()
|
||||
.then(info => {
|
||||
var height = info.size.height;
|
||||
|
@ -165,7 +165,7 @@ export class Engine {
|
|||
}
|
||||
|
||||
private handResult(buffer: ArrayBuffer, path: string) {
|
||||
var imageRes = image.createImageSource(buffer);
|
||||
var imageRes = image.createImageSource(buffer as any);
|
||||
let a={
|
||||
editable: true,
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ export namespace Crop {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
height: number
|
||||
|
|
|
@ -7,7 +7,7 @@ import ArkWorker from '@ohos.worker'
|
|||
|
||||
export class Pngj {
|
||||
readPngImageInfo(arraybuffer: ArrayBuffer, callback:PngCallback<ArrayBuffer, any>) {
|
||||
let imageSource = image.createImageSource(arraybuffer);
|
||||
let imageSource = image.createImageSource(arraybuffer as any);
|
||||
imageSource.getImageInfo((err, value) => {
|
||||
if (err) {
|
||||
return;
|
||||
|
|
|
@ -41,7 +41,7 @@ export class BlurTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
height: number
|
||||
|
|
|
@ -43,7 +43,7 @@ export class BrightnessFilterTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
|
||||
let imageInfo = await imageSource.getImageInfo();
|
||||
let size = {
|
||||
|
|
|
@ -54,7 +54,7 @@ export class ContrastFilterTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
|
||||
let imageInfo = await imageSource.getImageInfo();
|
||||
let size = {
|
||||
|
|
|
@ -42,7 +42,7 @@ export class CropCircleTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
var that = this;
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
|
|
|
@ -60,7 +60,7 @@ export class CropCircleWithBorderTransformation implements BaseTransform<PixelMa
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
var that = this;
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
|
|
|
@ -39,7 +39,7 @@ export class CropSquareTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
|
||||
squareCrop(buf: ArrayBuffer, request: RequestOption, func?: AsyncTransform<PixelMap>) {
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
imageSource.getImageInfo()
|
||||
.then((p) => {
|
||||
var pw = p.size.width;
|
||||
|
|
|
@ -47,7 +47,7 @@ export class CropTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
height: number
|
||||
|
|
|
@ -34,7 +34,7 @@ export class GrayscaleTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
|
||||
let imageInfo = await imageSource.getImageInfo();
|
||||
let size = {
|
||||
|
|
|
@ -40,7 +40,7 @@ export class InvertFilterTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
|
||||
let imageInfo = await imageSource.getImageInfo();
|
||||
let size = {
|
||||
|
|
|
@ -46,7 +46,7 @@ export class PixelationFilterTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
height: number
|
||||
|
|
|
@ -39,7 +39,7 @@ export class RotateImageTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
height: number
|
||||
|
|
|
@ -56,7 +56,7 @@ export class RoundedCornersTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
var that = this;
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
|
|
|
@ -37,7 +37,7 @@ export class SepiaFilterTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
|
||||
let imageInfo = await imageSource.getImageInfo();
|
||||
let size = {
|
||||
|
|
|
@ -34,7 +34,7 @@ export class SketchFilterTransformation implements BaseTransform<PixelMap> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
TransformUtils.getPixelMapSize(imageSource, (error, size: {
|
||||
width: number,
|
||||
height: number
|
||||
|
|
|
@ -18,7 +18,7 @@ import image from '@ohos.multimedia.image'
|
|||
export class TransformUtils {
|
||||
static centerCrop(buf: ArrayBuffer, outWidth: number, outHeihgt: number,
|
||||
callback?: AsyncTransform<Promise<PixelMap>>) {
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
imageSource.getImageInfo()
|
||||
.then((p) => {
|
||||
var sw;
|
||||
|
@ -57,7 +57,7 @@ export class TransformUtils {
|
|||
}
|
||||
|
||||
static rotateImage(buf: ArrayBuffer, degreesToRotate: number): Promise<PixelMap>{
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
var options = {
|
||||
editable: true,
|
||||
rotate: degreesToRotate
|
||||
|
@ -67,7 +67,7 @@ export class TransformUtils {
|
|||
|
||||
static centerInside(buf: ArrayBuffer, outWidth: number, outHeihgt: number,
|
||||
callback?: AsyncTransform<Promise<PixelMap>>) {
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
imageSource.getImageInfo()
|
||||
.then((p) => {
|
||||
var pw = p.size.width;
|
||||
|
@ -86,7 +86,7 @@ export class TransformUtils {
|
|||
|
||||
static fitCenter(buf: ArrayBuffer, outWidth: number, outHeihgt: number
|
||||
, callback?: AsyncTransform<Promise<PixelMap>>) {
|
||||
var imageSource = image.createImageSource(buf);
|
||||
var imageSource = image.createImageSource(buf as any);
|
||||
imageSource.getImageInfo()
|
||||
.then((p) => {
|
||||
var pw = p.size.width;
|
||||
|
|
|
@ -23,7 +23,7 @@ export class ParseImageUtil implements IParseImage {
|
|||
|
||||
// scale(0,1)
|
||||
parseImageThumbnail(scale: number, imageinfo: ArrayBuffer, onCompleteFunction, onErrorFunction) {
|
||||
let imageSource = image.createImageSource(imageinfo); // 步骤一:文件转为pixelMap 然后变换 给Image组件
|
||||
let imageSource = image.createImageSource(imageinfo as any); // 步骤一:文件转为pixelMap 然后变换 给Image组件
|
||||
imageSource.getImageInfo((err, value) => {
|
||||
if (err) {
|
||||
onErrorFunction(err);
|
||||
|
|
Loading…
Reference in New Issue