Skip to content

Commit

Permalink
Merge pull request #437 from JeromeMartinez/TIFF_Raw_Y_8_U_LE
Browse files Browse the repository at this point in the history
Add TIFF 8-bit LE
  • Loading branch information
JeromeMartinez authored May 22, 2024
2 parents 755fc4c + d333157 commit 50ab86c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions Project/GNU/CLI/test/test1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ Formats/TIFF/Flavors/Raw_Y_2_U/flower-minisblack-02.tif fail
Formats/TIFF/Flavors/Raw_Y_4_U/flower-minisblack-04.tif fail
Formats/TIFF/Flavors/Raw_Y_6_U/flower-minisblack-06.tif fail
Formats/TIFF/Flavors/Raw_Y_8_U/flower-minisblack-08.tif pass
Formats/TIFF/Flavors/Raw_Y_8_U/Raw_Y_8_U_LE.tif pass
Formats/TIFF/Flavors/Raw_Y_10_U/flower-minisblack-10.tif fail
Formats/TIFF/Flavors/Raw_Y_12_U/flower-minisblack-12.tif fail
Formats/TIFF/Flavors/Raw_Y_14_U/flower-minisblack-14.tif fail
Expand Down
24 changes: 23 additions & 1 deletion Source/Lib/Uncompressed/TIFF/TIFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ struct tiff_tested
;
}
};
struct dpx_also
{
tiff_tested Test;
tiff::flavor Flavor;
};


struct tiff_tested TIFF_Tested[] =
{
Expand All @@ -155,12 +161,17 @@ struct tiff_tested TIFF_Tested[] =
{ colorspace::RGB , 16, endianness::BE, 6 }, // 1x3x16-bit in 3x16-bit
{ colorspace::RGBA , 8, endianness::LE, 4 }, // 1x4x 8-bit in 4x 8-bit
{ colorspace::RGBA , 16, endianness::LE, 8 }, // 1x4x16-bit in 4x16-bit
{ colorspace::Y , 8, endianness::BE, 1 }, // 1x4x 8-bit in 1x 8-bit
{ colorspace::Y , 8, endianness::LE, 1 }, // 1x4x 8-bit in 1x 8-bit
{ colorspace::Y , 16, endianness::LE, 2 }, // 1x1x16-bit in 1x16-bit
{ colorspace::Y , 16, endianness::BE, 2 }, // 1x1x16-bit in 1x16-bit
};
static_assert(tiff::flavor_Max == sizeof(TIFF_Tested) / sizeof(tiff_tested), IncoherencyMessage);

struct dpx_also TIFF_Also[] =
{
{ { colorspace::Y , 8, endianness::BE }, tiff::flavor::Raw_Y_8_U },
};

//***************************************************************************
// TIFF
//***************************************************************************
Expand Down Expand Up @@ -607,6 +618,17 @@ void tiff::ParseBuffer()
break;
}
}
if (Flavor == (decltype(Flavor))-1)
{
for (const auto& TIFF_Also_Item : TIFF_Also)
{
if (TIFF_Also_Item.Test == Info)
{
Flavor = (decltype(Flavor))TIFF_Also_Item.Flavor;
break;
}
}
}
if (Flavor == (decltype(Flavor))-1)
Unsupported(unsupported::Flavor);
if (HasErrors())
Expand Down

0 comments on commit 50ab86c

Please sign in to comment.