While loading a JPEG-compressed image the pixel type of a gdcmBitmap object changes (from 12 bits allocated to 16).
See line gdcmBitmap.cxx:415.
This is done in a const method, Bitmap::TryJPEGCodec(), called by Bitmap::GetBuffer().
This behaviour raises problems when GDCM is used by ITK: in itkGDCMImageIO.cxx an image gets read, then GetBuffer
is called and afterwards the pixel type is checked for changes (only in Debug mode).