#1280 print: ignore undecodable pages
This commit is contained in:
parent
d83537f774
commit
e7ec41b8d5
2 changed files with 28 additions and 14 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## <a id="unreleased"></a>[Unreleased]
|
## <a id="unreleased"></a>[Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Albums: improved album creation feedback
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- crash when playing video with DCL restriction enabled
|
||||||
|
- printing multi-page items containing some unprintable pages
|
||||||
|
- English (Shavian) locale tags for store listing
|
||||||
|
|
||||||
## <a id="v1.11.17"></a>[v1.11.17] - 2024-10-30
|
## <a id="v1.11.17"></a>[v1.11.17] - 2024-10-30
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -105,23 +105,27 @@ class EntryPrinter with FeedbackMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<pdf.Widget?> _buildPageImage(AvesEntry entry) async {
|
Future<pdf.Widget?> _buildPageImage(AvesEntry entry) async {
|
||||||
if (entry.isSvg) {
|
try {
|
||||||
final data = await mediaFetchService.getSvg(
|
if (entry.isSvg) {
|
||||||
entry.uri,
|
final data = await mediaFetchService.getSvg(
|
||||||
entry.mimeType,
|
entry.uri,
|
||||||
sizeBytes: entry.sizeBytes,
|
entry.mimeType,
|
||||||
);
|
sizeBytes: entry.sizeBytes,
|
||||||
if (data.isNotEmpty) {
|
);
|
||||||
return pdf.SvgImage(
|
if (data.isNotEmpty) {
|
||||||
svg: utf8.decode(data),
|
return pdf.SvgImage(
|
||||||
|
svg: utf8.decode(data),
|
||||||
|
fit: _fit,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return pdf.Image(
|
||||||
|
await flutterImageProvider(entry.uriImage),
|
||||||
fit: _fit,
|
fit: _fit,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} catch (error) {
|
||||||
return pdf.Image(
|
debugPrint('failed to load image for entry=$entry, error=$error');
|
||||||
await flutterImageProvider(entry.uriImage),
|
|
||||||
fit: _fit,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue