Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Mar 26, 2024
1 parent cc5a7bf commit 0faeb42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Libraries/PyKotor/src/pykotor/resource/formats/tpc/io_tga.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from enum import IntEnum
from typing import TYPE_CHECKING

from utility.logger_util import get_root_logger

try:
from PIL import Image
pillow_available = True
Expand Down Expand Up @@ -202,7 +204,7 @@ def _load_with_pillow(
texture_format = TPCTextureFormat.RGBA
new_img = img.convert("RGBA") # Ensure the image is in RGBA format
else: # TODO: ???
print(f"Unknown pillow TGA format '{img.mode}'")
get_root_logger().warning(f"Unknown pillow TGA format '{img.mode}'")
texture_format = TPCTextureFormat.RGBA
new_img = img.convert("RGBA") # Ensure the image is in RGBA format
return
Expand Down Expand Up @@ -300,7 +302,7 @@ def _load_with_custom_logic(
# Set the texture format based on the bits per pixel
datacode_name = next((c.name for c in _DataTypes if c.value == datatype_code), _DataTypes.NO_IMAGE_DATA.name)
self._tpc.original_datatype_code = _DataTypes.__members__[datacode_name]
print("tga datatype_code:", datacode_name, "y_flipped:", y_flipped, "bits_per_pixel:", bits_per_pixel)
get_root_logger().debug("tga datatype_code:", datacode_name, "y_flipped:", y_flipped, "bits_per_pixel:", bits_per_pixel)
texture_format = TPCTextureFormat.RGBA if bits_per_pixel == 32 else TPCTextureFormat.RGB
self._tpc.set_data(width, height, [bytes(data)], texture_format)

Expand Down

0 comments on commit 0faeb42

Please sign in to comment.