"Correct" way to user /tools/create-dicom for png or jpg images ? "The installed image decoding plugins cannot handle an image"

I’ve been using /tools/create-dicom to create series consisting of a single encapsualted PDF instance without a problem using pdfkit in a orthanc Python plug-in to convert raw HTML to a PDF, and then posting the following JSON to /tools/create-dicom from the Plug-in:

‘{“Tags” : {“Modality”:“SR”, “Manufacturer”: “REPORT”, “OperatorsName”:"’ + query[‘author’] + ‘“, “SeriesDescription”:”’ + query[‘title’] + ‘",“SOPClassUID”:“1.2.840.10008.5.1.4.1.1.104.1”},“Content” : "data:application/pdf;base64,’ + query[‘base64’] + ‘“, “Parent”:”’ + query[‘studyuuid’]+ ‘"}’

1.2.840.10008.5.1.4.1.1.104.1 is thte SOPClassUID for Encapsulated PDF IOD.

I’ve been experimenting with various methods to create “Key Images” by creating a data-url for jpeg or png images in a similar fashion, but I’m trying:

SOPClassUID: 1.2.840.10008.5.1.4.1.1.7
Content": ‘data:image/jpeg;base64,’+jpegimage or ‘data:image/png;base64,’+pngimage

I won’t go into the details yet, but it looks like I am running into an issue sometimes because I am getting this error:

The installed image decoding plugins cannot handle an image, fallback to the built-in DCMTK decoder.

I can examine the raw pixel data and that does indeed decode to a png or jpeg image that can be displayed in a standard application.

Just wondering if there is a way to fix that by adjusting something in my orthanc.json config, etc.

May have resolved my issue by using the “html2canvas” JS library to create a “viewer-pane frame-grab” as a jpeg data-url on the client side and then just add them as before with the Python Plug-in script. Seems like it may have been an issue with using wkhtmltoimage for the html to data-url conversion.

/sds