Improve image loading

This commit is contained in:
2025-01-16 17:51:43 +08:00
parent 5d1d62e157
commit c640e6bfbf
13 changed files with 144 additions and 35 deletions

View File

@@ -224,7 +224,7 @@ class _ImageFavoritesPhotoViewState extends State<ImageFavoritesPhotoView> {
onClick: () async {
var temp = images[currentPage];
var imageProvider = ImageFavoritesProvider(temp);
var data = await imageProvider.load(null);
var data = await imageProvider.load(null, null);
var fileType = detectFileType(data);
var fileName = "${currentPage + 1}.${fileType.ext}";
await saveFile(filename: fileName, data: data);

View File

@@ -673,6 +673,7 @@ ImageProvider _createImageProviderFromKey(
reader.type.comicSource?.key,
reader.cid,
reader.eid,
reader.page,
);
}

View File

@@ -650,6 +650,7 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
reader.type.comicSource!.key,
reader.cid,
reader.eid,
reader.page,
);
}
return InkWell(

View File

@@ -131,9 +131,10 @@ class _ReaderSettingsState extends State<ReaderSettings> {
"On the image browsing page, you can quickly collect images by sliding horizontally or vertically according to your reading mode"
.tl,
).toSliver(),
_PopupWindowSetting(
_CallbackSetting(
title: "Custom Image Processing".tl,
builder: () => _CustomImageProcessing(),
callback: () => context.to(() => _CustomImageProcessing()),
actionTitle: "Edit".tl,
).toSliver(),
],
);
@@ -163,10 +164,25 @@ class __CustomImageProcessingState extends State<_CustomImageProcessing> {
super.dispose();
}
int resetKey = 0;
@override
Widget build(BuildContext context) {
return PopUpWidgetScaffold(
title: "Custom Image Processing".tl,
return Scaffold(
appBar: Appbar(
title: Text("Custom Image Processing".tl),
actions: [
TextButton(
onPressed: () {
current = defaultCustomImageProcessing;
appdata.settings['customImageProcessing'] = current;
resetKey++;
setState(() {});
},
child: Text("Reset".tl),
)
],
),
body: Column(
children: [
_SwitchSetting(
@@ -182,6 +198,7 @@ class __CustomImageProcessingState extends State<_CustomImageProcessing> {
),
child: SizedBox.expand(
child: CodeEditor(
key: ValueKey(resetKey),
initialValue: appdata.settings['customImageProcessing'],
onChanged: (value) {
current = value;