mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 20:14:31 +01:00
craft-image-codecs reads and writes JPEG-LS since #1576, but the format registry had no entry for it. A `.jls` name resolved to no format, and a JPEG-LS file was reported as JPEG because both start with `FF D8 FF`. `Format::JpegLs` now has the `jls` extension, the `image/jls` media type and the codec mapping, so its capabilities come from the codec. A file that starts with `FF D8 FF` is JPEG-LS when its marker segments lead to an SOF55 frame header (`FF F7`). The walk follows `jpeg_frame_from` in craft-image-codecs, which a build without the `raster-codecs` feature does not link, and reads at most the first 1 MiB. When the bytes end before any frame header, a `.jls` name gives JPEG-LS and any other name gives JPEG. craft-file-import routes `JpegLs` to its raster reader and lists `jls` and `image/jls`, so a JPEG-LS file still imports as it did when it was detected as JPEG. Follows #1576.
26 lines
727 B
TOML
26 lines
727 B
TOML
[package]
|
|
name = "craft-file-import"
|
|
description = "Shared format registry and bounded neutral scene import dispatch"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[dependencies]
|
|
craft-file-formats = { workspace = true }
|
|
craft-raster-codecs = { workspace = true }
|
|
craft-svg = { workspace = true }
|
|
craft-dxf = { workspace = true }
|
|
craft-pdf = { workspace = true, features = ["paths", "write"] }
|
|
craft-eps = { workspace = true, features = ["paths"] }
|
|
kurbo = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
vectorcraft-geom = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
craft-image-codecs = { workspace = true }
|
|
|
|
[lints]
|
|
workspace = true
|