Merge pull request #8579 from radarhere/tiff_debug

Do not describe raw data as a table
This commit is contained in:
Hugo van Kemenade 2024-12-16 15:16:41 +02:00 committed by GitHub
commit 2c120b53f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -935,8 +935,8 @@ class ImageFileDirectory_v2(_IFDv2Base):
self._tagdata[tag] = data
self.tagtype[tag] = typ
bytes_value = size if size > 32 else repr(data)
msg += f" - value: <table: {bytes_value} bytes>"
msg += " - value: "
msg += f"<table: {size} bytes>" if size > 32 else repr(data)
logger.debug(msg)
@ -981,11 +981,8 @@ class ImageFileDirectory_v2(_IFDv2Base):
tagname = TiffTags.lookup(tag, self.group).name
typname = "ifd" if is_ifd else TYPES.get(typ, "unknown")
bytes_value = len(data) if len(data) >= 16 else str(values)
msg = (
f"save: {tagname} ({tag}) - type: {typname} ({typ})"
f" - value: <table: {bytes_value} bytes>"
)
msg = f"save: {tagname} ({tag}) - type: {typname} ({typ}) - value: "
msg += f"<table: {len(data)} bytes>" if len(data) >= 16 else str(values)
logger.debug(msg)
# count is sum of lengths for string and arbitrary data