mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.75k stars 439 forks source link

AnyImage{Importer,Converter}: detect also KTX1 #567

Open mosra opened 2 years ago

mosra commented 2 years ago

Even though KtxImporter / KtxImageConverter doesn't support these (and probably never will), the rationale here is to provide a somewhat better message than "unable to detect file format" when trying to open a *.ktx file, or when trying to save to a *.ktx by accident, instead of *.ktx2 (which I do quite often). The concrete plugins are able to provide a much better error message about version 1 not supported.

However, this means that once some new plugin actually supports KTX1, KtxImporter will still get picked over it, since it always has a precedence over any alias. So this might actually be counterproductive, ending up in the same endless pain as is with the still pretty much uselessly barebone ObjImporter being picked over AssimpImporter. Different ideas?

codecov[bot] commented 2 years ago

Codecov Report

Merging #567 (5a8d317) into master (a218ddf) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #567      +/-   ##
==========================================
+ Coverage   83.89%   83.90%   +0.01%     
==========================================
  Files         523      523              
  Lines       33999    34013      +14     
==========================================
+ Hits        28524    28540      +16     
+ Misses       5475     5473       -2     
Impacted Files Coverage Δ
...agnumPlugins/AnyImageConverter/AnyImageConverter.h 100.00% <ø> (ø)
.../MagnumPlugins/AnyImageImporter/AnyImageImporter.h 100.00% <ø> (ø)
...numPlugins/AnyImageConverter/AnyImageConverter.cpp 65.74% <100.00%> (+1.30%) :arrow_up:
...agnumPlugins/AnyImageImporter/AnyImageImporter.cpp 87.34% <100.00%> (+1.37%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a218ddf...5a8d317. Read the comment docs.