Implement From<u32> instead of u16 for Length and Pixels

This commit is contained in:
Héctor Ramón Jiménez 2025-02-09 06:38:48 +01:00
parent ab236376a3
commit f3ae4266e9
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
6 changed files with 23 additions and 26 deletions

View file

@ -97,10 +97,7 @@ impl Gallery {
Task::batch(vec![
Task::perform(
image.clone().blurhash(
Preview::WIDTH as u32,
Preview::HEIGHT as u32,
),
image.clone().blurhash(Preview::WIDTH, Preview::HEIGHT),
move |result| Message::BlurhashDecoded(id, result),
),
Task::perform(
@ -313,8 +310,8 @@ enum Preview {
}
impl Preview {
const WIDTH: u16 = 320;
const HEIGHT: u16 = 410;
const WIDTH: u32 = 320;
const HEIGHT: u32 = 410;
fn blurhash(rgba: Rgba) -> Self {
Self::Blurhash(Blurhash {