Showing
2 changed files
with
12 additions
and
4 deletions
@@ -96,10 +96,17 @@ class PdfJpegInfo { | @@ -96,10 +96,17 @@ class PdfJpegInfo { | ||
96 | ? null | 96 | ? null |
97 | : utf8.decode(tags[PdfExifTag.FlashpixVersion]); | 97 | : utf8.decode(tags[PdfExifTag.FlashpixVersion]); |
98 | 98 | ||
99 | - PdfImageOrientation get orientation => | ||
100 | - tags == null || tags[PdfExifTag.Orientation] == null | ||
101 | - ? PdfImageOrientation.topLeft | ||
102 | - : PdfImageOrientation.values[tags[PdfExifTag.Orientation] - 1]; | 99 | + PdfImageOrientation get orientation { |
100 | + if (tags == null || tags[PdfExifTag.Orientation] == null) { | ||
101 | + return PdfImageOrientation.topLeft; | ||
102 | + } | ||
103 | + | ||
104 | + try { | ||
105 | + return PdfImageOrientation.values[tags[PdfExifTag.Orientation] - 1]; | ||
106 | + } on RangeError { | ||
107 | + return PdfImageOrientation.topLeft; | ||
108 | + } | ||
109 | + } | ||
103 | 110 | ||
104 | double get xResolution => tags == null || tags[PdfExifTag.XResolution] == null | 111 | double get xResolution => tags == null || tags[PdfExifTag.XResolution] == null |
105 | ? null | 112 | ? null |
-
Please register or login to post a comment