Skip to content

Commit

Permalink
Fix aspect ratio of non-square offline images
Browse files Browse the repository at this point in the history
Offline images were previously resized with a policy of exact, which caused them to be weirdly stretched if they weren't square.
Setting the policy to fit fixes this issue.
  • Loading branch information
Maxr1998 committed Sep 13, 2024
1 parent defab64 commit 29c42be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/services/album_image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ final AutoDisposeProviderFamily<ImageProvider?, AlbumImageRequest>
// This helps keep cache usage by fileImages in check
// Caching smaller at 2X size results in blurriness comparable to
// NetworkImages fetched with display size
out = ResizeImage(out,
width: request.maxWidth! * 2, height: request.maxHeight! * 2);
out = ResizeImage(
out,
width: request.maxWidth! * 2,
height: request.maxHeight! * 2,
policy: ResizeImagePolicy.fit,
);
}
return out;
});
Expand Down

0 comments on commit 29c42be

Please sign in to comment.