Skip to content

Loading xcf file with guidlines fails #9

@odeaxcsh

Description

@odeaxcsh

It's simple if there are any guidelines in the file, the following error occurs.

I am using gimpformats==2023 version, which I assume is the latest.

self.document = GimpDocument(filePath)
  File ".../python3.10/site-packages/gimpformats/gimpXcfDocument.py", line 80, in __init__
    self.load(fileName)
  File ".../python3.10/site-packages/gimpformats/gimpXcfDocument.py", line 88, in load
    self.decode(data)
  File ".../python3.10/site-packages/gimpformats/gimpXcfDocument.py", line 133, in decode
    self._propertiesDecode(ioBuf)
  File ".../python3.10/site-packages/gimpformats/GimpIOBase.py", line 668, in _propertiesDecode
    self._propertyDecode(propertyType, ioBuf.getBytes(dataLength))
  File ".../python3.10/site-packages/gimpformats/GimpIOBase.py", line 408, in _propertyDecode
    self._guidelinesDecode(data)
  File ".../python3.10/site-packages/gimpformats/GimpIOBase.py", line 268, in _guidelinesDecode
    isVertical = struct.unpack(">c", data[index])[0] == 2
TypeError: a bytes-like object is required, not 'int'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions