Skip to content

Commit

Permalink
Change row index start from 1
Browse files Browse the repository at this point in the history
  • Loading branch information
edwin0cheng committed Mar 16, 2018
1 parent b567394 commit 4d4ea0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tga/decoder.rs
Expand Up @@ -494,11 +494,11 @@ impl<R: Read + Seek> ImageDecoder for TGADecoder<R> {
// copy to the output buffer
buf[..pixel_data.len()].copy_from_slice(&pixel_data);

let mut row_index = self.line_read.unwrap_or(0);
self.line_read = Some(row_index + 1);
let mut row_index = self.line_read.unwrap_or(0) + 1;
self.line_read = Some(row_index);

if self.is_flipped_vertically() {
row_index = self.height - row_index - 1;
row_index = self.height - (row_index-1);
}

Ok(row_index as u32)
Expand Down

0 comments on commit 4d4ea0b

Please sign in to comment.