Skip to content

Commit

Permalink
AnyImageConverter: recognize KTX2 files.
Browse files Browse the repository at this point in the history
Preparing for the soon-to-be-merged KTX files. Not hooking up 1D/3D and
the compressed APIs yet, doing that only when the plugins get merged so
I have a way to test.
  • Loading branch information
mosra committed Jul 31, 2021
1 parent 696e9fb commit b25ab9d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ bool AnyImageConverter::doConvertToFile(const ImageView2D& image, const Containe
normalized.hasSuffix(".jpeg"_s) ||
normalized.hasSuffix(".jpe"_s))
plugin = "JpegImageConverter"_s;
else if(normalized.hasSuffix(".ktx2"_s))
plugin = "KtxImageConverter"_s;
else if(normalized.hasSuffix(".png"_s))
plugin = "PngImageConverter"_s;
else if(normalized.hasSuffix(".tga"_s) ||
Expand Down
2 changes: 2 additions & 0 deletions src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ tries to convert the file with it. Supported formats for uncompressed data:
`HdrImageConverter`
- JPEG (`*.jpg`, `*.jpe`, `*.jpeg`), converted with @ref JpegImageConverter
or any other plugin that provides it
- KTX2 (`*.ktx2`), converted with any plugin that provides
`KtxImageConverter`
- Portable Network Graphics (`*.png`), converted with @ref PngImageConverter
or any other plugin that provides it
- Truevision TGA (`*.tga`, `*.vda`, `*.icb`, `*.vst`), converted with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ constexpr struct {
{"JPEG", "file.jpg", "JpegImageConverter"},
{"JPEG weird extension", "file.jpe", "JpegImageConverter"},
{"JPEG uppercase", "output.JPG", "JpegImageConverter"},
{"KTX2", "foo.ktx2", "KtxImageConverter"},
{"PNG", "file.png", "PngImageConverter"}
};

Expand Down

0 comments on commit b25ab9d

Please sign in to comment.