mirror of
https://gitee.com/openharmony/applications_photos
synced 2025-02-21 07:31:17 +00:00
commit
0e78bc21e6
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user