You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure how trivially this could be implemented, but detecting top-left field order in itself on TGA files is very trivial. Top-left ordered TGA files draw upside-down on 2.60b clients, but correctly on ETe/ETL clients, so this is something that a mapper can easily overlook.
By checking the 17th byte of the TGA header for value 0x20, you can detect the field order of TGA files - if it's 0x20, the field order is top-left.
Sample bash script
#!/bin/shif [ $#-ne 1 ];thenecho"Usage: $0 <TGA file>"exit 1
fi
tga_file="$1"if [ !-f"$tga_file" ];thenecho"File not found: $tga_file"exit 1
fi
byte=$(xxd -s 17 -l 1 -p "$tga_file")
byte_decimal=$((16#$byte))if(( byte_decimal &0x20));thenecho"The TGA file has a field order of top-left."elseecho"The TGA file has a field order of bottom-left."fi
The text was updated successfully, but these errors were encountered:
Not sure how trivially this could be implemented, but detecting top-left field order in itself on TGA files is very trivial. Top-left ordered TGA files draw upside-down on 2.60b clients, but correctly on ETe/ETL clients, so this is something that a mapper can easily overlook.
By checking the 17th byte of the TGA header for value
0x20
, you can detect the field order of TGA files - if it's0x20
, the field order is top-left.Sample bash script
The text was updated successfully, but these errors were encountered: