#745: import Targa (.tga) and Radiance HDR (.hdr) stills and sequences
Problem: the Media Browser lists .tga and .hdr files (and groups them into image sequences), but media::is_importable had neither extension and the still decoder never tried them, so importing them failed. Fix: enable the image crate's built-in tga and hdr decoders (no new dependency), add both to STILL_EXTENSIONS and the File > Import dialog, and pick a still's format by signature with an extension fallback, since Targa has no signature. Radiance HDR is linear float light and is sRGB-encoded like OpenEXR (super-white kept); Targa alpha goes through the existing unlabeled-alpha interpretation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9a7d3e7699
commit
1fdf817cc9
@@ -738,7 +738,11 @@ impl Inner {
|
||||
{
|
||||
return Err(MediaError::Decode(format!("{path}: {why}")));
|
||||
}
|
||||
let img = match image::load_from_memory(&bytes) {
|
||||
let loaded = match crate::still_format(path, &bytes) {
|
||||
Some(fmt) => image::load_from_memory_with_format(&bytes, fmt),
|
||||
None => image::load_from_memory(&bytes),
|
||||
};
|
||||
let img = match loaded {
|
||||
Ok(img) => img,
|
||||
// A multi-layer OpenEXR file without an unnamed RGB layer: its colour layer.
|
||||
Err(e) => crate::exr_channels::cached_layered_image(path, bytes).ok_or_else(|| MediaError::Decode(format!("{path}: {e}")))?,
|
||||
|
||||
Reference in New Issue
Block a user