Showing
2 changed files
with
6 additions
and
2 deletions
@@ -23,12 +23,15 @@ import 'image.dart'; | @@ -23,12 +23,15 @@ import 'image.dart'; | ||
23 | class PdfJpegInfo { | 23 | class PdfJpegInfo { |
24 | /// Load a Jpeg image's metadata | 24 | /// Load a Jpeg image's metadata |
25 | factory PdfJpegInfo(Uint8List image) { | 25 | factory PdfJpegInfo(Uint8List image) { |
26 | - final buffer = image.buffer.asByteData(); | 26 | + final buffer = image.buffer.asByteData( |
27 | + image.offsetInBytes, | ||
28 | + image.lengthInBytes, | ||
29 | + ); | ||
27 | 30 | ||
28 | int? width; | 31 | int? width; |
29 | int? height; | 32 | int? height; |
30 | int? color; | 33 | int? color; |
31 | - var offset = image.offsetInBytes; | 34 | + var offset = 0; |
32 | while (offset < buffer.lengthInBytes) { | 35 | while (offset < buffer.lengthInBytes) { |
33 | while (buffer.getUint8(offset) == 0xff) { | 36 | while (buffer.getUint8(offset) == 0xff) { |
34 | offset++; | 37 | offset++; |
-
Please register or login to post a comment