From 07eaae024b02008d987f65d8cc538b853c2e48de Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@cnes.fr>
Date: Tue, 9 Jan 2018 14:36:40 +0100
Subject: [PATCH] BUG: Fixing bad logic in pixel type lookup. Also add BYT as a
 keyword for uchar images (along with OCT)

---
 Modules/IO/IORAD/src/otbRADImageIO.cxx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Modules/IO/IORAD/src/otbRADImageIO.cxx b/Modules/IO/IORAD/src/otbRADImageIO.cxx
index 9a870c9503..0f7c44a62c 100644
--- a/Modules/IO/IORAD/src/otbRADImageIO.cxx
+++ b/Modules/IO/IORAD/src/otbRADImageIO.cxx
@@ -325,31 +325,31 @@ bool RADImageIO::InternalReadHeaderInformation(const std::string& file_name, std
   file >> lStrCodePix;
 
   lStrCodePix = itksys::SystemTools::UpperCase(lStrCodePix);
-  if (lStrCodePix == "OCT")
+  if (lStrCodePix == "OCT" || lStrCodePix == "BYT")
     {
     m_PixelType = SCALAR;
     SetComponentType(UCHAR);
     m_BytePerPixel = 1;
     }
-  if (lStrCodePix == "PHA")
+  else if (lStrCodePix == "PHA")
     {
     m_PixelType = SCALAR;
     SetComponentType(CHAR);
     m_BytePerPixel = 1;
     }
-  if (lStrCodePix == "I2")
+  else if (lStrCodePix == "I2")
     {
     m_PixelType = SCALAR;
     SetComponentType(SHORT);
     m_BytePerPixel = 2;
     }
-  if (lStrCodePix == "I4")
+  else if (lStrCodePix == "I4")
     {
     m_PixelType = SCALAR;
     SetComponentType(INT);
     m_BytePerPixel = 4;
     }
-  if (lStrCodePix == "R4")
+  else if (lStrCodePix == "R4")
     {
     m_PixelType = SCALAR;
     SetComponentType(FLOAT);
-- 
GitLab