Menu

#541 Python example DecompressImage.py returning type error

3.1
closed
None
5
2022-11-09
2022-11-08
No

Good afternoon, I'm trying to run a simple image decompression operation using the gdcm python example, and I am SetByteStringValue() is returning:

TypeError: in method 'DataElement_SetByteStringValue', argument 2 expected byte string.

please let me know how I can address this

2 Attachments

Discussion

  • Mathieu Malaterre

    • status: open --> closed
    • assigned_to: Mathieu Malaterre
     
  • Mathieu Malaterre

    I believe you need to cast to byte in python3.x

    data_fixed = bytes(data, encoding= 'utf-8')

     

Log in to post a comment.

MongoDB Logo MongoDB