Skip to content

Commit

Permalink
Fix tga decoding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
crlf0710 committed Feb 14, 2024
1 parent ea6425f commit c198d0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inox2d/src/texture/tga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ pub fn read_tga<R: Read + Seek>(reader: &mut R) -> Result<TgaImage, TgaDecodeErr
let channels: TgaChannels = (header.bits_pp / 8).try_into().unwrap(); // bytes per pixel
let tchans = 4;
let linebuf_size = header.width * channels as u16;
let tline_size = header.height * tchans;
let tline_size = header.width * tchans;

let flip = !is_origin_at_top;
let tstride = if flip { -(tline_size as i32) } else { tline_size as i32 };
Expand Down

0 comments on commit c198d0e

Please sign in to comment.