New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect color space on decompression of JPEG Baseline with RGB components #2208
Comments
Please note that JPEG-compressed images with PhotometricInterpretation |
Not reproducable: $ curl http://gunter-nb:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.3.6.1.4.1.5962.1.2.14.20040826185059.5457/series/1.3.6.1.4.1.5962.1.3.14.1.20040826185059.5457/instances/1.3.6.1.4.1.5962.1.1.14.1.1.20040826185059.5457/metadata | python -m json.tool | grep -A3 00280004
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2495 0 2495 0 0 110k 0 --:--:-- --:--:-- --:--:-- 110k
"00280004": {
"Value": [
"RGB"
], $ curl -v -O http://gunter-nb:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.3.6.1.4.1.5962.1.2.14.20040826185059.5457/series/1.3.6.1.4.1.5962.1.3.14.1.20040826185059.5457/instances/1.3.6.1.4.1.5962.1.1.14.1.1.20040826185059.5457/rendered
* Expire in 0 ms for 6 (transfer 0x5638080f55c0)
* Expire in 1 ms for 1 (transfer 0x5638080f55c0)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Expire in 0 ms for 1 (transfer 0x5638080f55c0)
* Expire in 0 ms for 1 (transfer 0x5638080f55c0)
* Trying 192.168.2.131...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x5638080f55c0)
* Connected to gunter-nb (192.168.2.131) port 8080 (#0)
> GET /dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.3.6.1.4.1.5962.1.2.14.20040826185059.5457/series/1.3.6.1.4.1.5962.1.3.14.1.20040826185059.5457/instances/1.3.6.1.4.1.5962.1.1.14.1.1.20040826185059.5457/rendered HTTP/1.1
> Host: gunter-nb:8080
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: origin, content-type, accept, authorization
< Date: Tue, 15 Oct 2019 08:24:09 GMT
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< ETag: "-832103520"
< Last-Modified: Tue, 15 Oct 2019 07:52:06 GMT
< Access-Control-Allow-Credentials: true
< Transfer-Encoding: chunked
< Content-Type: image/jpeg
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
<
{ [16392 bytes data]
100 38008 0 38008 0 0 843k 0 --:--:-- --:--:-- --:--:-- 843k $ mediainfo rendered
General
Complete name : rendered
Format : JPEG
File size : 37.1 KiB
FileExtension_Invalid : h3d jpeg jpg jpe jps mpo
Image
Format : JPEG
Width : 756 pixels
Height : 486 pixels
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Compression mode : Lossy
Stream size : 37.1 KiB (100%) |
Sorry, I should have been more precise. The problem only occurs with JPEG images that have been compressed in RGB color space (without color transformation), i.e. image data sets with |
Can you provide me a sample. Typically, the value of the PhotometricInterpretation=RGB is just wrong - the application which compressed it did not adjust the PhotometricInterpretation of the uncompressed image. |
Sure, I will send you a small sample via email.
I strongly argue against trying to provide workarounds for data sets that are not compliant with the standard. If the value of Photometric Interpretation is |
Fixed by dcm4che/dcm4che#565 |
Color images that have PhotometricInterpretation
RGB
are not correctly rendered toimage/jpeg
orimage/png
media type (see also #2192).The text was updated successfully, but these errors were encountered: