Showing
1 changed file
with
6 additions
and
1 deletions
@@ -112,7 +112,12 @@ class PdfJpegInfo { | @@ -112,7 +112,12 @@ class PdfJpegInfo { | ||
112 | } | 112 | } |
113 | 113 | ||
114 | try { | 114 | try { |
115 | - return PdfImageOrientation.values[tags![PdfExifTag.Orientation] - 1]; | 115 | + final int index = tags![PdfExifTag.Orientation] - 1; |
116 | + const orientations = PdfImageOrientation.values; | ||
117 | + if (index >= 0 && index < orientations.length) { | ||
118 | + return orientations[index]; | ||
119 | + } | ||
120 | + return PdfImageOrientation.topLeft; | ||
116 | } on RangeError { | 121 | } on RangeError { |
117 | return PdfImageOrientation.topLeft; | 122 | return PdfImageOrientation.topLeft; |
118 | } | 123 | } |
-
Please register or login to post a comment