Skip to content

IMS responds with octet-stream when image/jpeg is available #90

@cgorman

Description

@cgorman

I'm currently working with a Slim deployment which is retrieving JPEG encoded SM instances. The request's accept header is as follows:

multipart/related; type="image/jls"; transfer-syntax=1.2.840.10008.1.2.4.80, multipart/related; type="image/jls"; transfer-syntax=1.2.840.10008.1.2.4.81, multipart/related; type="image/jp2"; transfer-syntax=1.2.840.10008.1.2.4.90, multipart/related; type="image/jp2"; transfer-syntax=1.2.840.10008.1.2.4.91, multipart/related; type="image/jpx"; transfer-syntax=1.2.840.10008.1.2.4.92, multipart/related; type="image/jpx"; transfer-syntax=1.2.840.10008.1.2.4.93, multipart/related; type="application/octet-stream"; transfer-syntax=*, multipart/related; type="image/jpeg"; transfer-syntax=1.2.840.10008.1.2.4.50

and the response's content type is:
multipart/related;start="<***@resteasy-multipart>";type="application/octet-stream"; boundary***

The source image is JPEG encoded, so I think that since JPEG appears after octet-stream, it chooses octet-stream instead. I assume the issue is introduced here:

},
{
mediaType: octetStreamMediaType,
transferSyntaxUID: octetStreamTransferSyntaxUID
}
])
if (bitsAllocated <= 8) {
mediaTypes.push({
mediaType: jpegMediaType,
transferSyntaxUID: jpegTransferSyntaxUID
})
}

Would it be sufficient to just put push the octet stream mediatype after the jpeg mediatype if statement?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions