diff --git a/packages/camera/camera_ohos/example/ohos/entry/src/ohosTest/ets/test/Ability.test.ets b/packages/camera/camera_ohos/example/ohos/entry/src/ohosTest/ets/test/Ability.test.ets index 25d4c71ff3cd584f5d64f6f8c0ac864928c234c4..0147e4875e25099c79d606cc60a300e9c6e33c9c 100644 --- a/packages/camera/camera_ohos/example/ohos/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/packages/camera/camera_ohos/example/ohos/entry/src/ohosTest/ets/test/Ability.test.ets @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. +* you may not use this file except in compliance with the License . * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 diff --git a/packages/camera/camera_ohos/lib/src/ohos_camera.dart b/packages/camera/camera_ohos/lib/src/ohos_camera.dart index 82521a7d48a49cd66c0ec779a5439d5b3040c744..741f066183d6cebd7bf597743cd3a3e070d23a6a 100644 --- a/packages/camera/camera_ohos/lib/src/ohos_camera.dart +++ b/packages/camera/camera_ohos/lib/src/ohos_camera.dart @@ -465,12 +465,12 @@ class OhosCamera extends CameraPlatform { @override Future getMinZoomLevel(int cameraId) async { - final double? minZoomLevel = await _channel.invokeMethod( + final int? minZoomLevel = await _channel.invokeMethod( 'getMinZoomLevel', {'cameraId': cameraId}, ); - return minZoomLevel!; + return minZoomLevel!.toDouble(); } @override diff --git a/packages/camera/camera_ohos/ohos/camera/src/main/ets/io/flutter/plugins/camera/CameraUtils.ets b/packages/camera/camera_ohos/ohos/camera/src/main/ets/io/flutter/plugins/camera/CameraUtils.ets index 6e00aabb889b11bea6ed4a1a8f2aecd15a887f8d..15d148cde1755f3b49eb585f2ba5d42bbbc6ed06 100644 --- a/packages/camera/camera_ohos/ohos/camera/src/main/ets/io/flutter/plugins/camera/CameraUtils.ets +++ b/packages/camera/camera_ohos/ohos/camera/src/main/ets/io/flutter/plugins/camera/CameraUtils.ets @@ -261,7 +261,7 @@ export class CameraUtils { // 获取支持的最大变焦范围 public static getMaxZoomRatio(captureSession: camera.PhotoSession | camera.VideoSession): number { - let maxZoomRatio: number = -1; + let maxZoomRatio: number = 1; try { let zoomRatioRange: Array = captureSession.getZoomRatioRange(); maxZoomRatio = Math.max(...zoomRatioRange); @@ -304,7 +304,7 @@ export class CameraUtils { // 查询最大曝光补偿值 public static getMaxExposureBias(captureSession: camera.PhotoSession | camera.VideoSession): number { - let maxExposure: number = -1; + let maxExposure: number = 1; try { let biasRangeArray = captureSession.getExposureBiasRange(); if (biasRangeArray.length > 1) {