Repository navigation
feat: audio and the Form family's file types, with location-safe exports and full licence notices - #19
Merged
Conversation
Classify and import mp3, m4a, aac, wav, aiff, flac, ogg, opus, caf and wma (and sound-only mp4/mov) as kind audio with the same hashing and duplicate checks. Read codec, sample rate, channels, bit depth, bitrate, tags, cover art and location through ffprobe, with a WAV fallback. Draw waveform or cover-art thumbs, serve peaks and a FLAC listen copy, list, count, filter, search and sort audio by duration, keep audio out of face, CLIP, OCR, visual duplicate and memory jobs, and purge plain audio caches when an item becomes protected.
Trim and trim export accept audio, with optional loudness normalising that falls back to FLAC when the encoder is missing. Export, share packages and web galleries strip audio metadata whenever location or metadata is left out, keeping cover art.
Adds the Audio section, counts, filters and duration sorts, tile badges with duration, an info panel audio block, a waveform player with scrub, play, loop, volume and keys, and audio trimming with loudness normalising. The trim screen moves out of editor.ts into trim.ts.
… are dropped Stripping location with a stream copy kept the embedded cover and its EXIF. The cover is now re-encoded to PNG, or left out when the container cannot hold it. Listen copies, waveforms and audio thumbs written while an item became protected are deleted right after they land.
Recognises each family app's project files from a registry copy that FormPortal's catalogue extends, reads the proposed preview and manifest convention from zip and JSON projects, falls back to a drawn app icon, and opens a project in its app through FormPortal or the app's own handler. File kinds get ratings, labels, keywords, albums, sidecars, trash, the vault and its cache purge, export, share, filters, counts and smart-album rules; a worker thread makes previews after import.
PSD, TGA, ICO and JPEG 2000 through Pillow; EXR and HDR tone mapped from ffmpeg floats; DPX, PSB and JPEG XL through ffmpeg; sanitised SVG through resvg. MXF, MPEG, WMV, FLV and OGV are videos with a playable WebM copy on demand; R3D and BRAW are catalogued without probing. A folder of numbered EXR, DPX, PNG or TIFF frames imports as one sequence with its frame range, rate and size. Non-media originals are served sandboxed.
…led out Bound the EXR header reader and read every part of a multipart file. Archives are rebuilt from an allowlist of member types, each verified: EXR and DPX location data is wiped, rasters and text are scrubbed and checked for GPS values in any XMP form, nested archives are walked, and anything that cannot be checked is refused.
Archive members are read in chunks against per-member and running caps across nesting, with member and depth limits. Single files go through the same verifiers as members, PDFs with their streams inflated, fonts after unpacking; anything unverifiable is refused, and a refused share is remembered.
…be checked A top-level file whose row holds a location leaves only as a raster that reads back clean. Encrypted PDFs, streams with filters other than Flate or a lone DCT, and Flate streams that do not inflate completely are refused.
…ources Fonts get a specimen and their name-table facts, LUTs a before and after on a drawn test image, captions a cue list and full-text search, ASE palettes named swatches, and Lottie files their canvas, rate and frames with playback in the viewer from sanitised data. All are one resource kind with a filter, count and smart-album flags per subkind.
Scanning PDF bytes for location missed escaped filter names, indirect filters and other encryption forms. Without a PDF writer to make a clean copy, a PDF leaves only with its location kept.
PDF through pypdfium2 with page images in the viewer; DOCX, PPTX, XLSX, CSV, Markdown, TXT, RTF and IDML read for their text, counts and saved thumbnails or a drawn page. Text goes into the searched text column, and lists carry only its first 2000 characters. Plain text is now a document kind, so the upload test skips an unknown extension instead.
…search Sheet and shared-string parts are read up to 2 MiB with the stdlib pull parser, refusing documents with a DTD, and stop after the shown rows and the strings they need. Cell text is cut to 200 characters and fitted to its column by binary search.
GLB and glTF, OBJ, STL, PLY and text USD or USDZ are read with numpy for triangles, vertices, bounding size and materials, drawn as a shaded still and turned in a canvas viewer; STEP and IGES show as point clouds with their counts and units; FBX, binary USD and Alembic are catalogued by format.
Accessor counts and strides are validated and strided data is read in one pass. OBJ, USD, STEP and IGES stop and refuse past their vertex, face or point caps, and request-time meshes read at most 64 MiB.
A UTF-16 part slipped past the byte check for a DOCTYPE. Workbook parts and SVG now go through expat with every doctype and entity handler raising, and parts declaring or carrying another encoding are refused.
glTF checks running vertex and index totals and limits meshes and primitives; OBJ and USD check each polygon against the face cap and a per-face corner limit before extending.
Expat buffers character data, each element joins its parts once at its end tag, and text past 8192 characters per element is dropped.
Only file kinds wait for the background worker, so the has_preview smart-album flag matches media items again.
pypdf (BSD-3-Clause) rewrites the PDF with its document information, XMP metadata and embedded JPEG metadata removed, then reads the copy back and checks every object. Encrypted PDFs and anything that cannot be verified are still refused.
Attachments go through the name tree, /EF, /AF and FileAttachment annotations, so all are removed and any embedded container left is refused. JPEG markers are walked past the first scan, JPEG 2000 passes only with plain boxes, and a PDF with a stored location leaves without it only when every stream was understood.
The clean copy is a new document holding only each page's content and the resources it uses; images are re-encoded from their pixels and ICC profiles replaced by device spaces. Everything else is left out, and every object in the written copy is searched for location and photo metadata before it is used.
Dictionaries pass through per-type key allowlists, raw image samples are size-checked and rewritten through Pillow, inline images and unknown streams refuse the PDF, and every copied byte string is searched for embedded file signatures anywhere in it.
setup/notices.py writes THIRD-PARTY-NOTICES.txt from the installed Python packages, the production npm packages, the Rust crates in Cargo.lock and the downloaded ffmpeg build, and its check mode runs in CI. The file ships in every installer and the engine, and Settings shows it under Licences and notices.
CharProcs entries must be content streams, an indexed colour space needs an integer size from 0 to 255 and a table that fits it, and every value copied from the source is rebuilt rather than reused.
Hiding, deleting or making private an item added in place now seals the file itself, checks the sealed copy against it and only then removes the plain file from its folder. Restoring puts it back at its path or beside it under a new name, and delete forever gives it back. The Disk browser and its thumbnail cache leave protected items out, and the window asks before moving an outside original into the vault.
Sidecars formDAM wrote are sealed with their originals, the vault folder is fsynced before an original is removed, failed seals back off and still scrub caches, interrupted seals are finished, restores claim their name exclusively and a failed give-back keeps the item in Recently Deleted. The Disk browser checks protected rows once per listing, and waveform decodes have a watchdog and a bounded buffer.
Preview storage tolerates unbindable values, PLY and STL readers are capped, SVGZ inflation and ffmpeg stills are bounded, PNG and TIFF frames group only when they look rendered, and location stripping refuses instead of failing on unexpected archives and text.
Late content no longer moves the asset panel, mesh colours come from the tokens, fetches and drags are released with their views, audio keys and paste-edits stay off under dialogs and Trim, and the notices script evaluates markers for every shipped platform.
Moves the check for edit files another item still uses into extedit so vaultcrypt.py stays under the file size limit after the merge.
A protected item's waveform comes from its sealed bytes, and without ffmpeg those were never given to the WAV reader, so the route answered 409. This is what failed PR #19's Linux engine tests.
When the rebuild refuses a PDF, exports, packages and web galleries name it and the window asks whether to render every page to an image in a new PDF with no metadata. Nothing is flattened without the flatten_pdfs flag.
A one-time scan after the upgrade, and Scan Again in Settings > Vault, look in folders formDAM has imported from or browsed for files matching protected items by SHA-256. Each one moves into the vault after the same check, or is ignored, only when the person chooses. The README now describes the vault, delete forever of files added in place and flattening.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audio becomes a third media kind, and FormDAM learns the Form family's other file types. Closes #17.
Audio
Form family file types
Location, vault and licences
Exports that leave out location are checked and fail closed for every kind. A PDF leaves as a clean copy rebuilt with pypdf (BSD-3-Clause) from only what its pages use, with images re-encoded and attachments, metadata and unknown streams dropped. Anything that cannot be rebuilt safely is refused with a plain message.
A referenced original (catalogued in place) moves into the vault when its item is protected. It is encrypted, checked and only then removed from its folder; restore puts it back. The Disk browser and its thumbnails leave protected items out.
A generated THIRD-PARTY-NOTICES.txt carries the full licence text of every bundled Python package, npm package and Rust crate, plus the FFmpeg reference. It ships with the app and engine and is shown in Settings > App > Licences and notices. CI checks it stays current.
PDFs that cannot be rebuilt safely can be flattened to images on request: the person sees which PDFs, and that their text will no longer be selectable or searchable, and confirms. The API and agents flatten only with an explicit flatten_pdfs flag.
A one-time scan (and Scan Again in Settings > Vault & Keychain) finds plain copies that older vault seals left in known folders, matched by size and SHA-256, and moves each into the vault only after the person confirms.
Sealed WAV waveforms decode without ffmpeg.
Tests
For the owner
How to ship