Skip to content

Commit

Permalink
BUG: JPEG IO: handle all possible number of components
Browse files Browse the repository at this point in the history
Only componets number 1 to 4 was handled, may be more.
Give warnings about unsupported cases.
  • Loading branch information
issakomi committed Dec 18, 2021
1 parent de5f8e8 commit 139fa77
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Modules/IO/JPEG/src/itkJPEGImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,17 @@ JPEGImageIO::ReadImageInformation()
case 1:
m_PixelType = IOPixelEnum::SCALAR;
break;
case 2:
m_PixelType = IOPixelEnum::VECTOR;
break;
case 3:
m_PixelType = IOPixelEnum::RGB;
break;
case 4:
// FIXME
m_PixelType = IOPixelEnum::RGBA;
itkWarningMacro("JPEG image may be opened incorrectly");
break;
default:
m_PixelType = IOPixelEnum::VECTOR;
itkWarningMacro("JPEG image may be opened incorrectly");
break;
}

Expand Down

0 comments on commit 139fa77

Please sign in to comment.