David PHAM-VAN

Fix Exif decoding

@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 4
5 - Add annotations [John Harris] 5 - Add annotations [John Harris]
6 - Improve image decoding error messages 6 - Improve image decoding error messages
  7 +- Fix Exif decoding
7 8
8 ## 3.4.2 9 ## 3.4.2
9 10
@@ -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++;