diff --git a/lib/widgets/fullscreen/image_view.dart b/lib/widgets/fullscreen/image_view.dart index ef57e061b..55bbfd558 100644 --- a/lib/widgets/fullscreen/image_view.dart +++ b/lib/widgets/fullscreen/image_view.dart @@ -54,12 +54,18 @@ class ImageView extends StatelessWidget { // if the hero tag wraps the whole `PhotoView` and the `loadingBuilder` is not provided, // there's a black frame between the hero animation and the final image, even when it's cached. - final loadingBuilder = (context) => Image( - image: ThumbnailProvider( - entry: entry, - extent: Constants.thumbnailCacheExtent, + final loadingBuilder = (context) => Center( + child: AspectRatio( + // enforce original aspect ratio, as some thumbnails aspect ratios slightly differ + aspectRatio: entry.displayAspectRatio, + child: Image( + image: ThumbnailProvider( + entry: entry, + extent: Constants.thumbnailCacheExtent, + ), + fit: BoxFit.fill, + ), ), - fit: BoxFit.contain, ); Widget child;