Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TIFF 8-bit LE #437

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Project/GNU/CLI/test/test1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,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
Loading