diff --git a/ohos/imagecrop/src/main/ets/components/plugin/ImagecropPlugin.ets b/ohos/imagecrop/src/main/ets/components/plugin/ImagecropPlugin.ets index 889a5b529d8cf1731e5e592f373e3848dc4d3853..c3a14f40958bf9d7077ac74dd5cd4ca5d745cd10 100644 --- a/ohos/imagecrop/src/main/ets/components/plugin/ImagecropPlugin.ets +++ b/ohos/imagecrop/src/main/ets/components/plugin/ImagecropPlugin.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + import { FlutterPlugin, FlutterPluginBinding @@ -140,6 +140,7 @@ export default class ImagecropPlugin implements FlutterPlugin, MethodCallHandler await pixelMapData.crop(region); let dstFile = this.createTemporaryImageFilePath(); await this.savaPixelMap(pixelMapData, dstFile); + await imageSource.release(); result.success(dstFile); } @@ -155,15 +156,18 @@ export default class ImagecropPlugin implements FlutterPlugin, MethodCallHandler } let dstFile = this.createTemporaryImageFilePath(); await this.savaPixelMap(pixelMapData, dstFile); - await this.copyExif(path, dstFile); + await imageSource.release() + // await this.copyExif(path, dstFile); //此方法OHOS接口暂时支持有问题 等新版本在验证 result.success(dstFile); } private async getImageOptions(path: string, result: MethodResult) { - let options = await this.decodeImageOptions(image.createImageSource(path)); + let source = image.createImageSource(path); + let options = await this.decodeImageOptions(source); let properties = new HashMap(); properties.set("width", options.getWidth()); properties.set("height", options.getHeight()); + await source.release(); result.success(properties); }