packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

Fails to display EPUB contents due to flutter svg parser failure

Open GeekyGeeky opened this issue 2 years ago • 0 comments

When I tried running the flutter epub view package I get an error as shown below and I do not understand why

══╡ EXCEPTION CAUGHT BY SVG ╞═══════════════════════════════════════════════════════════════════════ The following UnsupportedError was thrown resolving a single-frame picture stream: Unsupported operation: Could not resolve image href: cover_image.jpg

When the exception was thrown, this was the stack: #0 resolveImage (package:flutter_svg/src/svg/parsers.dart:231:3) #1 _Elements.image (package:flutter_svg/src/svg/parser_state.dart:583:31) #2 SvgParserState.parse (package:flutter_svg/src/svg/parser_state.dart:948:26) #3 SvgParser.parse (package:flutter_svg/parser.dart:27:12) #4 Svg.fromSvgString (package:flutter_svg/svg.dart:137:12) #5 Svg.svgPictureStringDecoder (package:flutter_svg/svg.dart:89:34)

I can share an example epub file causing the issue, I believe it has to do with parsing a jpg image in the epub file

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

  • Device: Tecno Pova
  • OS: Android 10

GeekyGeeky avatar Dec 29 '21 00:12 GeekyGeeky