Skip to content

Commit

Permalink
HEICの添付は無視する
Browse files Browse the repository at this point in the history
  • Loading branch information
4ster1sk committed Nov 7, 2024
1 parent ea1abd8 commit f9fb2e1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class NoteCreateNotifier extends _$NoteCreateNotifier {
final file = _fileSystem.file(media);
final fileName = file.basename;
final extension = fileName.split(".").last.toLowerCase();
if (["jpg", "png", "gif", "webp"].contains(extension)) {
if (["jpg", "png", "gif", "webp", "heic"].contains(extension)) {
return ImageFile(
data: await loadImage(file),
fileName: fileName,
Expand Down Expand Up @@ -615,7 +615,10 @@ class NoteCreateNotifier extends _$NoteCreateNotifier {
),
);

state = state.copyWith(files: [...state.files, ...files]);
state = state.copyWith(files: [
...state.files,
...files.where((file) => file.data.isNotEmpty)
]);
}
}

Expand All @@ -639,6 +642,8 @@ class NoteCreateNotifier extends _$NoteCreateNotifier {
}

return img;
} else if (mime == "image/heic") {
return Uint8List(0);
}
return imageBytes;
}
Expand Down

0 comments on commit f9fb2e1

Please sign in to comment.