!72 分布式不支持openasset

Merge pull request !72 from 朱铖丰/master
This commit is contained in:
openharmony_ci 2022-08-23 08:27:39 +00:00 committed by Gitee
commit 0e78bc21e6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 19 additions and 18 deletions

View File

@ -85,11 +85,11 @@ export class PhotoDataImpl extends BrowserDataImpl {
private async checkRotate(mediaItem: MediaItem, fileAsset): Promise<void> {
this.logger.info(`checkRotate`);
let fd = await MediaLibraryAccess.getInstance().openAsset('RW', fileAsset);
this.logger.debug(`get fd ${fd}`);
let imageSourceApi: image.ImageSource = image.createImageSource(fd);
this.logger.debug(`get imageSourceApi ${mediaItem.displayName}`);
try {
let fd = await MediaLibraryAccess.getInstance().openAsset('RW', fileAsset);
this.logger.debug(`get fd ${fd}`);
let imageSourceApi: image.ImageSource = image.createImageSource(fd);
this.logger.debug(`get imageSourceApi ${mediaItem.displayName}`);
let orientation = await imageSourceApi.getImageProperty("Orientation")
this.logger.debug(`get imageSourceApi ${mediaItem.displayName} success ${orientation}`);
mediaItem.setOrientation(orientation)

View File

@ -18,22 +18,23 @@ export struct LoadingPanel {
@Consume isLoading: boolean;
build() {
Column() {
if (this.isLoading) {
Column() {
LoadingProgress().width($r('app.float.loading_panel_icon_w'))
.height($r('app.float.loading_panel_icon_w'))
.margin({ bottom: $r('app.float.loading_panel_icon_margin') })
Text($r('app.string.image_loading'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontFamily($r('app.string.id_text_font_family_regular'))
.fontColor($r('sys.color.ohos_id_color_text_secondary'))
Column() {
LoadingProgress().width($r('app.float.loading_panel_icon_w'))
.height($r('app.float.loading_panel_icon_w'))
.margin({ bottom: $r('app.float.loading_panel_icon_margin') })
Text($r('app.string.image_loading'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontFamily($r('app.string.id_text_font_family_regular'))
.fontColor($r('sys.color.ohos_id_color_text_secondary'))
}
}
.width('100%')
.height('100%')
.padding({ top: $r('app.float.loading_panel_item_gap') })
.alignItems(HorizontalAlign.Center)
.justifyContent(FlexAlign.Center)
}
.width('100%')
.height('100%')
.padding({ top: $r('app.float.loading_panel_item_gap') })
.alignItems(HorizontalAlign.Center)
.justifyContent(FlexAlign.Center)
.visibility(this.isLoading ? Visibility.Visible : Visibility.None)
}
}