From 622403f5c5833143d17322c0825c3d2f297c73e8 Mon Sep 17 00:00:00 2001 From: Lexedia Date: Thu, 10 Oct 2024 16:29:37 +0200 Subject: [PATCH] fix format from path.extension --- lib/src/builders/image.dart | 2 +- lib/src/builders/sound.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/builders/image.dart b/lib/src/builders/image.dart index 4759df255..6e414a3e8 100644 --- a/lib/src/builders/image.dart +++ b/lib/src/builders/image.dart @@ -16,7 +16,7 @@ class ImageBuilder { ImageBuilder.gif(this.data) : format = 'gif'; static Future fromFile(File file, {String? format}) async { - format ??= p.extension(file.path); + format ??= p.extension(file.path).substring(1); const formats = { 'png': 'png', diff --git a/lib/src/builders/sound.dart b/lib/src/builders/sound.dart index 084033691..d3b26b34b 100644 --- a/lib/src/builders/sound.dart +++ b/lib/src/builders/sound.dart @@ -13,7 +13,7 @@ class SoundBuilder { SoundBuilder.ogg(this.data) : format = 'ogg'; static Future fromFile(File file, {String? format}) async { - format ??= p.extension(file.path); + format ??= p.extension(file.path).substring(1); const formats = { 'mp3': 'mpeg',