File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -779,7 +779,7 @@ impl ImageFileDirectory {
779
779
let range = self
780
780
. get_tile_byte_range ( x, y)
781
781
. ok_or ( AsyncTiffError :: General ( "Not a tiled TIFF" . to_string ( ) ) ) ?;
782
- let compressed_bytes = reader. get_bytes ( range) . await ?;
782
+ let compressed_bytes = reader. get_tile_bytes ( range) . await ?;
783
783
Ok ( Tile {
784
784
x,
785
785
y,
@@ -810,7 +810,7 @@ impl ImageFileDirectory {
810
810
. collect :: < AsyncTiffResult < Vec < _ > > > ( ) ?;
811
811
812
812
// 2: Fetch using `get_ranges
813
- let buffers = reader. get_byte_ranges ( byte_ranges) . await ?;
813
+ let buffers = reader. get_tile_byte_ranges ( byte_ranges) . await ?;
814
814
815
815
// 3: Create tile objects
816
816
let mut tiles = vec ! [ ] ;
Original file line number Diff line number Diff line change @@ -52,6 +52,18 @@ pub trait AsyncFileReader: Debug + Send + Sync {
52
52
}
53
53
. boxed ( )
54
54
}
55
+
56
+ /// Same as [`get_bytes`], but this function is called when retrieving
57
+ /// compressed tile data
58
+ fn get_tile_bytes ( & self , range : Range < u64 > ) -> BoxFuture < ' _ , AsyncTiffResult < Bytes > > {
59
+ self . get_bytes ( range)
60
+ }
61
+
62
+ /// Same as [`get_byte_ranges`], but this function is only called when retrieving
63
+ /// compressed tile data
64
+ fn get_tile_byte_ranges ( & self , ranges : Vec < Range < u64 > > ) -> BoxFuture < ' _ , AsyncTiffResult < Vec < Bytes > > > {
65
+ self . get_byte_ranges ( ranges)
66
+ }
55
67
}
56
68
57
69
/// This allows Box<dyn AsyncFileReader + '_> to be used as an AsyncFileReader,
You can’t perform that action at this time.
0 commit comments