I have been compiling ART myself on Kubuntu 22.04 (and other versions of Ubuntu) for a long time. Today I added OpenColorIO and I git cloned the ART imageio repo. I ran the “pip” command to install Python dependencies such as pillow_heif. I used apt to install the Ubuntu supplied python3-tifffile DEB package. I copied the imageio Python scripts/data to $HOME/.config/ART1.0/imageio and ran the new ART. I attempt to output a HDR image using “HEIC (PQ HDR-TV 1000nits)” as the file format in ART. So far so good. Then I get an error writing the file. I ran strace to trace what ART is doing to create the file and I see this is run by ART from the $HOME/.config/ART1.0/imageio directory (ART creates a pipe to the below command so ART is able to read the stdout and stderr of the process):
“python hif/heif_io.py -m write -p 1000 /tmp/input.tif DSC_2879.heic”.
To help me trouble shoot I use ART to generate a 32bit float TIFF image and run that python stuff from a terminal and I get this:
tompkinj@zjct1:~/.config/ART1.0/imageio> python hif/heif_io.py -m write -p 1000 ~/DSC_2879.tif ~/DSC_2879.heic
loading: 0.008 s
encoding: 0.009 s
saving: 0.004 s
Traceback (most recent call last):
File “/home/tompkinj/.config/ART1.0/imageio/hif/heif_io.py”, line 324, in
main()
File “/home/tompkinj/.config/ART1.0/imageio/hif/heif_io.py”, line 318, in main
write(opts)
File “/home/tompkinj/.config/ART1.0/imageio/hif/heif_io.py”, line 312, in write
heif_file.save(opts.output, quality=80)
File “/home/tompkinj/.local/lib/python3.10/site-packages/pillow_heif/heif.py”, line 685, in save
self._save(heif_ctx_write, images_to_save, primary_index, **kwargs)
File “/home/tompkinj/.config/ART1.0/imageio/hif/heif_io.py”, line 285, in my_save
pillow_heif.heif.set_color_profile(img.heif_img, img.info)
File “/home/tompkinj/.local/lib/python3.10/site-packages/pillow_heif/private.py”, line 164, in set_color_profile
v = nclx_profile.get(i, None)
AttributeError: ‘bytes’ object has no attribute ‘get’
The above is the same error output (on file descriptor 2 which is stderr piped to ART) as I see when running the strace on the actual ART command so I think the above replicates the issue.
Problem is I know very little about Python so I don’t know how to debug any further. Anyone have ideas on how to fix “AttributeError: ‘bytes’ object has no attribute ‘get’” ? Its probably something I did wrong in setting it all up.