harvard-lts / kakadu-vips

Kakadu JP2 reader and writer for libvips
Apache License 2.0
3 stars 0 forks source link

kakadusave: implement `-rate <n>` parameter #4

Closed scossu closed 5 months ago

scossu commented 6 months ago
>>> img.kakadusave("/data/pytest.jpx", options="-rate 3 Qfactor=90 Cmodes=HT ORGgen_plt=yes Creversible=no Cblk={64,64} ORGtparts=R OGgen_tlm=9")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/dist-packages/pyvips/vimage.py", line 1347, in call_function
    return pyvips.Operation.call(name, self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pyvips/voperation.py", line 305, in call
    raise Error('unable to call {0}'.format(operation_name))
pyvips.error.Error: unable to call kakadusave
  kakadusave: unable to set option -rate

Is there a different way to pass the rate parameter or is it just not implemented yet?

palemieux commented 6 months ago

FYI. rate is not supported directly by some of the KDU SDK API. The size in bytes must instead be specified. See sample code.

jcupitt commented 5 months ago

Ooof, sorry for the delay, there's a PR now. Let's continue any discussion there.