# HG changeset patch # User Sebastien Jodogne # Date 1530883133 -7200 # Node ID b71c59312bae45d50b22441e87bf05218afeb89e # Parent f77c7b48f798b75cedd5e68f7026c214069039b9 fix MIME type for PAM images diff -r f77c7b48f798 -r b71c59312bae OrthancServer/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Thu Jul 05 21:02:50 2018 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Fri Jul 06 15:18:53 2018 +0200 @@ -366,7 +366,15 @@ void EncodeUsingPam() { - format_ = "image/pam"; + /** + * "No Internet Media Type (aka MIME type, content type) for + * PBM has been registered with IANA, but the unofficial value + * image/x-portable-arbitrarymap is assigned by this + * specification, to be consistent with conventional values + * for the older Netpbm formats." + * http://netpbm.sourceforge.net/doc/pam.html + **/ + format_ = "image/x-portable-arbitrarymap"; DicomImageDecoder::ExtractPamImage(answer_, image_, mode_, invert_); } @@ -549,9 +557,14 @@ ImageToEncode image(decoded, mode, invert); HttpContentNegociation negociation; - EncodePng png(image); negociation.Register("image/png", png); - EncodeJpeg jpeg(image, call); negociation.Register("image/jpeg", jpeg); - EncodePam pam(image); negociation.Register("image/pam", pam); + EncodePng png(image); + negociation.Register("image/png", png); + + EncodeJpeg jpeg(image, call); + negociation.Register("image/jpeg", jpeg); + + EncodePam pam(image); + negociation.Register("image/x-portable-arbitrarymap", pam); if (negociation.Apply(call.GetHttpHeaders())) {