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

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mosra
Copy link
Owner

@mosra mosra commented Jun 3, 2022

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?

  • Don't detect KTX1 at all, like until now? Goes against what I wanted to fix in the first place, to have a reasonable error message when trying to open or save a *.ktx file.
  • Detect, but delegate them to a new Ktx1Importer / Ktx1ImageConverter, which won't have any matching plugin in the foreseeable future (and thus also being utterly confusing?)
  • Wait for integration of some plugin that knows KTX1 and then use Ktx1Importer / Ktx1ImageConverter for it? I don't know about any, and integrating Khronos' KTX Software (which depend on GLUT and whatnot) is one thing I definitely did not want and thus went with plugins implemented from scratch instead. OIIO is flexible but doesn't seem to support KTX and there doesn't seem to be any interest in adding that.
  • Support KTX1 in KtxImporter / KtxImageConverter? Ugh. Actually, integrating KTX Software seems a better idea than wasting time implementing KTX1 myself, but it would need to have some other added value than just being able to work with KTX1.

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
(I do that quite often). The concrete plugins are able to provide a much
better error message about version 1 not supported.
@mosra mosra added this to TODO in Asset management via automation Jun 3, 2022
@codecov
Copy link

codecov bot commented Jun 3, 2022

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%) ⬆️
...agnumPlugins/AnyImageImporter/AnyImageImporter.cpp 87.34% <100.00%> (+1.37%) ⬆️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant