From eb324133fb7195986cd99a721ff6312655216d31 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 12:24:49 -0500 Subject: [PATCH 01/35] feat: audio clips are a third media kind in the engine 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. --- backend/app/db.py | 11 +- backend/app/main.py | 4 +- backend/app/routers/audio.py | 123 +++++++++++++++ backend/app/routers/browse.py | 2 +- backend/app/routers/guard.py | 2 +- backend/app/routers/importer.py | 25 ++-- backend/app/routers/library.py | 4 +- backend/app/routers/mediaapi.py | 8 +- backend/app/routers/people.py | 2 +- backend/app/routers/system.py | 1 + backend/app/services/audiometa.py | 132 +++++++++++++++++ backend/app/services/classify.py | 19 +++ backend/app/services/clipsvc.py | 4 +- backend/app/services/curatesvc.py | 2 +- backend/app/services/dedupsvc.py | 2 + backend/app/services/facesvc.py | 2 +- backend/app/services/libraryfs.py | 6 + backend/app/services/mediainfo.py | 83 ++++++++--- backend/app/services/metasvc.py | 19 +++ backend/app/services/ocrsvc.py | 2 +- backend/app/services/query.py | 16 +- backend/app/services/thumbs.py | 56 ++++++- backend/app/services/waveform.py | 188 +++++++++++++++++++++++ backend/app/vaultcrypt.py | 30 ++-- backend/tests/test_audio_import.py | 231 +++++++++++++++++++++++++++++ 25 files changed, 910 insertions(+), 64 deletions(-) create mode 100644 backend/app/routers/audio.py create mode 100644 backend/app/services/audiometa.py create mode 100644 backend/app/services/waveform.py create mode 100644 backend/tests/test_audio_import.py diff --git a/backend/app/db.py b/backend/app/db.py index e0560b5..6b5e7d1 100644 --- a/backend/app/db.py +++ b/backend/app/db.py @@ -142,7 +142,7 @@ def connect() -> sqlite3.Connection: return conn -SCHEMA_VERSION = 11 +SCHEMA_VERSION = 12 MEDIA_V5_COLUMNS = ( "make TEXT", "model TEXT", "lens TEXT", "focal REAL", "focal35 REAL", "aperture REAL", "shutter REAL", @@ -163,7 +163,16 @@ def connect() -> sqlite3.Connection: SYNC_MEDIA_COLUMNS = ("favorite, rating, label, rejected, title, caption, alt_text, edit_json, hidden, trashed_ts, " "created_ts, lat, lon, location_hidden, shared_lib, private, trim_in, trim_out") +AUDIO_COLUMNS = ( + "audio_codec TEXT", "sample_rate INTEGER", "channels INTEGER", "bit_depth INTEGER", "bitrate INTEGER", + "artist TEXT", "album_title TEXT", "genre TEXT", "track TEXT", "release_year INTEGER", + "has_cover INTEGER NOT NULL DEFAULT 0", +) + MIGRATIONS = { + 12: [f"ALTER TABLE media ADD COLUMN {col}" for col in AUDIO_COLUMNS] + [ + "CREATE INDEX IF NOT EXISTS idx_media_kind ON media(kind)", + ], 11: [ "ALTER TABLE media ADD COLUMN origin_sha TEXT", "CREATE INDEX IF NOT EXISTS idx_media_origin ON media(origin_sha)", diff --git a/backend/app/main.py b/backend/app/main.py index be51563..546d3a9 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -10,7 +10,7 @@ from . import ffmpeg_fetch, mediacodecs, upgrade_thumbs, wiring from .db import init_db, q, ex, setting_get, setting_set from .services import classify -from .routers import albums, automation, browse, curate, dedup, discover, edit, files, geo, importer, library, mediaapi, organize, output, packages, people, render, syncapi, system, trash +from .routers import albums, audio, automation, browse, curate, dedup, discover, edit, files, geo, importer, library, mediaapi, organize, output, packages, people, render, syncapi, system, trash from .security import local_only_guard mimetypes.add_type("text/javascript", ".js") @@ -79,7 +79,7 @@ def _reclassify_screenshots() -> None: app = FastAPI(title="formDAM", version=VERSION, lifespan=lifespan) app.middleware("http")(local_only_guard) -for module in (automation, system, importer, browse, render, edit, organize, files, geo, discover, output, curate, library, packages, syncapi, mediaapi, albums, people, trash, dedup): +for module in (automation, system, importer, browse, render, edit, organize, files, geo, discover, output, curate, library, packages, syncapi, mediaapi, audio, albums, people, trash, dedup): app.include_router(module.router, prefix="/api") _dist = env("DIST", os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "frontend", "dist")) diff --git a/backend/app/routers/audio.py b/backend/app/routers/audio.py new file mode 100644 index 0000000..1da18f6 --- /dev/null +++ b/backend/app/routers/audio.py @@ -0,0 +1,123 @@ +import os +import secrets +import subprocess +import threading +from typing import Iterator, List + +from fastapi import APIRouter, HTTPException, Query, Request +from fastapi.responses import JSONResponse, StreamingResponse + +from ..config import cache_dir +from ..db import q1 +from ..dedup.visual import ffmpeg_path +from ..services import libraryfs, waveform +from .guard import ensure_visible +from .revalidate import NO_STORE, REVALIDATE, must_not_store, revalidated_file + +router = APIRouter() +LISTEN_VER = 1 +LISTEN_TIMEOUT = 1800 +STREAM_CHUNK = 256 * 1024 + + +def _audio_row(media_id: int, request: Request): + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + ensure_visible(row, request) + if row["kind"] != "audio": + raise HTTPException(415, detail="Only audio items have a waveform") + return row + + +def _sealed_bytes(row) -> bytes: + from .. import vaultcrypt + + sealed = vaultcrypt.opener(row) + if sealed is None: + raise HTTPException(404, detail="Original file missing on disk") + return sealed.read_all() + + +@router.get("/media/{media_id}/waveform") +def media_waveform(media_id: int, request: Request, n: int = Query(waveform.PEAKS, ge=50, le=4000)): + row = _audio_row(media_id, request) + guarded = must_not_store(row) + if guarded: + peaks = waveform.decode(data=_sealed_bytes(row), duration=row["duration"]) + else: + src = libraryfs.abs_path(row["rel_path"]) + if not os.path.isfile(src): + raise HTTPException(404, detail="Original file missing on disk") + peaks = waveform.cached(media_id, src, row["duration"]) + if not peaks: + raise HTTPException(409, detail="This audio could not be decoded (ffmpeg is needed for this format)") + body = {"id": media_id, "duration": row["duration"], "peaks": waveform.pool(peaks, n)} + return JSONResponse(body, headers={"Cache-Control": NO_STORE if guarded else REVALIDATE}) + + +def listen_path(media_id: int) -> str: + folder = os.path.join(cache_dir(), "listen") + os.makedirs(folder, exist_ok=True) + return os.path.join(folder, f"{media_id}_v{LISTEN_VER}.flac") + + +def _transcode_cmd(binary: str, src: str, out: str) -> List[str]: + return [binary, "-hide_banner", "-loglevel", "error", "-y", "-i", src, "-vn", "-map", "0:a:0", + "-c:a", "flac", "-f", "flac", out] + + +def _stream_sealed(binary: str, data: bytes) -> Iterator[bytes]: + proc = subprocess.Popen(_transcode_cmd(binary, "pipe:0", "pipe:1"), stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + + def feed() -> None: + try: + proc.stdin.write(data) + except (BrokenPipeError, OSError): + pass + finally: + try: + proc.stdin.close() + except OSError: + pass + + writer = threading.Thread(target=feed, daemon=True) + writer.start() + try: + while True: + block = proc.stdout.read(STREAM_CHUNK) + if not block: + break + yield block + finally: + if proc.poll() is None: + proc.kill() + proc.wait() + writer.join(timeout=5) + + +@router.get("/media/{media_id}/listen") +def media_listen(media_id: int, request: Request): + row = _audio_row(media_id, request) + binary = ffmpeg_path() + if not binary: + raise HTTPException(409, detail="ffmpeg is needed to play this format") + if must_not_store(row): + return StreamingResponse(_stream_sealed(binary, _sealed_bytes(row)), media_type="audio/flac", + headers={"Cache-Control": NO_STORE}) + src = libraryfs.abs_path(row["rel_path"]) + if not os.path.isfile(src): + raise HTTPException(404, detail="Original file missing on disk") + out = listen_path(media_id) + if not os.path.isfile(out): + tmp = f"{out}.{secrets.token_hex(4)}.part" + try: + done = subprocess.run(_transcode_cmd(binary, src, tmp), capture_output=True, timeout=LISTEN_TIMEOUT) + if done.returncode != 0 or not os.path.isfile(tmp) or os.path.getsize(tmp) == 0: + raise HTTPException(500, detail="ffmpeg could not decode this audio") + os.replace(tmp, out) + except subprocess.TimeoutExpired as exc: + raise HTTPException(504, detail="Decoding this audio took too long") from exc + finally: + if os.path.isfile(tmp): + os.unlink(tmp) + return revalidated_file(request, out, "audio/flac") diff --git a/backend/app/routers/browse.py b/backend/app/routers/browse.py index fd4770c..c0d1d31 100644 --- a/backend/app/routers/browse.py +++ b/backend/app/routers/browse.py @@ -11,7 +11,7 @@ router = APIRouter() MEDIA_TYPES = [ - ("video", "Videos"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), + ("video", "Videos"), ("audio", "Audio"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), ("panorama", "Panoramas"), ("timelapse", "Time-lapse"), ("slomo", "Slo-mo"), ("cinematic", "Cinematic"), ("burst", "Bursts"), ("spatial", "Spatial"), ("long_exposure", "Long Exposure"), ("animated", "Animated"), ("raw", "RAW"), ("screenshot", "Screenshots"), ("screen_recording", "Screen Recordings"), diff --git a/backend/app/routers/guard.py b/backend/app/routers/guard.py index 009c8ee..d531aa5 100644 --- a/backend/app/routers/guard.py +++ b/backend/app/routers/guard.py @@ -11,7 +11,7 @@ def token_of(request: Request) -> str: def _any_token(request: Request, scope: str) -> bool: tokens = [token_of(request)] - if request.url.path.endswith(("/thumb", "/file", "/render")): + if request.url.path.endswith(("/thumb", "/file", "/render", "/listen")): tokens += [value for name, value in request.cookies.items() if name == "dam_vt" or name.startswith("dam_at_")] return any(check_token(token, scope) for token in tokens if token) diff --git a/backend/app/routers/importer.py b/backend/app/routers/importer.py index fd50b4b..7788c3d 100644 --- a/backend/app/routers/importer.py +++ b/backend/app/routers/importer.py @@ -10,7 +10,7 @@ from .. import jobs from ..db import setting_get, setting_set from ..security import shell_allowed -from ..services import followon, idevicesvc, libraryfs, thumbs +from ..services import classify, followon, idevicesvc, libraryfs, thumbs router = APIRouter() @@ -48,11 +48,7 @@ def run(state: Dict[str, Any]) -> None: status = result["status"] if status == "imported": counts["imported"] += 1 - if result.get("kind") == "video" and result.get("id"): - try: - thumbs.ensure_thumb(result["id"], result["rel_path"], "video", 384) - except Exception: - pass + _poster(result) elif status == "duplicate": counts["duplicates"] += 1 else: @@ -68,7 +64,16 @@ def run(state: Dict[str, Any]) -> None: ".dng", ".mov", ".mp4", ".m4v", ".webm", ".mkv", ".3gp", ".avi", ".avif", ".mts", ".cr2", ".cr3", ".crw", ".nef", ".nrw", ".arw", ".srf", ".sr2", ".raf", ".orf", ".rw2", ".rwl", ".pef", ".srw", ".x3f", ".3fr", ".iiq", ".erf", ".kdc", ".dcr", ".mos", ".mrw", -} +} | {f".{ext}" for ext in classify.AUDIO_EXTS} + + +def _poster(result: Dict[str, Any]) -> None: + if not classify.is_timed(result.get("kind")) or not result.get("id"): + return + try: + thumbs.ensure_thumb(result["id"], result["rel_path"], result["kind"], 384) + except Exception: + pass @router.post("/import/upload") @@ -94,11 +99,7 @@ def import_upload(files: List[UploadFile] = File(...)): if status == "imported": counts["imported"] += 1 imported.append(result) - if result.get("kind") == "video" and result.get("id"): - try: - thumbs.ensure_thumb(result["id"], result["rel_path"], "video", 384) - except Exception: - pass + _poster(result) elif status == "duplicate": counts["duplicates"] += 1 imported.append({"id": result.get("media_id")}) diff --git a/backend/app/routers/library.py b/backend/app/routers/library.py index 0205216..67f4052 100644 --- a/backend/app/routers/library.py +++ b/backend/app/routers/library.py @@ -330,6 +330,8 @@ def disk_thumb(path: str = Query(..., max_length=4000), s: int = Query(384, ge=6 img = None if kind == "image": img = decode.open_image(full, os.path.basename(full), max_long=s) + elif kind == "audio": + img = thumbs.audio_still(full, s) else: from ..dedup.visual import ffmpeg_path import subprocess @@ -356,7 +358,7 @@ def disk_file(path: str = Query(..., max_length=4000)): full = _media_file(path) ext = os.path.splitext(full)[1].lower() kind, mime = classify.media_kind(os.path.basename(full)) - if kind == "video" or ext in WEB_NATIVE: + if classify.is_timed(kind) or ext in WEB_NATIVE: return FileResponse(full, media_type=mime or "application/octet-stream", headers={"Cache-Control": "no-store"}) img = decode.open_image(full, os.path.basename(full), max_long=3072, develop=True) if img is None: diff --git a/backend/app/routers/mediaapi.py b/backend/app/routers/mediaapi.py index 06e4666..94992bc 100644 --- a/backend/app/routers/mediaapi.py +++ b/backend/app/routers/mediaapi.py @@ -20,6 +20,7 @@ "favorites": ("AND favorite=1", "created_ts DESC, id DESC"), "photos": ("AND kind='image'", "created_ts DESC, id DESC"), "videos": ("AND kind='video'", "created_ts DESC, id DESC"), + "audio": ("AND kind='audio'", "created_ts DESC, id DESC"), "screenshots": ("AND is_screenshot=1", "created_ts DESC, id DESC"), "screenrecs": ("AND is_screen_rec=1", "created_ts DESC, id DESC"), "not_in_album": ("AND id NOT IN (SELECT media_id FROM album_items)", "created_ts DESC, id DESC"), @@ -61,13 +62,13 @@ def list_media( return {"items": items, "next": next_cursor} -SEARCH_FIELDS = {"name", "ocr", "people", "albums"} +SEARCH_FIELDS = {"name", "ocr", "people", "albums", "tags"} @router.get("/media/search") def search_media( q_text: str = Query(alias="q", min_length=1, max_length=200), - fields: str = Query("name,ocr,people,albums"), + fields: str = Query("name,ocr,people,albums,tags"), limit: int = Query(400, ge=1, le=1000), ): wanted = {f.strip() for f in fields.split(",") if f.strip()} & SEARCH_FIELDS @@ -81,6 +82,9 @@ def search_media( if "ocr" in wanted: clauses.append("m.ocr_text LIKE ?") params.append(like) + if "tags" in wanted: + clauses.append("(m.title LIKE ? OR m.artist LIKE ? OR m.album_title LIKE ? OR m.genre LIKE ?)") + params.extend([like] * 4) if "people" in wanted: clauses.append("p.name LIKE ?") params.append(like) diff --git a/backend/app/routers/people.py b/backend/app/routers/people.py index e8c8492..ea73b4b 100644 --- a/backend/app/routers/people.py +++ b/backend/app/routers/people.py @@ -21,7 +21,7 @@ class RenameIn(BaseModel): @router.get("/people/status") def people_status(): info = facesvc.status() - pending = q1("SELECT COUNT(*) AS n FROM media WHERE face_state=0 AND trashed_ts IS NULL")["n"] + pending = q1("SELECT COUNT(*) AS n FROM media WHERE face_state=0 AND trashed_ts IS NULL AND kind<>'audio'")["n"] info["pending_media"] = pending active = jobs.running("faces") info["job"] = active diff --git a/backend/app/routers/system.py b/backend/app/routers/system.py index 5736816..c24e430 100644 --- a/backend/app/routers/system.py +++ b/backend/app/routers/system.py @@ -104,6 +104,7 @@ def count(sql: str) -> int: "total": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible}"), "photos": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='image'"), "videos": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='video'"), + "audio": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='audio'"), "screenshots": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screenshot=1"), "screenrecs": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screen_rec=1"), "favorites": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND favorite=1"), diff --git a/backend/app/services/audiometa.py b/backend/app/services/audiometa.py new file mode 100644 index 0000000..e357fa9 --- /dev/null +++ b/backend/app/services/audiometa.py @@ -0,0 +1,132 @@ +import re +import wave +from typing import Any, Dict, Optional + +from . import mediainfo + +TAG_KEYS = { + "title": ("title",), + "artist": ("artist", "album_artist", "albumartist", "performer", "composer"), + "album": ("album",), + "genre": ("genre",), + "track": ("track", "tracknumber", "trck"), + "date": ("date", "year", "tyer", "tdrc", "originaldate", "creation_time"), +} +LOCATION_KEYS = ("com.apple.quicktime.location.iso6709", "location", "location-eng", "\u00a9xyz", "xyz") +YEAR_RE = re.compile(r"(1[89]\d\d|2[01]\d\d)") +TEXT_LIMIT = 300 + + +def _int(value: Any) -> Optional[int]: + try: + number = int(float(value)) + except (TypeError, ValueError): + return None + return number if number > 0 else None + + +def _text(value: Any) -> str: + return str(value or "").strip()[:TEXT_LIMIT] + + +def _tags(data: Dict[str, Any], stream: Dict[str, Any]) -> Dict[str, str]: + merged: Dict[str, str] = {} + for source in ((data.get("format") or {}).get("tags") or {}, stream.get("tags") or {}): + for key, value in source.items(): + merged.setdefault(str(key).lower(), _text(value)) + return merged + + +def _pick(tags: Dict[str, str], field: str) -> str: + for key in TAG_KEYS[field]: + if tags.get(key): + return tags[key] + return "" + + +def location_of(tags: Dict[str, str]) -> Dict[str, float]: + from .exifmeta import ISO6709 + + for key in LOCATION_KEYS: + match = ISO6709.match((tags.get(key) or "").strip()) + if not match: + continue + lat, lon = float(match.group(1)), float(match.group(2)) + if -90 <= lat <= 90 and -180 <= lon <= 180: + found = {"lat": lat, "lon": lon} + if match.group(3): + found["alt"] = float(match.group(3)) + return found + return {} + + +def year_of(text: str) -> Optional[int]: + match = YEAR_RE.search(text or "") + return int(match.group(1)) if match else None + + +def _bit_depth(stream: Dict[str, Any]) -> Optional[int]: + depth = _int(stream.get("bits_per_raw_sample")) or _int(stream.get("bits_per_sample")) + if depth: + return depth + match = re.search(r"(\d+)", str(stream.get("sample_fmt") or "")) + codec = str(stream.get("codec_name") or "") + return int(match.group(1)) if match and codec.startswith("pcm_") else None + + +def from_probe(data: Dict[str, Any]) -> Dict[str, Any]: + stream = next((s for s in data.get("streams", []) if s.get("codec_type") == "audio"), {}) + tags = _tags(data, stream) + fmt = data.get("format") or {} + covers = [s for s in data.get("streams", []) if s.get("codec_type") == "video"] + out: Dict[str, Any] = { + "duration": _float(fmt.get("duration")) or _float(stream.get("duration")), + "codec": _text(stream.get("codec_name")).lower(), + "sample_rate": _int(stream.get("sample_rate")), + "channels": _int(stream.get("channels")), + "bit_depth": _bit_depth(stream), + "bitrate": _int(stream.get("bit_rate")) or _int(fmt.get("bit_rate")), + "title": _pick(tags, "title"), + "artist": _pick(tags, "artist"), + "album": _pick(tags, "album"), + "genre": _pick(tags, "genre"), + "track": _pick(tags, "track"), + "year": year_of(_pick(tags, "date")), + "has_cover": bool(covers), + } + out.update(location_of(tags)) + every = {f"Tag {key}": value for key, value in sorted(tags.items()) if value and len(key) < 64} + every.update({k: v for k, v in (("Codec", out["codec"]), ("Sample rate", out["sample_rate"]), + ("Channels", out["channels"]), ("Bit depth", out["bit_depth"]), + ("Bitrate", out["bitrate"])) if v}) + out["all"] = every + return out + + +def _float(value: Any) -> Optional[float]: + try: + number = float(value) + except (TypeError, ValueError): + return None + return number if number > 0 else None + + +def wave_fields(path: str) -> Dict[str, Any]: + try: + with wave.open(path, "rb") as handle: + rate, frames = handle.getframerate(), handle.getnframes() + channels, width = handle.getnchannels(), handle.getsampwidth() + except (wave.Error, EOFError, OSError): + return {} + if not rate: + return {} + bits = width * 8 + return {"duration": frames / rate, "codec": f"pcm_s{bits}le" if bits > 8 else "pcm_u8", "sample_rate": rate, + "channels": channels, "bit_depth": bits, "bitrate": rate * channels * bits, "has_cover": False, + "all": {"Sample rate": rate, "Channels": channels, "Bit depth": bits}} + + +def read_audio(path: str) -> Dict[str, Any]: + data = mediainfo.probe(path) + found = from_probe(data) if data is not None else wave_fields(path) + return {k: v for k, v in found.items() if v not in (None, "")} diff --git a/backend/app/services/classify.py b/backend/app/services/classify.py index 759a253..adf6dea 100644 --- a/backend/app/services/classify.py +++ b/backend/app/services/classify.py @@ -16,6 +16,14 @@ "mp4": "video/mp4", "mov": "video/quicktime", "m4v": "video/x-m4v", "webm": "video/webm", "mkv": "video/x-matroska", "avi": "video/x-msvideo", "mts": "video/mp2t", "3gp": "video/3gpp", } +AUDIO_EXTS = { + "mp3": "audio/mpeg", "m4a": "audio/mp4", "aac": "audio/aac", "wav": "audio/wav", "aiff": "audio/aiff", + "aif": "audio/aiff", "flac": "audio/flac", "ogg": "audio/ogg", "oga": "audio/ogg", "opus": "audio/ogg", + "caf": "audio/x-caf", "wma": "audio/x-ms-wma", +} +AUDIO_ONLY_MIMES = {"mp4": "audio/mp4", "m4v": "audio/mp4", "mov": "audio/mp4", "3gp": "audio/3gpp", "webm": "audio/webm", + "mkv": "audio/x-matroska"} +TIMED_KINDS = ("video", "audio") SCREENSHOT_NAME = re.compile(r"screen[\s_-]?shot|screenshot", re.IGNORECASE) SCREENREC_NAME = re.compile(r"screen[\s_-]?record|screenrecording|rpreplay", re.IGNORECASE) @@ -31,9 +39,20 @@ def media_kind(name: str): return "image", IMAGE_EXTS[ext] if ext in VIDEO_EXTS: return "video", VIDEO_EXTS[ext] + if ext in AUDIO_EXTS: + return "audio", AUDIO_EXTS[ext] return None, None +def is_timed(kind) -> bool: + return kind in TIMED_KINDS + + +def audio_only_mime(name: str) -> str: + ext = ext_of(name) + return AUDIO_EXTS.get(ext) or AUDIO_ONLY_MIMES.get(ext) or "audio/mp4" + + SCREEN_DIMS = { (2560, 1600), (2880, 1800), (3024, 1964), (3456, 2234), (3072, 1920), (3840, 2160), (2560, 1440), (1920, 1080), (1470, 956), (1512, 982), (1728, 1117), (1800, 1169), diff --git a/backend/app/services/clipsvc.py b/backend/app/services/clipsvc.py index 4d6e776..9599e75 100644 --- a/backend/app/services/clipsvc.py +++ b/backend/app/services/clipsvc.py @@ -67,7 +67,7 @@ def status() -> Dict[str, Any]: runtime = True except Exception: runtime = False - pending = q1("SELECT COUNT(*) AS n FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL")["n"] + pending = q1("SELECT COUNT(*) AS n FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio'")["n"] done = q1("SELECT COUNT(*) AS n FROM clip_vectors")["n"] return {"ready": runtime and not missing, "runtime": runtime, "missing": missing, "pending": pending, "indexed": done} @@ -215,7 +215,7 @@ def index_job(state: Dict[str, Any]) -> None: counts = {"indexed": 0, "failed": 0, "total": info["pending"]} state["counts"] = counts - rows = q("SELECT id, rel_path, kind FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL ORDER BY created_ts DESC") + rows = q("SELECT id, rel_path, kind FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio' ORDER BY created_ts DESC") for start in range(0, len(rows), BATCH): chunk, images, paths_ = [], [], [] for row in rows[start:start + BATCH]: diff --git a/backend/app/services/curatesvc.py b/backend/app/services/curatesvc.py index 59f29fd..9c5c40e 100644 --- a/backend/app/services/curatesvc.py +++ b/backend/app/services/curatesvc.py @@ -55,7 +55,7 @@ def _pick(rows: List[Any], limit: int = MEMORY_MAX) -> List[int]: seen_stacks, chosen = set(), [] scored = [] for r in rows: - if r["is_screenshot"] or r["rejected"] or r["is_screen_rec"]: + if r["is_screenshot"] or r["rejected"] or r["is_screen_rec"] or r["kind"] == "audio": continue if r["stack_id"] and r["stack_id"] in seen_stacks: continue diff --git a/backend/app/services/dedupsvc.py b/backend/app/services/dedupsvc.py index 9453e65..23d3d3b 100644 --- a/backend/app/services/dedupsvc.py +++ b/backend/app/services/dedupsvc.py @@ -125,6 +125,8 @@ def scan_job(state: Dict[str, Any], threshold: int, include_videos: bool = True, ) entries: List[Dict[str, Any]] = [] for row in rows: + if row["kind"] == "audio": + continue if row["kind"] == "video" and (not has_ffmpeg or not include_videos): counts["videos_skipped"] += 1 continue diff --git a/backend/app/services/facesvc.py b/backend/app/services/facesvc.py index 9485a47..28fcb79 100644 --- a/backend/app/services/facesvc.py +++ b/backend/app/services/facesvc.py @@ -196,7 +196,7 @@ def scan_job(state: Dict[str, Any]) -> None: clusterer = _Clusterer() counts = {"scanned": 0, "faces": 0, "people_new": 0, "videos": 0, "failed": 0} state["counts"] = counts - rows = q("SELECT id, rel_path, kind FROM media WHERE face_state=0 AND trashed_ts IS NULL AND live_of IS NULL ORDER BY id") + rows = q("SELECT id, rel_path, kind FROM media WHERE face_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio' ORDER BY id") for row in rows: path = libraryfs.abs_path(row["rel_path"]) frames: List[Tuple[float, Any]] = [] diff --git a/backend/app/services/libraryfs.py b/backend/app/services/libraryfs.py index a50fe67..16558be 100644 --- a/backend/app/services/libraryfs.py +++ b/backend/app/services/libraryfs.py @@ -68,8 +68,12 @@ def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[s exif_ts = None if kind == "image": width, height, exif_ts = mediainfo.image_meta(path) + elif kind == "audio": + duration, exif_ts = mediainfo.audio_meta(path) else: width, height, duration, exif_ts = mediainfo.video_meta(path) + if width is None and mediainfo.sound_only(path): + kind, mime = "audio", classify.audio_only_mime(name) if exif_ts: created_ts, created_src = exif_ts, "exif" else: @@ -95,6 +99,8 @@ def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[s ) if reference: ex("UPDATE media SET referenced=1 WHERE id=?", (media_id,)) + if kind == "audio": + ex("UPDATE media SET face_state=2, clip_state=2, ocr_text='' WHERE id=?", (media_id,)) batch_id = getattr(_batch, "id", None) if batch_id: ex("UPDATE media SET batch_id=? WHERE id=?", (batch_id, media_id)) diff --git a/backend/app/services/mediainfo.py b/backend/app/services/mediainfo.py index de9045c..0f1fb87 100644 --- a/backend/app/services/mediainfo.py +++ b/backend/app/services/mediainfo.py @@ -2,7 +2,7 @@ import os import subprocess from datetime import datetime, timezone -from typing import Optional, Tuple +from typing import Any, Dict, Optional, Tuple from PIL import ExifTags, Image, ImageOps @@ -30,38 +30,73 @@ def image_meta(path: str) -> Tuple[Optional[int], Optional[int], Optional[float] return None, None, None -def video_meta(path: str) -> Tuple[Optional[int], Optional[int], Optional[float], Optional[float]]: - probe = ffprobe_path() - if not probe: - return None, None, None, None +def probe(path: str) -> Optional[Dict[str, Any]]: + binary = ffprobe_path() + if not binary: + return None try: raw = subprocess.run( - [probe, "-v", "error", "-print_format", "json", "-show_format", "-show_streams", path], + [binary, "-v", "error", "-print_format", "json", "-show_format", "-show_streams", path], capture_output=True, timeout=20, check=True, ).stdout data = json.loads(raw or b"{}") except Exception: - return None, None, None, None - width = height = None + return None + return data if isinstance(data, dict) else None + + +def is_cover(stream: Dict[str, Any]) -> bool: + return bool((stream.get("disposition") or {}).get("attached_pic")) + + +def picture_stream(data: Dict[str, Any]) -> Optional[Dict[str, Any]]: for stream in data.get("streams", []): - if stream.get("codec_type") == "video": - width = stream.get("width") - height = stream.get("height") - break - fmt = data.get("format", {}) - duration = None + if stream.get("codec_type") == "video" and not is_cover(stream): + return stream + return None + + +def has_audio_stream(data: Dict[str, Any]) -> bool: + return any(stream.get("codec_type") == "audio" for stream in data.get("streams", [])) + + +def _duration(data: Dict[str, Any]) -> Optional[float]: try: - duration = float(fmt.get("duration")) + return float((data.get("format") or {}).get("duration")) except (TypeError, ValueError): - duration = None - created = None - tag = (fmt.get("tags") or {}).get("creation_time") - if tag: - try: - created = datetime.fromisoformat(str(tag).replace("Z", "+00:00")).astimezone(timezone.utc).timestamp() - except ValueError: - created = None - return width, height, duration, created + return None + + +def _created(data: Dict[str, Any]) -> Optional[float]: + tag = ((data.get("format") or {}).get("tags") or {}).get("creation_time") + if not tag: + return None + try: + return datetime.fromisoformat(str(tag).replace("Z", "+00:00")).astimezone(timezone.utc).timestamp() + except ValueError: + return None + + +def video_meta(path: str) -> Tuple[Optional[int], Optional[int], Optional[float], Optional[float]]: + data = probe(path) + if data is None: + return None, None, None, None + stream = picture_stream(data) or {} + return stream.get("width"), stream.get("height"), _duration(data), _created(data) + + +def sound_only(path: str) -> bool: + data = probe(path) + return data is not None and picture_stream(data) is None and has_audio_stream(data) + + +def audio_meta(path: str) -> Tuple[Optional[float], Optional[float]]: + data = probe(path) + if data is not None: + return _duration(data), _created(data) + from . import audiometa + + return audiometa.wave_fields(path).get("duration"), None def fs_created(path: str) -> Tuple[float, str]: diff --git a/backend/app/services/metasvc.py b/backend/app/services/metasvc.py index 09c2eb4..b1df84b 100644 --- a/backend/app/services/metasvc.py +++ b/backend/app/services/metasvc.py @@ -26,9 +26,26 @@ def _is_raw(name: str) -> bool: def read(path: str, kind: str) -> Dict[str, Any]: + if kind == "audio": + from . import audiometa + + return audiometa.read_audio(path) return exifmeta.read_image(path) if kind == "image" else exifmeta.read_video(path) +def _apply_audio(row, meta: Dict[str, Any]) -> None: + title = meta.get("title") if not row["meta_ver"] and not row["title"] else None + ex( + """UPDATE media SET audio_codec=?, sample_rate=?, channels=?, bit_depth=?, bitrate=?, artist=?, album_title=?, + genre=?, track=?, release_year=?, has_cover=?, duration=COALESCE(duration, ?), title=COALESCE(?, title) + WHERE id=?""", + (meta.get("codec") or None, meta.get("sample_rate"), meta.get("channels"), meta.get("bit_depth"), + meta.get("bitrate"), meta.get("artist") or None, meta.get("album") or None, meta.get("genre") or None, + meta.get("track") or None, meta.get("year"), 1 if meta.get("has_cover") else 0, meta.get("duration"), + title or None, row["id"]), + ) + + def _dims(path: str) -> Optional[tuple]: from . import decode @@ -82,6 +99,8 @@ def apply(media_id: int, meta: Optional[Dict[str, Any]] = None) -> Optional[Dict ex("UPDATE media SET is_animated=?, is_timelapse=?, is_cinematic=?, is_spatial=? WHERE id=?", (1 if meta.get("animated") else 0, 1 if meta.get("timelapse") else 0, 1 if meta.get("cinematic") else 0, 1 if meta.get("spatial") else 0, media_id)) + if row["kind"] == "audio": + _apply_audio(row, meta) if meta.get("content_id"): pair_live(media_id, meta["content_id"], row["kind"]) for hook in list(_after_apply): diff --git a/backend/app/services/ocrsvc.py b/backend/app/services/ocrsvc.py index 19e56a5..f9671fa 100644 --- a/backend/app/services/ocrsvc.py +++ b/backend/app/services/ocrsvc.py @@ -98,7 +98,7 @@ def scan_job(state: Dict[str, Any]) -> None: state["counts"] = counts import time as _time - rows = q("SELECT id, rel_path, kind FROM media WHERE ocr_text IS NULL AND trashed_ts IS NULL AND live_of IS NULL ORDER BY id") + rows = q("SELECT id, rel_path, kind FROM media WHERE ocr_text IS NULL AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio' ORDER BY id") try: for row in rows: text = "" diff --git a/backend/app/services/query.py b/backend/app/services/query.py index 551a892..8dbad5a 100644 --- a/backend/app/services/query.py +++ b/backend/app/services/query.py @@ -21,12 +21,16 @@ "rating": ("m.rating", "DESC"), "edited": ("COALESCE(m.edited_ts, 0)", "DESC"), "viewed": ("COALESCE(m.viewed_ts, 0)", "DESC"), + "duration": ("COALESCE(m.duration, 0)", "DESC"), + "duration_short": ("COALESCE(m.duration, 0)", "ASC"), } SORT_ALIAS = {"m.name COLLATE NOCASE": "name", "m.created_ts": "created_ts", "m.imported_ts": "imported_ts", - "m.size": "size", "m.rating": "rating", "COALESCE(m.edited_ts, 0)": "edited_ts", "COALESCE(m.viewed_ts, 0)": "viewed_ts"} + "m.size": "size", "m.rating": "rating", "COALESCE(m.edited_ts, 0)": "edited_ts", "COALESCE(m.viewed_ts, 0)": "viewed_ts", + "COALESCE(m.duration, 0)": "duration"} FLAGS = { - "favorite": "m.favorite=1", "photo": "m.kind='image'", "video": "m.kind='video'", + "favorite": "m.favorite=1", "photo": "m.kind='image'", "video": "m.kind='video'", "audio": "m.kind='audio'", + "cover_art": "m.has_cover=1", "lossless": "(m.audio_codec IN ('flac','alac','wavpack','ape','tta') OR m.audio_codec LIKE 'pcm%')", "screenshot": "m.is_screenshot=1", "screen_recording": "m.is_screen_rec=1", "raw": "m.is_raw=1", "live": "m.live_video_id IS NOT NULL", "panorama": "m.is_panorama=1", "selfie": "m.is_selfie=1", "portrait": "m.is_portrait=1", "slomo": "m.is_slomo=1", "burst": "m.burst_id IS NOT NULL", @@ -48,11 +52,14 @@ "filename": "m.name", "title": "m.title", "caption": "m.caption", "camera": "(COALESCE(m.make,'')||' '||COALESCE(m.model,''))", "lens": "m.lens", "place": "(COALESCE(m.place,'')||' '||COALESCE(m.admin,'')||' '||COALESCE(m.country,''))", "text": "m.ocr_text", "folder": "m.rel_path", "alt_text": "m.alt_text", + "artist": "m.artist", "album_title": "m.album_title", "genre": "m.genre", "codec": "m.audio_codec", } NUM_FIELDS = { "rating": "m.rating", "iso": "m.iso", "aperture": "m.aperture", "focal": "m.focal", "shutter": "m.shutter", "size": "m.size", "width": "m.width", "height": "m.height", "duration": "m.duration", "created": "m.created_ts", "imported": "m.imported_ts", + "sample_rate": "m.sample_rate", "channels": "m.channels", "bit_depth": "m.bit_depth", "bitrate": "m.bitrate", + "release_year": "m.release_year", } OPS = {"=": "=", "!=": "<>", ">=": ">=", "<=": "<=", ">": ">", "<": "<"} MONTHS = {m: i for i, m in enumerate(["january", "february", "march", "april", "may", "june", "july", "august", @@ -241,7 +248,7 @@ def where(spec: Dict[str, Any]) -> Tuple[str, List[Any]]: return " AND ".join(clauses), params -TEXT_SCOPES = ("name", "title", "caption", "keywords", "ocr", "people", "albums", "places", "camera", "subjects", "dates", "visual") +TEXT_SCOPES = ("name", "title", "caption", "keywords", "ocr", "people", "albums", "places", "camera", "subjects", "dates", "visual", "audio") def text_sql(text: str, fields: Optional[List[str]] = None) -> Tuple[str, List[Any]]: @@ -271,6 +278,9 @@ def text_sql(text: str, fields: Optional[List[str]] = None) -> Tuple[str, List[A if "camera" in wanted: alts.append("COALESCE(m.make,'')||' '||COALESCE(m.model,'')||' '||COALESCE(m.lens,'') LIKE ? ESCAPE '\\'") params.append(like) + if "audio" in wanted: + alts.append("COALESCE(m.artist,'')||' '||COALESCE(m.album_title,'')||' '||COALESCE(m.genre,'') LIKE ? ESCAPE '\\'") + params.append(like) if "places" in wanted: alts.append("COALESCE(m.place,'')||' '||COALESCE(m.admin,'')||' '||COALESCE(m.country,'') LIKE ? ESCAPE '\\'") params.append(like) diff --git a/backend/app/services/thumbs.py b/backend/app/services/thumbs.py index b45e5bc..d8faa8b 100644 --- a/backend/app/services/thumbs.py +++ b/backend/app/services/thumbs.py @@ -1,3 +1,4 @@ +import io import os import secrets import subprocess @@ -86,8 +87,12 @@ def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int) -> Opt return out except Exception: return None + if kind == "audio": + frame = audio_still(src, size, media_id) + if frame is not None: + return _save_webp(frame, out) ffmpeg = ffmpeg_path() - if ffmpeg: + if ffmpeg and kind != "audio": token = secrets.token_hex(4) grab, tmp = f"{out}.{token}.frame.jpg", f"{out}.{token}.tmp" for seek in ("0", "0.5"): @@ -117,6 +122,55 @@ def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int) -> Opt return ph if os.path.isfile(ph) else None +def cover_art(src: str, size: int) -> Optional[Image.Image]: + ffmpeg = ffmpeg_path() + if not ffmpeg: + return None + try: + done = subprocess.run( + [ffmpeg, "-hide_banner", "-loglevel", "error", "-i", src, "-an", "-map", "0:v:0", "-frames:v", "1", + "-vf", f"scale={size}:-2", "-f", "image2pipe", "-c:v", "png", "pipe:1"], + capture_output=True, timeout=30, + ) + except (OSError, subprocess.SubprocessError): + return None + if done.returncode != 0 or not done.stdout: + return None + try: + with Image.open(io.BytesIO(done.stdout)) as img: + return img.convert("RGB") + except Exception: + return None + + +def audio_still(src: str, size: int, media_id: Optional[int] = None) -> Optional[Image.Image]: + from . import waveform + + art = cover_art(src, size) + if art is not None: + return art + if media_id is None: + peaks = waveform.decode(src=src) + else: + from ..db import q1 + + row = q1("SELECT duration FROM media WHERE id=?", (media_id,)) + peaks = waveform.cached(media_id, src, row["duration"] if row else None) + return waveform.image(peaks, size) if peaks else None + + +def _save_webp(frame: Image.Image, out: str) -> Optional[str]: + tmp = f"{out}.{secrets.token_hex(4)}.tmp" + try: + frame.convert("RGB").save(tmp, "WEBP", quality=80, method=4) + os.replace(tmp, out) + return out + except Exception: + return None + finally: + _discard(tmp) + + def _placeholder_poster(target: str, size: int) -> None: height = max(2, int(size * 9 / 16)) img = Image.new("RGB", (size, height), (24, 22, 18)) diff --git a/backend/app/services/waveform.py b/backend/app/services/waveform.py new file mode 100644 index 0000000..ad7f3fd --- /dev/null +++ b/backend/app/services/waveform.py @@ -0,0 +1,188 @@ +import json +import math +import os +import secrets +import subprocess +import threading +import wave +from typing import Iterable, List, Optional + +import numpy as np +from PIL import Image, ImageDraw + +from ..dedup.visual import ffmpeg_path + +PEAKS = 1000 +WAVE_VER = 1 +DECODE_RATE = 8000 +READ_CHUNK = 1 << 16 +DECODE_TIMEOUT = 600 +MIN_DECODED = 0.5 +BACKGROUND = (24, 22, 18) +BAR = (226, 214, 190) +MIDLINE = (90, 84, 74) + + +def cache_path(media_id: int) -> str: + from .thumbs import thumb_folder + + return os.path.join(thumb_folder(), f"{media_id}_wave_v{WAVE_VER}.json") + + +def pool(values: Iterable[float], buckets: int) -> List[float]: + data = [float(v) for v in values] + if buckets <= 0 or not data: + return [] + if len(data) == buckets: + return data + out = [] + for i in range(buckets): + lo = int(i * len(data) / buckets) + hi = max(lo + 1, int((i + 1) * len(data) / buckets)) + out.append(max(data[lo:hi])) + return out + + +def normalise(values: List[float]) -> List[float]: + top = max(values, default=0.0) + if top <= 0: + return [0.0 for _ in values] + return [round(min(1.0, v / top), 3) for v in values] + + +def peaks_of(samples: np.ndarray, buckets: int = PEAKS) -> List[float]: + flat = np.abs(np.asarray(samples, dtype=np.float32).reshape(-1)) + if flat.size == 0: + return [] + count = min(buckets, flat.size) + edges = np.linspace(0, flat.size, count + 1).astype(np.int64) + found = [float(flat[edges[i]:max(edges[i] + 1, edges[i + 1])].max()) for i in range(count)] + return normalise(pool(found, buckets)) + + +def _window(duration: Optional[float], buckets: int) -> int: + if not duration or duration <= 0: + return DECODE_RATE // 100 + return max(1, int(math.ceil(duration * DECODE_RATE / max(1, buckets * 4)))) + + +def _feed(proc: subprocess.Popen, data: bytes) -> None: + try: + proc.stdin.write(data) + except (BrokenPipeError, OSError): + pass + finally: + try: + proc.stdin.close() + except OSError: + pass + + +def _ffmpeg_peaks(binary: str, src: Optional[str], data: Optional[bytes], duration: Optional[float], buckets: int) -> Optional[List[float]]: + cmd = [binary, "-hide_banner", "-loglevel", "error", "-i", src if src else "pipe:0", "-vn", "-ac", "1", + "-ar", str(DECODE_RATE), "-f", "s16le", "pipe:1"] + proc = subprocess.Popen(cmd, stdin=subprocess.PIPE if data is not None else subprocess.DEVNULL, + stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + writer = None + if data is not None: + writer = threading.Thread(target=_feed, args=(proc, data), daemon=True) + writer.start() + window = _window(duration, buckets) + found: List[float] = [] + total = 0 + carry = np.zeros(0, dtype=np.int16) + try: + while True: + block = proc.stdout.read(READ_CHUNK) + if not block: + break + usable = len(block) - (len(block) % 2) + total += usable // 2 + samples = np.concatenate([carry, np.frombuffer(block[:usable], dtype=" Optional[List[float]]: + try: + with wave.open(src, "rb") as handle: + width, channels = handle.getsampwidth(), handle.getnchannels() + raw = handle.readframes(handle.getnframes()) + except (wave.Error, EOFError, OSError): + return None + kinds = {1: np.uint8, 2: " Optional[List[float]]: + binary = ffmpeg_path() + if binary: + try: + found = _ffmpeg_peaks(binary, src, data, duration, buckets) + except (OSError, subprocess.SubprocessError, ValueError): + found = None + if found: + return found + if src and os.path.isfile(src): + return _wave_peaks(src, buckets) + return None + + +def cached(media_id: int, src: str, duration: Optional[float]) -> Optional[List[float]]: + path = cache_path(media_id) + if os.path.isfile(path): + try: + with open(path, "r", encoding="utf-8") as handle: + stored = json.load(handle) + if isinstance(stored, list) and stored: + return [float(v) for v in stored] + except (OSError, ValueError, TypeError): + pass + found = decode(src=src, duration=duration) + if not found: + return None + tmp = f"{path}.{secrets.token_hex(4)}.tmp" + try: + with open(tmp, "w", encoding="utf-8") as handle: + json.dump(found, handle) + os.replace(tmp, path) + except OSError: + if os.path.isfile(tmp): + os.unlink(tmp) + return found + + +def image(peaks: List[float], width: int) -> Image.Image: + height = max(2, int(width * 9 / 16)) + canvas = Image.new("RGB", (width, height), BACKGROUND) + draw = ImageDraw.Draw(canvas) + middle = height / 2 + draw.line([(0, middle), (width, middle)], fill=MIDLINE, width=1) + stride = 3 + columns = pool(peaks, max(1, width // stride)) + reach = height * 0.42 + for i, value in enumerate(columns): + span = max(1.0, value * reach) + x = i * stride + draw.rectangle([x, middle - span, x + stride - 2, middle + span], fill=BAR) + return canvas diff --git a/backend/app/vaultcrypt.py b/backend/app/vaultcrypt.py index c903eec..aac816b 100644 --- a/backend/app/vaultcrypt.py +++ b/backend/app/vaultcrypt.py @@ -380,7 +380,7 @@ def _scrub(media_id: int) -> None: folder = os.path.join(cache_dir(), "thumbs") for path in glob.glob(os.path.join(glob.escape(folder), f"{media_id}_*")): _unlink(path) - for sub in ("render", "effects", "share"): + for sub in ("render", "effects", "share", "listen"): for path in glob.glob(os.path.join(glob.escape(os.path.join(cache_dir(), sub)), f"{media_id}_*")): _unlink(path) faces = os.path.join(cache_dir(), "faces") @@ -475,7 +475,16 @@ def _reseal(item, home: str) -> None: ex("UPDATE vault_items SET sealed=?, home=? WHERE media_id=?", (_seal(ck, _home_pub(home)), home, item["media_id"])) +def _drop_plain_audio(media_id: int) -> None: + patterns = ((os.path.join(cache_dir(), "listen"), f"{media_id}_*"), (os.path.join(cache_dir(), "thumbs"), f"{media_id}_wave_*")) + for folder, name in patterns: + for path in glob.glob(os.path.join(glob.escape(folder), name)): + _unlink(path) + + def _settle(row) -> bool: + if protected(row): + _drop_plain_audio(row["id"]) try: home = home_for(row) item = _item(row["id"]) @@ -601,15 +610,16 @@ def _scrub_vaulted() -> None: vaulted = {row["media_id"] for row in q("SELECT media_id FROM vault_items")} if not vaulted: return - folder = os.path.join(cache_dir(), "thumbs") - try: - names = os.listdir(folder) - except OSError: - names = [] - for name in names: - head = name.split("_", 1)[0] - if head.isdigit() and int(head) in vaulted: - _unlink(os.path.join(folder, name)) + for sub in ("thumbs", "listen"): + folder = os.path.join(cache_dir(), sub) + try: + names = os.listdir(folder) + except OSError: + names = [] + for name in names: + head = name.split("_", 1)[0] + if head.isdigit() and int(head) in vaulted: + _unlink(os.path.join(folder, name)) faces = os.path.join(cache_dir(), "faces") for face in q("SELECT f.id FROM faces f JOIN vault_items v ON v.media_id=f.media_id"): _unlink(os.path.join(faces, f"{face['id']}.jpg")) diff --git a/backend/tests/test_audio_import.py b/backend/tests/test_audio_import.py new file mode 100644 index 0000000..ad84f29 --- /dev/null +++ b/backend/tests/test_audio_import.py @@ -0,0 +1,231 @@ +import json +import math +import os +import shutil +import struct +import subprocess +import wave + +import numpy as np +import pytest + +from tests.conftest import HEADERS, import_dir + +FFMPEG = shutil.which("ffmpeg") and shutil.which("ffprobe") +needs_ffmpeg = pytest.mark.skipif(not FFMPEG, reason="ffmpeg is not installed") + + +def write_wav(path, seconds=1.0, rate=8000, freq=440.0, channels=1, ramp=False): + frames = int(seconds * rate) + with wave.open(str(path), "wb") as handle: + handle.setnchannels(channels) + handle.setsampwidth(2) + handle.setframerate(rate) + body = bytearray() + for i in range(frames): + level = (i / frames) if ramp else 0.6 + sample = int(32767 * level * math.sin(2 * math.pi * freq * i / rate)) + body += struct.pack("=", "value": 8000}]}) != [] + first = client.get("/api/browse", params={"spec": json.dumps({"rules": [{"field": "flag", "value": "audio"}], "sort": "duration"}), "limit": 1}).json() + rest = client.get("/api/browse", params={"spec": json.dumps({"rules": [{"field": "flag", "value": "audio"}], "sort": "duration"}), + "cursor": json.dumps(first["next"]), "limit": 1}).json() + assert [m["name"] for m in first["items"] + rest["items"]] == ["long.wav", "short.wav"] + + +def test_upload_imports_audio(client, tmp_path): + path = write_wav(tmp_path / "dropped.wav", seconds=0.3) + with open(path, "rb") as handle: + res = client.post("/api/import/upload", files=[("files", ("dropped.wav", handle, "audio/wav"))], headers=HEADERS) + assert res.status_code == 200 and res.json()["counts"]["imported"] == 1 + media_id = res.json()["ids"][0] + assert client.get(f"/api/media/{media_id}").json()["kind"] == "audio" + + +def test_waveform_refuses_non_audio(client, tmp_path): + from tests.conftest import pattern + + src = tmp_path / "src" + os.makedirs(src) + pattern(64, 48).save(src / "still.jpg", "JPEG") + import_dir(client, src) + media_id = client.get("/api/media").json()["items"][0]["id"] + assert client.get(f"/api/media/{media_id}/waveform").status_code == 415 + assert client.get(f"/api/media/{media_id}/listen").status_code == 415 + + +@needs_ffmpeg +def test_mp3_tags_cover_art_and_search(client, tmp_path): + from tests.conftest import pattern + + src = tmp_path / "src" + os.makedirs(src) + art = tmp_path / "art.jpg" + pattern(300, 300).save(art, "JPEG") + write_mp3(src / "bells.mp3", cover=art) + import_dir(client, src) + item = client.get("/api/media", params={"filter": "audio"}).json()["items"][0] + assert item["kind"] == "audio" and item["mime"] == "audio/mpeg" and item["audio_codec"] == "mp3" + assert (item["title"], item["artist"], item["album_title"], item["genre"], item["track"], item["release_year"]) == ( + "Harbour Bells", "Tide Choir", "Shoreline", "Ambient", "3/9", 2019) + assert item["has_cover"] == 1 and item["width"] is None and abs(item["duration"] - 2.0) < 0.2 + thumb = client.get(f"/api/media/{item['id']}/thumb", params={"s": 384}) + from io import BytesIO + from PIL import Image + + assert Image.open(BytesIO(thumb.content)).size == (384, 384) + hits = client.get("/api/media/search", params={"q": "Tide Choir"}).json()["items"] + assert [h["id"] for h in hits] == [item["id"]] + spec = {"text": "shoreline"} + assert [m["id"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == [item["id"]] + spec = {"rules": [{"field": "artist", "op": "contains", "value": "choir"}, {"field": "flag", "value": "cover_art"}]} + assert [m["id"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == [item["id"]] + details = client.get(f"/api/media/{item['id']}/details").json() + assert details["exif"]["Tag artist"] == "Tide Choir" + + +@needs_ffmpeg +def test_listen_transcodes_for_the_browser(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-f", "lavfi", "-i", "sine=duration=1", + "-c:a", "pcm_s16be", str(src / "bell.aiff")], check=True, capture_output=True) + import_dir(client, src) + item = client.get("/api/media", params={"filter": "audio"}).json()["items"][0] + assert item["mime"] == "audio/aiff" and item["bit_depth"] == 16 + res = client.get(f"/api/media/{item['id']}/listen") + assert res.status_code == 200 and res.headers["content-type"] == "audio/flac" and res.content[:4] == b"fLaC" + + +@needs_ffmpeg +def test_sound_only_mp4_is_audio(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-f", "lavfi", "-i", "sine=duration=1", + "-c:a", "aac", str(src / "memo.mp4")], check=True, capture_output=True) + import_dir(client, src) + item = client.get("/api/media").json()["items"][0] + assert item["kind"] == "audio" and item["mime"] == "audio/mp4" From 41dee03eb03382fc2e66b646fced711d9ebbba66 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 12:24:49 -0500 Subject: [PATCH 02/35] feat: trim, export and share audio like video 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. --- backend/HASHOUT_LOG.md | 23 +++ backend/app/routers/edit.py | 33 +++-- backend/app/services/gallerysvc.py | 14 +- backend/app/services/outputsvc.py | 6 +- backend/app/services/packagesvc.py | 23 ++- backend/app/services/trimsvc.py | 60 ++++++++ backend/tests/test_audio_organise.py | 203 +++++++++++++++++++++++++++ 7 files changed, 335 insertions(+), 27 deletions(-) create mode 100644 backend/app/services/trimsvc.py create mode 100644 backend/tests/test_audio_organise.py diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 7940496..f1a3e78 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,28 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/classify.py, audiometa.py, waveform.py, trimsvc.py, routers/audio.py · audio is a third kind +- refers-to: classify.AUDIO_EXTS, AUDIO_ONLY_MIMES, is_timed, audio_only_mime; mediainfo.probe, picture_stream, sound_only, audio_meta; audiometa (new); waveform (new); trimsvc (new); routers/audio.py (new) /media/{id}/waveform and /media/{id}/listen; db.py migration 12 (AUDIO_COLUMNS, idx_media_kind); libraryfs.import_one; metasvc.read, _apply_audio; thumbs.cover_art, audio_still, _save_webp; query SORTS duration, FLAGS audio, cover_art, lossless, TEXT_FIELDS, NUM_FIELDS, the audio text scope; browse MEDIA_TYPES; mediaapi FILTERS audio and the tags search field; system summary audio; importer UPLOAD_EXTS and _poster; edit.py trim and trim/export (normalise); gallerysvc, packagesvc strip_timed, outputsvc _copy_stripped; vaultcrypt._scrub listen, _scrub_vaulted listen, _drop_plain_audio in _settle; audiometa.location_of; guard._any_token /listen; tests/test_audio_import.py, tests/test_audio_organise.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +Audio clips import, list, play and organise like photos and videos. The kind is "audio" for mp3, m4a, aac, wav, aiff, aif, flac, ogg, oga, opus, caf and wma, and for an mp4, m4v, mov, 3gp, webm or mkv whose only streams are sound (a voice memo saved as mp4); hashing and duplicate detection are the same sha256 and size pair as every other item. + +Metadata comes from ffprobe, which the engine already uses for video, so no tag library was added. mutagen was the other choice and is GPL, which the licence rules keep out of the bundle. ffprobe gives the codec, sample rate, channels, bit depth (bits_per_raw_sample, then bits_per_sample, then the PCM sample format; none for lossy codecs), bitrate and the format and stream tags merged (Ogg and Opus keep their tags on the stream). The tags land in their own columns (artist, album_title, genre, track, release_year, has_cover) so search and smart albums can use them; the album tag is album_title because "album" already means a formDAM album. A title tag fills the title only on the first read and only when the title is empty, so a title the person typed is never replaced. Without ffprobe a WAV still gets its duration and layout from the standard library wave module. + +Audio rows are marked face_state 2, clip_state 2 and ocr_text '' at import, and the face, CLIP and OCR jobs, their pending counts, visual duplicate matching and Memories leave audio out: none of them can find anything in sound, and the poster they would read is a drawing of the waveform. + +The waveform is the peak of every window of an 8 kHz mono decode, read from ffmpeg's pipe in 64 KiB blocks so an hour of audio never sits in memory, pooled to 1000 values and scaled so the loudest is 1. It is cached as {id}_wave_v1.json in the thumbs folder, which is the folder the vault already scrubs by media id, so hiding or deleting an item removes it with the thumbs. A decode that gives back less than half the samples the duration promises counts as failed and the WAV reader is tried; a broken ffmpeg on PATH (a stub that prints a word was found in a shared download folder on the machine this was built on) had given a flat line. A protected item's waveform is decoded from its sealed bytes through ffmpeg's stdin and never written to disk. + +The grid thumb is the embedded cover art when there is one, scaled to the bucket width like a video poster, else the waveform drawn at the bucket width and 16:9, the shape a video poster has. + +/media/{id}/listen gives the window a FLAC copy for a format its engine cannot play (AIFF in Chromium, WMA, CAF, Ogg in older WebKit). The window asks for it only after the original fails. The copy is cached under cache/listen and scrubbed with the other caches; a protected item streams from ffmpeg and is never stored. The vault cookie is accepted on /listen as on /file, since an audio element cannot send a header. + +Trim and trim export take audio as they take video. Export with normalise=true re-encodes the trimmed range through loudnorm (I -16, TP -1.5, LRA 11) at the source sample rate, into the same format when the ffmpeg in use has the encoder, else into FLAC: the LGPL ffmpeg the app downloads has no MP3 or Vorbis encoder. It is refused for video, which keeps its stream copy. + +Sharing, packages and export strip all metadata from audio (ffmpeg -map_metadata -1, keeping the cover art stream) whenever location is left out or no metadata is asked for, as they do for video. The database's empty lat is not taken as proof that the file carries no place: a recorder can write one the engine never read. The reader also takes the location tags (location, location-eng, com.apple.quicktime.location.ISO6709 and the QuickTime xyz atom) into lat, lon and alt, so the catalog shows and hides an audio item's place like a video's. + +The listen copy and the waveform cache are plain files. When an item becomes protected (hidden, trashed or in a private album) the vault's settle step deletes both before anything else, with or without a vault set up; sealing and deleting scrub the listen folder with the other caches, and the start-up sweep of vaulted items covers it. A protected item's listen copy is streamed from ffmpeg and never written. + ### ../setup/build_windows_app.bat WINDOWED · the Windows engine is frozen with no console of its own - refers-to: setup/build_windows_app.bat WINDOWED, FORMDAM_ENGINE_WINDOWED; desktop_entry.py the stream guard at the top, _Tee, _open_log; src-tauri/src/main.rs backend_command, forward_lines, read_port; tests/test_entry_streams.py (three new tests) - kind: decision diff --git a/backend/app/routers/edit.py b/backend/app/routers/edit.py index 1f2ade9..88ba08d 100644 --- a/backend/app/routers/edit.py +++ b/backend/app/routers/edit.py @@ -9,13 +9,13 @@ from collections import OrderedDict from typing import Annotated, Any, Dict, List, Optional -from fastapi import APIRouter, HTTPException, Request +from fastapi import APIRouter, HTTPException, Query, Request from fastapi.responses import Response from pydantic import BaseModel, Field from ..db import ex, q1 from ..dedup.visual import ffmpeg_path -from ..services import cleanup, decode, editsvc, extedit, libraryfs, thumbs +from ..services import classify, cleanup, decode, editsvc, extedit, libraryfs, thumbs, trimsvc from .guard import ensure_visible from .render import clear_cached, source_of @@ -316,8 +316,8 @@ def auto(media_id: int, request: Request): @router.post("/media/{media_id}/trim") def set_trim(media_id: int, body: TrimIn, request: Request): row = _row(media_id, request) - if row["kind"] != "video": - raise HTTPException(415, detail="Only videos trim") + if not classify.is_timed(row["kind"]): + raise HTTPException(415, detail="Only videos and audio trim") if body.trim_in is not None and body.trim_out is not None and body.trim_out <= body.trim_in: raise HTTPException(400, detail="The end must come after the start") ex("UPDATE media SET trim_in=?, trim_out=?, edited_ts=?, xmp_ts=NULL WHERE id=?", @@ -326,10 +326,12 @@ def set_trim(media_id: int, body: TrimIn, request: Request): @router.post("/media/{media_id}/trim/export") -def export_trim(media_id: int, request: Request): +def export_trim(media_id: int, request: Request, normalise: bool = Query(False)): row = _row(media_id, request) - if row["kind"] != "video" or (row["trim_in"] is None and row["trim_out"] is None): + if not classify.is_timed(row["kind"]) or (row["trim_in"] is None and row["trim_out"] is None): raise HTTPException(400, detail="Set a trim first") + if normalise and row["kind"] != "audio": + raise HTTPException(400, detail="Loudness normalising is for audio clips") from .. import vaultcrypt if vaultcrypt.protected(row) or vaultcrypt.is_vaulted(media_id): @@ -339,16 +341,14 @@ def export_trim(media_id: int, request: Request): raise HTTPException(409, detail="ffmpeg is not installed") src = libraryfs.abs_path(row["rel_path"]) stem, ext = os.path.splitext(row["name"]) + ext = ext or (".m4a" if row["kind"] == "audio" else ".mov") + codec = None + if normalise: + ext, codec = trimsvc.output_codec(ext, row["bit_depth"], trimsvc.encoders(binary)) folder = tempfile.mkdtemp(prefix="dam-trim-") - out = os.path.join(folder, f"{stem}_trim{ext or '.mov'}") + out = os.path.join(folder, trimsvc.target_name(stem, ext, normalise)) start = float(row["trim_in"] or 0) - cmd = [binary, "-hide_banner", "-loglevel", "error", "-y"] - if start: - cmd += ["-ss", f"{start:.3f}"] - cmd += ["-i", src] - if row["trim_out"]: - cmd += ["-t", f"{float(row['trim_out']) - start:.3f}"] - cmd += ["-map", "0", "-map_metadata", "0", "-c", "copy", out] + cmd = trimsvc.command(binary, src, out, start, row["trim_out"], normalise, codec, row["sample_rate"]) try: done = subprocess.run(cmd, capture_output=True, timeout=600) if done.returncode != 0 or not os.path.isfile(out): @@ -359,4 +359,9 @@ def export_trim(media_id: int, request: Request): if result.get("status") != "imported": raise HTTPException(409, detail="The trimmed clip matches an item already in the library") ex("UPDATE media SET created_ts=? WHERE id=?", ((row["created_ts"] or 0) + (row["trim_in"] or 0), result["media_id"])) + if classify.is_timed(result.get("kind")): + try: + thumbs.ensure_thumb(result["media_id"], result["rel_path"], result["kind"], 384) + except Exception: + pass return {"id": result["media_id"]} diff --git a/backend/app/services/gallerysvc.py b/backend/app/services/gallerysvc.py index 4a3b1ff..b26a26b 100644 --- a/backend/app/services/gallerysvc.py +++ b/backend/app/services/gallerysvc.py @@ -29,13 +29,14 @@ def download_path(share, media_id: int) -> Optional[str]: row = q1("SELECT * FROM media WHERE id=?", (media_id,)) src = libraryfs.abs_path(row["rel_path"]) - trimmed = row["kind"] == "video" and (row["trim_in"] is not None or row["trim_out"] is not None) + timed = row["kind"] in ("video", "audio") + trimmed = timed and (row["trim_in"] is not None or row["trim_out"] is not None) if share["include_location"] and not row["location_hidden"] and not row["edit_json"] and not trimmed: return src folder = os.path.join(cache_dir(), "share") os.makedirs(folder, exist_ok=True) stamp = hashlib.sha1(f"{row['edit_json'] or ''}|{row['edited_ts'] or 0}|{share['include_location']}|{row['location_hidden']}|{row['trim_in']}|{row['trim_out']}".encode()).hexdigest()[:12] - if row["kind"] == "video": + if timed: out = os.path.join(folder, f"{media_id}_{stamp}{os.path.splitext(row['name'])[1].lower() or '.mp4'}") if not os.path.isfile(out): from ..dedup.visual import ffmpeg_path @@ -49,7 +50,8 @@ def download_path(share, media_id: int) -> Optional[str]: args += ["-ss", f"{float(row['trim_in']):.3f}"] if row["trim_out"] is not None: args += ["-to", f"{float(row['trim_out']):.3f}"] - args += ["-i", src, "-map", "0:v:0", "-map", "0:a?", "-dn", "-c", "copy"] + streams = ["-map", "0:a:0", "-map", "0:v?"] if row["kind"] == "audio" else ["-map", "0:v:0", "-map", "0:a?"] + args += ["-i", src, *streams, "-dn", "-c", "copy"] if not share["include_location"] or row["location_hidden"]: args += ["-map_metadata", "-1"] done = subprocess.run(args + [tmp], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=600) @@ -125,14 +127,14 @@ def web_gallery(ids: List[int], title: str, dest: str, include_location: bool, s for pos, media_id in enumerate(ok, start=1): row = q1("SELECT * FROM media WHERE id=?", (media_id,)) stem = f"{pos:04d}" - if row["kind"] == "video": + if row["kind"] in ("video", "audio"): src = download_path(fake, media_id) if src is None: counts["skipped"] += 1 continue full = f"photos/{stem}{os.path.splitext(src)[1]}" shutil.copy2(src, os.path.join(folder, full)) - thumb = thumbs.ensure_thumb(media_id, row["rel_path"], "video", 768) + thumb = thumbs.ensure_thumb(media_id, row["rel_path"], row["kind"], 768) if thumb: from PIL import Image @@ -188,7 +190,7 @@ def html_escape(text: str) -> str: const grid = document.getElementById("grid"), view = document.getElementById("view"), stage = document.getElementById("stage"), cap = document.getElementById("cap"); let at = -1; D.items.forEach((it, i) => { const a = document.createElement("a"); a.href = it.full; const img = document.createElement("img"); img.src = it.thumb; img.alt = it.title; img.loading = "lazy"; a.append(img); a.onclick = (e) => { e.preventDefault(); show(i); }; grid.append(a); }); -function show(i) { if (i < 0 || i >= D.items.length) return; at = i; const it = D.items[i]; const m = document.createElement(it.kind === "video" ? "video" : "img"); m.src = it.full; if (it.kind === "video") m.controls = true; stage.replaceChildren(m); cap.textContent = [it.title, it.caption].filter(Boolean).join(" · "); view.hidden = false; } +function show(i) { if (i < 0 || i >= D.items.length) return; at = i; const it = D.items[i]; const timed = it.kind === "video" || it.kind === "audio"; const m = document.createElement(timed ? it.kind : "img"); m.src = it.full; if (timed) m.controls = true; stage.replaceChildren(m); cap.textContent = [it.title, it.caption].filter(Boolean).join(" · "); view.hidden = false; } view.querySelector(".close").onclick = () => { view.hidden = true; stage.replaceChildren(); }; view.querySelector(".prev").onclick = () => show(at - 1); view.querySelector(".next").onclick = () => show(at + 1); document.addEventListener("keydown", (e) => { if (view.hidden) return; if (e.key === "Escape") view.querySelector(".close").onclick(); if (e.key === "ArrowLeft") show(at - 1); if (e.key === "ArrowRight") show(at + 1); }); diff --git a/backend/app/services/outputsvc.py b/backend/app/services/outputsvc.py index 63d0537..46fcaea 100644 --- a/backend/app/services/outputsvc.py +++ b/backend/app/services/outputsvc.py @@ -94,14 +94,14 @@ class ExportError(Exception): def _copy_stripped(src: Any, target: str, row, opts: Dict[str, Any]) -> None: from . import gpsscrub, packagesvc - if row["kind"] == "video": + if row["kind"] in ("video", "audio"): work = src if isinstance(src, (bytes, bytearray)): work = target + ".src" with open(work, "wb") as fh: fh.write(src) try: - done = packagesvc._strip_video(work, target) + done = packagesvc.strip_timed(row, work, target) except Exception: done = False finally: @@ -110,7 +110,7 @@ def _copy_stripped(src: Any, target: str, row, opts: Dict[str, Any]) -> None: if not done: if os.path.exists(target): os.remove(target) - raise ExportError(f"{row['name']}: location and metadata could not be removed from this video (ffmpeg is needed)") + raise ExportError(f"{row['name']}: location and metadata could not be removed from this {row['kind']} item (ffmpeg is needed)") return if opts.get("metadata") == "none": raise ExportError(f"{row['name']}: an unmodified original keeps its metadata; export it as a rendered copy to leave the metadata out") diff --git a/backend/app/services/packagesvc.py b/backend/app/services/packagesvc.py index 810a839..4c4e938 100644 --- a/backend/app/services/packagesvc.py +++ b/backend/app/services/packagesvc.py @@ -129,15 +129,30 @@ def _strip_video(src: str, dest: str) -> bool: return done.returncode == 0 and os.path.isfile(dest) and os.path.getsize(dest) > 0 +def _strip_audio(src: str, dest: str) -> bool: + from ..dedup.visual import ffmpeg_path + + ff = ffmpeg_path() + if not ff: + return False + done = subprocess.run([ff, "-y", "-v", "error", "-i", src, "-map", "0:a", "-map", "0:v?", "-dn", "-map_metadata", "-1", + "-c", "copy", dest], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=900) + return done.returncode == 0 and os.path.isfile(dest) and os.path.getsize(dest) > 0 + + +def strip_timed(row, src: str, dest: str) -> bool: + return _strip_audio(src, dest) if row["kind"] == "audio" else _strip_video(src, dest) + + def _payload(row, include_location: bool, work: str) -> Dict[str, Any]: src = libraryfs.abs_path(row["rel_path"]) if include_location and not row["location_hidden"]: return {"path": src, "name": row["name"], "converted": False} target = os.path.join(work, secrets.token_hex(8) + os.path.splitext(row["name"])[1].lower()) - if row["kind"] == "video": - if _strip_video(src, target): + if row["kind"] in ("video", "audio"): + if strip_timed(row, src, target): return {"path": target, "name": row["name"], "converted": False} - raise PackageError(f"{row['name']}: location could not be removed from this video (ffmpeg is needed)") + raise PackageError(f"{row['name']}: location could not be removed from this {row['kind']} item (ffmpeg is needed)") with open(src, "rb") as handle: clean = gpsscrub.scrub(handle.read()) with open(target, "wb") as handle: @@ -343,7 +358,7 @@ def _apply_meta(media_id: int, entry: Dict[str, Any]) -> None: vals += [lat, lon] for key in ("trim_in", "trim_out"): value = _number(entry.get(key), 0, 1e7) - if value is not None and row[key] is None and row["kind"] == "video": + if value is not None and row[key] is None and row["kind"] in ("video", "audio"): sets.append(f"{key}=?") vals.append(value) if sets: diff --git a/backend/app/services/trimsvc.py b/backend/app/services/trimsvc.py new file mode 100644 index 0000000..609cd6d --- /dev/null +++ b/backend/app/services/trimsvc.py @@ -0,0 +1,60 @@ +import os +import subprocess +from functools import lru_cache +from typing import List, Optional, Tuple + +LOUDNORM = "loudnorm=I=-16:TP=-1.5:LRA=11" +FALLBACK = (".flac", "flac") +ENCODERS = { + ".mp3": "libmp3lame", ".m4a": "aac", ".aac": "aac", ".flac": "flac", ".ogg": "libvorbis", ".oga": "libvorbis", + ".opus": "libopus", ".wma": "wmav2", ".caf": "alac", ".wav": "pcm_s16le", ".aiff": "pcm_s16be", ".aif": "pcm_s16be", +} +DEEP_PCM = {".wav": "pcm_s24le", ".aiff": "pcm_s24be", ".aif": "pcm_s24be"} + + +@lru_cache(maxsize=4) +def encoders(binary: str) -> frozenset: + try: + listing = subprocess.run([binary, "-hide_banner", "-encoders"], capture_output=True, text=True, timeout=20).stdout + except (OSError, subprocess.SubprocessError): + return frozenset() + names = set() + for line in listing.splitlines(): + parts = line.split() + if len(parts) >= 2 and len(parts[0]) == 6 and parts[0][0] == "A": + names.add(parts[1]) + return frozenset(names) + + +def output_codec(ext: str, bit_depth: Optional[int], available: frozenset) -> Tuple[str, str]: + ext = ext.lower() + wanted = DEEP_PCM.get(ext) if (bit_depth or 0) > 16 else None + wanted = wanted or ENCODERS.get(ext) + if wanted and (wanted in available or wanted.startswith("pcm_")): + return ext, wanted + return FALLBACK + + +def command(binary: str, src: str, out: str, start: float, end: Optional[float], normalise: bool = False, + codec: Optional[str] = None, sample_rate: Optional[int] = None) -> List[str]: + cmd = [binary, "-hide_banner", "-loglevel", "error", "-y"] + if start: + cmd += ["-ss", f"{start:.3f}"] + cmd += ["-i", src] + if end: + cmd += ["-t", f"{float(end) - start:.3f}"] + if not normalise: + return cmd + ["-map", "0", "-map_metadata", "0", "-c", "copy", out] + cmd += ["-map", "0:a:0", "-map_metadata", "0", "-vn", "-af", LOUDNORM, "-c:a", codec or "flac"] + if sample_rate: + cmd += ["-ar", str(int(sample_rate))] + return cmd + [out] + + +def target_name(stem: str, ext: str, normalise: bool) -> str: + suffix = "_trim_loud" if normalise else "_trim" + return f"{stem}{suffix}{ext}" + + +def ext_of(name: str, fallback: str) -> str: + return os.path.splitext(name)[1] or fallback diff --git a/backend/tests/test_audio_organise.py b/backend/tests/test_audio_organise.py new file mode 100644 index 0000000..b8059ea --- /dev/null +++ b/backend/tests/test_audio_organise.py @@ -0,0 +1,203 @@ +import json +import os +import subprocess +import time + +import pytest + +from tests.conftest import HEADERS, import_dir, wait_job +from tests.test_audio_import import needs_ffmpeg, write_mp3, write_wav + + +def one_audio(client, tmp_path, seconds=2.0): + src = tmp_path / "src" + os.makedirs(src, exist_ok=True) + write_wav(src / "take.wav", seconds=seconds, rate=16000, ramp=True) + import_dir(client, src) + return client.get("/api/media", params={"filter": "audio"}).json()["items"][0] + + +def test_rating_label_keywords_and_albums_apply_to_audio(client, tmp_path): + item = one_audio(client, tmp_path) + media_id = item["id"] + assert client.patch(f"/api/media/{media_id}/meta", json={"rating": 4, "label": "green", "title": "Harbour take"}, headers=HEADERS).status_code == 200 + assert client.post("/api/media/keywords", json={"ids": [media_id], "add": ["fieldwork"], "remove": []}, headers=HEADERS).status_code == 200 + album = client.post("/api/albums", json={"name": "Sounds"}, headers=HEADERS).json()["id"] + assert client.post(f"/api/albums/{album}/items", json={"media_ids": [media_id]}, headers=HEADERS).json()["added"] == 1 + details = client.get(f"/api/media/{media_id}/details").json() + assert (details["rating"], details["label"], details["title"]) == (4, "green", "Harbour take") + assert [k["name"] for k in details["keywords"]] == ["fieldwork"] + assert [a["name"] for a in details["albums"]] == ["Sounds"] + spec = {"rules": [{"field": "flag", "value": "audio"}, {"field": "rating", "op": ">=", "value": 4}, {"field": "keyword", "value": "fieldwork"}]} + assert [m["id"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == [media_id] + + +def test_sidecar_round_trip_for_audio(client, tmp_path): + from app.services import libraryfs, xmpsvc + + item = one_audio(client, tmp_path) + media_id = item["id"] + client.patch(f"/api/media/{media_id}/meta", json={"rating": 3, "caption": "Gulls at dawn"}, headers=HEADERS) + job = client.post("/api/xmp/write", json={"ids": [media_id]}, headers=HEADERS).json()["job_id"] + assert wait_job(client, job)["phase"] == "done" + side = xmpsvc.sidecar_for(libraryfs.abs_path(item["rel_path"])) + assert side.endswith("take.xmp") and os.path.isfile(side) + client.patch(f"/api/media/{media_id}/meta", json={"rating": 0, "caption": ""}, headers=HEADERS) + assert client.post("/api/xmp/read", json={"ids": [media_id]}, headers=HEADERS).json() == {"read": 1} + details = client.get(f"/api/media/{media_id}/details").json() + assert (details["rating"], details["caption"]) == (3, "Gulls at dawn") + + +def test_trash_and_restore_audio(client, tmp_path): + item = one_audio(client, tmp_path) + media_id = item["id"] + assert client.post(f"/api/media/{media_id}/trash", headers=HEADERS).status_code == 200 + assert client.get("/api/summary").json()["audio"] == 0 + token = client.post("/api/vault/setup", json={"passkey": "trashkey"}, headers=HEADERS).json()["token"] + auth = {**HEADERS, "x-dam-vault": token} + assert client.post(f"/api/trash/{media_id}/restore", headers=auth).status_code == 200 + assert client.get("/api/summary").json()["audio"] == 1 + + +def test_hidden_audio_is_sealed_and_still_plays(client, tmp_path): + from app.services import libraryfs, waveform + + item = one_audio(client, tmp_path) + media_id = item["id"] + original = libraryfs.abs_path(item["rel_path"]) + with open(original, "rb") as handle: + plain = handle.read() + token = client.post("/api/vault/setup", json={"passkey": "vaultkey9"}, headers=HEADERS).json()["token"] + auth = {**HEADERS, "x-dam-vault": token} + assert client.post(f"/api/media/{media_id}/hide", headers=HEADERS).status_code == 200 + deadline = time.monotonic() + 10 + while os.path.exists(original) and time.monotonic() < deadline: + time.sleep(0.05) + assert not os.path.exists(original) + assert not os.path.exists(waveform.cache_path(media_id)) + assert client.get(f"/api/media/{media_id}/waveform").status_code == 401 + res = client.get(f"/api/media/{media_id}/waveform", params={"n": 60}, headers=auth) + assert res.status_code == 200 and res.headers["cache-control"] == "no-store" and len(res.json()["peaks"]) == 60 + assert not os.path.exists(waveform.cache_path(media_id)) + played = client.get(f"/api/media/{media_id}/file", headers=auth) + assert played.status_code == 200 and played.content == plain + thumb = client.get(f"/api/media/{media_id}/thumb", headers=auth) + assert thumb.status_code == 200 and thumb.headers["cache-control"] == "no-store" + + +def test_trim_needs_a_timed_item_and_an_order(client, tmp_path): + item = one_audio(client, tmp_path) + media_id = item["id"] + assert client.post(f"/api/media/{media_id}/trim", json={"trim_in": 1.0, "trim_out": 0.5}, headers=HEADERS).status_code == 400 + assert client.post(f"/api/media/{media_id}/trim/export", headers=HEADERS).status_code == 400 + saved = client.post(f"/api/media/{media_id}/trim", json={"trim_in": 0.5, "trim_out": 1.5}, headers=HEADERS) + assert saved.status_code == 200 and client.get(f"/api/media/{media_id}").json()["trim_out"] == 1.5 + + +def test_trim_command_and_codec_choice(): + from app.services import trimsvc + + copy = trimsvc.command("ff", "in.wav", "out.wav", 0.5, 1.5) + assert copy[copy.index("-ss") + 1] == "0.500" and copy[copy.index("-t") + 1] == "1.000" and "copy" in copy + loud = trimsvc.command("ff", "in.wav", "out.wav", 0.0, None, True, "pcm_s16le", 44100) + assert "-ss" not in loud and "-t" not in loud and trimsvc.LOUDNORM in loud and loud[loud.index("-ar") + 1] == "44100" + assert trimsvc.output_codec(".wav", 24, frozenset()) == (".wav", "pcm_s24le") + assert trimsvc.output_codec(".mp3", None, frozenset({"libmp3lame"})) == (".mp3", "libmp3lame") + assert trimsvc.output_codec(".mp3", None, frozenset()) == trimsvc.FALLBACK + assert trimsvc.target_name("take", ".wav", True) == "take_trim_loud.wav" + + +@needs_ffmpeg +@pytest.mark.parametrize("normalise", [False, True]) +def test_trim_export_makes_a_new_audio_item(client, tmp_path, normalise): + item = one_audio(client, tmp_path, seconds=3.0) + media_id = item["id"] + client.post(f"/api/media/{media_id}/trim", json={"trim_in": 0.5, "trim_out": 2.0}, headers=HEADERS) + res = client.post(f"/api/media/{media_id}/trim/export", params={"normalise": normalise}, headers=HEADERS) + assert res.status_code == 200, res.text + clip = client.get(f"/api/media/{res.json()['id']}").json() + assert clip["kind"] == "audio" and abs(clip["duration"] - 1.5) < 0.1 + assert clip["name"] == ("take_trim_loud.wav" if normalise else "take_trim.wav") + assert clip["sample_rate"] == 16000 + assert client.get("/api/summary").json()["audio"] == 2 + + +@needs_ffmpeg +def test_normalise_is_only_for_audio(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-f", "lavfi", "-i", "testsrc=duration=2:size=64x48:rate=10", + "-pix_fmt", "yuv420p", str(src / "clip.mp4")], check=True, capture_output=True) + import_dir(client, src) + media_id = client.get("/api/media", params={"filter": "videos"}).json()["items"][0]["id"] + client.post(f"/api/media/{media_id}/trim", json={"trim_in": 0.5, "trim_out": 1.5}, headers=HEADERS) + assert client.post(f"/api/media/{media_id}/trim/export", params={"normalise": True}, headers=HEADERS).status_code == 400 + + +@needs_ffmpeg +def test_export_strips_audio_whenever_location_is_left_out(client, tmp_path): + from app.services import audiometa + + src = tmp_path / "src" + os.makedirs(src) + write_mp3(src / "bells.mp3", location="+51.5074-000.1278/") + import_dir(client, src) + item = client.get("/api/media", params={"filter": "audio"}).json()["items"][0] + assert (round(item["lat"], 4), round(item["lon"], 4)) == (51.5074, -0.1278) + from app.db import ex + + ex("UPDATE media SET lat=NULL, lon=NULL WHERE id=?", (item["id"],)) + cases = (("kept", {}, "Tide Choir", True), ("no-place", {"location": False}, "", False), + ("bare", {"metadata": "none", "original": True}, "", False)) + for folder, options, artist, located in cases: + dest = tmp_path / folder + job = client.post("/api/export", json={"ids": [item["id"]], "dest": str(dest), "options": options}, headers=HEADERS).json()["job_id"] + assert wait_job(client, job)["phase"] == "done" + files = [n for n in os.listdir(dest) if n.endswith(".mp3")] + assert len(files) == 1 + found = audiometa.read_audio(str(dest / files[0])) + assert found.get("artist", "") == artist + assert ("lat" in found) is located + + +@needs_ffmpeg +def test_share_package_strips_audio_without_location(tmp_path): + from app.services import audiometa, packagesvc + + path = tmp_path / "bells.mp3" + write_mp3(path, location="+51.5074-000.1278/") + row = {"kind": "audio", "rel_path": str(path), "name": "bells.mp3", "location_hidden": 0, "lat": None} + out = packagesvc._payload(row, False, str(tmp_path)) + assert out["path"] != str(path) + assert "lat" not in audiometa.read_audio(out["path"]) + + +@needs_ffmpeg +def test_listen_copy_is_purged_and_never_written_for_sealed_items(client, tmp_path): + from app.routers.audio import listen_path + + item = one_audio(client, tmp_path) + media_id = item["id"] + assert client.get(f"/api/media/{media_id}/listen").status_code == 200 + assert os.path.isfile(listen_path(media_id)) + token = client.post("/api/vault/setup", json={"passkey": "vaultkey9"}, headers=HEADERS).json()["token"] + auth = {**HEADERS, "x-dam-vault": token} + assert client.post(f"/api/media/{media_id}/hide", headers=HEADERS).status_code == 200 + assert not os.path.exists(listen_path(media_id)) + res = client.get(f"/api/media/{media_id}/listen", headers=auth) + assert res.status_code == 200 and res.content[:4] == b"fLaC" and res.headers["cache-control"] == "no-store" + assert not os.path.exists(listen_path(media_id)) + + +@needs_ffmpeg +def test_listen_copy_goes_with_trash_even_without_a_vault(client, tmp_path): + from app.routers.audio import listen_path + from app.services import waveform + + item = one_audio(client, tmp_path) + media_id = item["id"] + client.get(f"/api/media/{media_id}/listen") + assert os.path.isfile(listen_path(media_id)) and os.path.isfile(waveform.cache_path(media_id)) + assert client.post(f"/api/media/{media_id}/trash", headers=HEADERS).status_code == 200 + assert not os.path.exists(listen_path(media_id)) + assert not os.path.exists(waveform.cache_path(media_id)) From b4f2befb353e7dce56ca1e2dbd4bb68fd8249bbe Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 12:24:49 -0500 Subject: [PATCH 03/35] feat: audio section, player and trim in the window 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. --- frontend/HASHOUT_LOG.md | 11 ++ frontend/index.html | 1 + frontend/src/engine/audiofmt.ts | 74 +++++++++ frontend/src/engine/store.ts | 3 +- frontend/src/engine/types.ts | 17 +- frontend/src/styles/audio.css | 29 ++++ frontend/src/ui/components/audioplayer.ts | 191 ++++++++++++++++++++++ frontend/src/ui/components/curate.ts | 2 +- frontend/src/ui/components/editor.ts | 97 +---------- frontend/src/ui/components/grid.ts | 4 +- frontend/src/ui/components/importer.ts | 7 +- frontend/src/ui/components/infopanel.ts | 15 +- frontend/src/ui/components/libmanage.ts | 4 +- frontend/src/ui/components/library.ts | 8 +- frontend/src/ui/components/organize.ts | 4 +- frontend/src/ui/components/pages.ts | 2 +- frontend/src/ui/components/sidebar.ts | 1 + frontend/src/ui/components/trim.ts | 119 ++++++++++++++ frontend/src/ui/components/viewer.ts | 36 +++- frontend/src/ui/icons-extra.ts | 4 + frontend/tests/audio.test.ts | 65 ++++++++ 21 files changed, 587 insertions(+), 107 deletions(-) create mode 100644 frontend/src/engine/audiofmt.ts create mode 100644 frontend/src/styles/audio.css create mode 100644 frontend/src/ui/components/audioplayer.ts create mode 100644 frontend/src/ui/components/trim.ts create mode 100644 frontend/tests/audio.test.ts diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 68b0a2d..0c9d171 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,16 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### engine/audiofmt.ts, ui/components/audioplayer.ts, trim.ts · the audio player and the Audio section +- refers-to: audiofmt.ts (new); audioplayer.ts (new) createAudioPlayer; trim.ts (new) openTrim, honorTrim, isTrimming, moved out of editor.ts; viewer.ts showAudio, stopAudio, audioReady; types.ts MediaKind, the audio fields, LibrarySummary.audio, FilterName audio; store.ts LEGACY_SPECS audio, SortOrder duration; sidebar.ts, library.ts, grid.ts, infopanel.ts, organize.ts, pages.ts, importer.ts, libmanage.ts, curate.ts; icons-extra.ts audio, loop, volume, mute; styles/audio.css; tests/audio.test.ts +- kind: feat +- logged: after v1.32.4 · 2026-11-29 + +The viewer shows an audio item as a Glass panel: cover art or the waveform thumb, title, artist and album, the codec line, a waveform canvas to click or drag for seeking, play and pause, loop, mute and a volume slider whose value is kept in the ui preferences. The keys follow the common player keys and stay clear of the viewer's own: Space or K plays and pauses, J and L go back and forward five seconds, Shift+L loops, M mutes, Up and Down change the volume; the arrows still step between items and 0 to 9, X and . still rate, label, reject and favourite. The player plays the original and switches to the engine's /listen copy once if the original fails. A saved trim is honoured as for video, looping inside it when loop is on. + +The trim screen moved to trim.ts so editor.ts stays under the size limit; it uses the same player for audio and offers loudness normalising on Save as New Clip. The pure parts (codec, rate and channel labels, the peak resampling, the seek fraction, volume clamping and the key map) are in engine/audiofmt.ts so the tests reach them without a DOM. + +The tests run under Node 22 as in CI. Under Node 25 the three AMOLED tests fail before and after this change because Node's own localStorage shadows jsdom's; NODE_OPTIONS=--no-experimental-webstorage makes them pass. + ### engine/theme.ts + ui/components/settings.ts · AMOLED Black, one more appearance setting - refers-to: theme.ts ThemePrefs.amoled, loadTheme, applyTheme (data-oled, tint, rgb), mirrorOled, OLED_MIRROR; settings.ts oledCheck, reset handler - kind: feat diff --git a/frontend/index.html b/frontend/index.html index 307de26..c7cf8a5 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -10,6 +10,7 @@ + diff --git a/frontend/src/engine/audiofmt.ts b/frontend/src/engine/audiofmt.ts new file mode 100644 index 0000000..8d0b3b3 --- /dev/null +++ b/frontend/src/engine/audiofmt.ts @@ -0,0 +1,74 @@ +export interface AudioSpec { + audio_codec?: string | null; + sample_rate?: number | null; + channels?: number | null; + bit_depth?: number | null; + bitrate?: number | null; +} + +const CODEC_NAMES: Record = { + mp3: "MP3", aac: "AAC", alac: "ALAC", flac: "FLAC", vorbis: "Vorbis", opus: "Opus", + wmav1: "WMA", wmav2: "WMA", wmapro: "WMA Pro", wmalossless: "WMA Lossless", +}; + +export function codecLabel(codec: string | null | undefined): string { + if (!codec) return ""; + const key = codec.toLowerCase(); + if (key.startsWith("pcm_")) return "PCM"; + return CODEC_NAMES[key] ?? key.toUpperCase(); +} + +export function channelLabel(channels: number | null | undefined): string { + if (!channels) return ""; + if (channels === 1) return "Mono"; + if (channels === 2) return "Stereo"; + return `${channels} channels`; +} + +export function rateLabel(rate: number | null | undefined): string { + if (!rate) return ""; + const khz = rate / 1000; + return `${Number.isInteger(khz) ? khz.toFixed(0) : khz.toFixed(1)} kHz`; +} + +export function audioSpecLine(spec: AudioSpec): string { + const parts = [codecLabel(spec.audio_codec), rateLabel(spec.sample_rate), channelLabel(spec.channels)]; + if (spec.bit_depth) parts.push(`${spec.bit_depth}-bit`); + if (spec.bitrate) parts.push(`${Math.round(spec.bitrate / 1000)} kbps`); + return parts.filter(Boolean).join(" · "); +} + +export function resamplePeaks(peaks: number[], buckets: number): number[] { + if (buckets <= 0 || peaks.length === 0) return []; + const out: number[] = []; + for (let i = 0; i < buckets; i++) { + const lo = Math.floor((i * peaks.length) / buckets); + const hi = Math.max(lo + 1, Math.floor(((i + 1) * peaks.length) / buckets)); + let top = 0; + for (let j = lo; j < hi && j < peaks.length; j++) top = Math.max(top, peaks[j]); + out.push(top); + } + return out; +} + +export function seekFraction(clientX: number, left: number, width: number): number { + if (width <= 0) return 0; + return Math.min(1, Math.max(0, (clientX - left) / width)); +} + +export function clampVolume(value: number): number { + if (!Number.isFinite(value)) return 1; + return Math.min(1, Math.max(0, value)); +} + +export type AudioKeyAction = "toggle" | "back" | "forward" | "loop" | "mute" | "louder" | "quieter" | null; + +export function audioKeyAction(key: string, shiftKey: boolean): AudioKeyAction { + if (key === " " || key === "k" || key === "K") return "toggle"; + if (key === "j" || key === "J") return "back"; + if (key === "l" || key === "L") return shiftKey ? "loop" : "forward"; + if (key === "m" || key === "M") return "mute"; + if (key === "ArrowUp") return "louder"; + if (key === "ArrowDown") return "quieter"; + return null; +} diff --git a/frontend/src/engine/store.ts b/frontend/src/engine/store.ts index 4f1a7c4..b91d6cb 100644 --- a/frontend/src/engine/store.ts +++ b/frontend/src/engine/store.ts @@ -189,7 +189,7 @@ export function clearSelection(): void { } export type SortOrder = - | "newest" | "oldest" | "added" | "added_oldest" | "name" | "name_desc" | "size" | "size_small" | "rating" | "edited" | "viewed"; + | "newest" | "oldest" | "added" | "added_oldest" | "name" | "name_desc" | "size" | "size_small" | "rating" | "edited" | "viewed" | "duration" | "duration_short"; export interface QueryRule { field: string; @@ -213,6 +213,7 @@ const LEGACY_SPECS: Record = { favorites: { rules: [{ field: "flag", value: "favorite" }] }, photos: { rules: [{ field: "flag", value: "photo" }] }, videos: { rules: [{ field: "flag", value: "video" }] }, + audio: { rules: [{ field: "flag", value: "audio" }] }, screenshots: { rules: [{ field: "flag", value: "screenshot" }] }, screenrecs: { rules: [{ field: "flag", value: "screen_recording" }] }, not_in_album: { rules: [{ field: "flag", value: "not_in_album" }] }, diff --git a/frontend/src/engine/types.ts b/frontend/src/engine/types.ts index a6e694e..9aee0b2 100644 --- a/frontend/src/engine/types.ts +++ b/frontend/src/engine/types.ts @@ -1,10 +1,12 @@ +export type MediaKind = "image" | "video" | "audio"; + export interface Media { id: number; sha256: string; rel_path: string; name: string; size: number; - kind: "image" | "video"; + kind: MediaKind; mime: string; width: number | null; height: number | null; @@ -57,6 +59,17 @@ export interface Media { caption?: string | null; alt_text?: string | null; edit_json?: string | null; + audio_codec?: string | null; + sample_rate?: number | null; + channels?: number | null; + bit_depth?: number | null; + bitrate?: number | null; + artist?: string | null; + album_title?: string | null; + genre?: string | null; + track?: string | null; + release_year?: number | null; + has_cover?: number; edited_ts?: number | null; trim_in?: number | null; trim_out?: number | null; @@ -158,6 +171,7 @@ export interface LibrarySummary { total: number; photos: number; videos: number; + audio: number; screenshots: number; screenrecs: number; favorites: number; @@ -174,6 +188,7 @@ export type FilterName = | "favorites" | "photos" | "videos" + | "audio" | "screenshots" | "screenrecs" | "not_in_album" diff --git a/frontend/src/styles/audio.css b/frontend/src/styles/audio.css new file mode 100644 index 0000000..6d6d848 --- /dev/null +++ b/frontend/src/styles/audio.css @@ -0,0 +1,29 @@ +.stage-audio { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--space-4); } +.stage-audio.hidden { display: none; } +.audio-player { + --wave-played: var(--accent); + --wave-ahead: var(--text-faint); + width: min(880px, 100%); display: flex; flex-direction: column; gap: var(--space-3); + padding: var(--space-4); border-radius: 14px; +} +.audio-head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; } +.audio-cover { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; background: var(--glass-bg-2); } +.audio-cover.is-wave { object-fit: contain; } +.audio-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; } +.audio-title { font-size: 17px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.audio-sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.audio-spec { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; } +.wave-track { position: relative; height: 120px; cursor: pointer; border-radius: 8px; touch-action: none; } +.wave-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } +.wave-canvas { width: 100%; height: 100%; display: block; } +.audio-player.no-wave .wave-track { height: 32px; } +.audio-controls { display: flex; align-items: center; gap: var(--space-2); } +.audio-clock { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; } +.audio-volume { width: 110px; accent-color: var(--accent); } +.audio-player .icon-btn.active { color: var(--accent); } +.trim-audio { max-width: 880px; } +@media (max-width: 560px) { + .audio-cover { width: 64px; height: 64px; } + .wave-track { height: 84px; } + .audio-volume { width: 72px; } +} diff --git a/frontend/src/ui/components/audioplayer.ts b/frontend/src/ui/components/audioplayer.ts new file mode 100644 index 0000000..a63f70e --- /dev/null +++ b/frontend/src/ui/components/audioplayer.ts @@ -0,0 +1,191 @@ +import { api, fileUrl, thumbUrl } from "../../engine/api.js"; +import { type AudioKeyAction, audioKeyAction, audioSpecLine, clampVolume, resamplePeaks, seekFraction } from "../../engine/audiofmt.js"; +import { formatDuration } from "../../engine/format.js"; +import { prefGet, prefSet } from "../../engine/prefstore.js"; +import type { Media } from "../../engine/types.js"; +import { h } from "../dom.js"; +import { iconInto, iconEl } from "../icons.js"; + +export interface AudioPlayer { + el: HTMLElement; + audio: HTMLAudioElement; + key: (event: KeyboardEvent) => boolean; + dispose: () => void; +} + +const SEEK_STEP = 5; +const VOLUME_STEP = 0.1; +const BAR_STRIDE = 3; + +function listenUrl(id: number): string { + return `/api/media/${id}/listen`; +} + +function cssColor(el: HTMLElement, name: string, fallback: string): string { + return getComputedStyle(el).getPropertyValue(name).trim() || fallback; +} + +export function createAudioPlayer(item: Media, autoplay = true): AudioPlayer { + const audio = h("audio", { src: fileUrl(item.id), preload: "metadata" }) as HTMLAudioElement; + audio.autoplay = autoplay; + audio.volume = clampVolume(prefGet("audioVolume", 1)); + let fellBack = false; + audio.addEventListener("error", () => { + if (fellBack) return; + fellBack = true; + audio.src = listenUrl(item.id); + if (autoplay) void audio.play().catch(() => undefined); + }); + + const canvas = h("canvas", { class: "wave-canvas", "aria-hidden": "true" }) as HTMLCanvasElement; + const wave = h("div", { class: "wave-track", role: "slider", tabindex: "0", "aria-label": "Seek", "aria-valuemin": "0", "aria-valuemax": "100" }, canvas); + const cover = h("img", { class: "audio-cover", alt: "", src: thumbUrl(item.id, 768), draggable: "false" }); + const title = h("div", { class: "audio-title" }, item.title || item.name); + const sub = h("div", { class: "audio-sub" }, [item.artist, item.album_title].filter(Boolean).join(" · ")); + const spec = h("div", { class: "audio-spec" }, audioSpecLine(item)); + const playBtn = h("button", { class: "icon-btn audio-play", type: "button", "aria-label": "Play (Space)" }, iconEl("play")) as HTMLButtonElement; + const loopBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Loop (Shift+L)", "aria-pressed": "false" }, iconEl("loop")) as HTMLButtonElement; + const muteBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Mute (M)" }, iconEl("volume")) as HTMLButtonElement; + const volume = h("input", { class: "audio-volume", type: "range", min: "0", max: "1", step: "0.01", value: String(audio.volume), "aria-label": "Volume" }) as HTMLInputElement; + const clock = h("span", { class: "audio-clock" }, `0:00 / ${formatDuration(item.duration ?? 0)}`); + const controls = h("div", { class: "audio-controls" }, playBtn, clock, h("span", { class: "head-spacer" }), loopBtn, muteBtn, volume); + const el = h("div", { class: "audio-player glass-panel" }, + h("div", { class: "audio-head" }, cover, h("div", { class: "audio-meta" }, title, sub, spec)), wave, controls); + + let peaks: number[] = []; + let frame = 0; + let alive = true; + + const duration = () => (Number.isFinite(audio.duration) && audio.duration > 0 ? audio.duration : item.duration ?? 0); + + function draw(): void { + frame = 0; + const width = Math.max(1, wave.clientWidth); + const height = Math.max(1, wave.clientHeight); + const ratio = window.devicePixelRatio || 1; + if (canvas.width !== Math.round(width * ratio)) canvas.width = Math.round(width * ratio); + if (canvas.height !== Math.round(height * ratio)) canvas.height = Math.round(height * ratio); + const ctx = canvas.getContext("2d"); + if (!ctx) return; + ctx.setTransform(ratio, 0, 0, ratio, 0, 0); + ctx.clearRect(0, 0, width, height); + const played = duration() ? audio.currentTime / duration() : 0; + const bars = resamplePeaks(peaks.length ? peaks : [0.02], Math.max(1, Math.floor(width / BAR_STRIDE))); + const middle = height / 2; + const ahead = cssColor(el, "--wave-ahead", "rgba(255,255,255,0.35)"); + const behind = cssColor(el, "--wave-played", "rgba(255,255,255,0.92)"); + bars.forEach((value, i) => { + const x = i * BAR_STRIDE; + const span = Math.max(1, value * height * 0.46); + ctx.fillStyle = x / width <= played ? behind : ahead; + ctx.fillRect(x, middle - span, BAR_STRIDE - 1, span * 2); + }); + wave.setAttribute("aria-valuenow", String(Math.round(played * 100))); + const total = formatDuration(duration()); + clock.textContent = `${formatDuration(audio.currentTime)} / ${total}`; + } + + function redraw(): void { + if (!frame && alive) frame = requestAnimationFrame(draw); + } + + function syncButtons(): void { + iconInto(playBtn, audio.paused ? "play" : "pause"); + playBtn.setAttribute("aria-label", audio.paused ? "Play (Space)" : "Pause (Space)"); + loopBtn.classList.toggle("active", audio.loop); + loopBtn.setAttribute("aria-pressed", String(audio.loop)); + iconInto(muteBtn, audio.muted || audio.volume === 0 ? "mute" : "volume"); + } + + function toggle(): void { + if (audio.paused) void audio.play().catch(() => undefined); + else audio.pause(); + } + + function seekTo(seconds: number): void { + const total = duration(); + if (!total) return; + audio.currentTime = Math.min(total, Math.max(0, seconds)); + redraw(); + } + + function setVolume(value: number): void { + audio.volume = clampVolume(value); + audio.muted = false; + volume.value = String(audio.volume); + prefSet("audioVolume", audio.volume); + syncButtons(); + } + + function act(action: AudioKeyAction): boolean { + if (action === null) return false; + if (action === "toggle") toggle(); + if (action === "back") seekTo(audio.currentTime - SEEK_STEP); + if (action === "forward") seekTo(audio.currentTime + SEEK_STEP); + if (action === "loop") audio.loop = !audio.loop; + if (action === "mute") audio.muted = !audio.muted; + if (action === "louder") setVolume(audio.volume + VOLUME_STEP); + if (action === "quieter") setVolume(audio.volume - VOLUME_STEP); + syncButtons(); + return true; + } + + wave.addEventListener("pointerdown", (event) => { + if (event.button !== 0) return; + event.stopPropagation(); + wave.setPointerCapture(event.pointerId); + const jump = (ev: PointerEvent) => { + const rect = wave.getBoundingClientRect(); + seekTo(seekFraction(ev.clientX, rect.left, rect.width) * duration()); + }; + jump(event); + const move = (ev: PointerEvent) => jump(ev); + const up = () => { + wave.removeEventListener("pointermove", move); + wave.removeEventListener("pointerup", up); + }; + wave.addEventListener("pointermove", move); + wave.addEventListener("pointerup", up); + }); + el.addEventListener("click", (event) => event.stopPropagation()); + playBtn.addEventListener("click", toggle); + loopBtn.addEventListener("click", () => act("loop")); + muteBtn.addEventListener("click", () => act("mute")); + volume.addEventListener("input", () => setVolume(Number(volume.value))); + volume.addEventListener("keydown", (event) => event.stopPropagation()); + for (const name of ["play", "pause", "volumechange", "ended"]) audio.addEventListener(name, syncButtons); + for (const name of ["timeupdate", "loadedmetadata", "seeked"]) audio.addEventListener(name, redraw); + const resize = new ResizeObserver(redraw); + resize.observe(wave); + + void api<{ peaks: number[] }>(`/media/${item.id}/waveform?n=1200`).then((res) => { + peaks = res.peaks ?? []; + redraw(); + }).catch(() => { + el.classList.add("no-wave"); + }); + if (!item.has_cover) cover.classList.add("is-wave"); + syncButtons(); + el.append(audio); + + return { + el, + audio, + key: (event) => { + if (event.metaKey || event.ctrlKey || event.altKey) return false; + const target = event.target as HTMLElement | null; + if (target && target.closest("input, textarea, select, [contenteditable=\"true\"]")) return false; + const handled = act(audioKeyAction(event.key, event.shiftKey)); + if (handled) event.preventDefault(); + return handled; + }, + dispose: () => { + alive = false; + if (frame) cancelAnimationFrame(frame); + resize.disconnect(); + audio.pause(); + audio.removeAttribute("src"); + audio.load(); + }, + }; +} diff --git a/frontend/src/ui/components/curate.ts b/frontend/src/ui/components/curate.ts index 63bb059..8e46f1f 100644 --- a/frontend/src/ui/components/curate.ts +++ b/frontend/src/ui/components/curate.ts @@ -330,7 +330,7 @@ export function openSlideshow(ids: number[], opts: { title?: string; subtitle?: if (media instanceof HTMLImageElement) { media.style.setProperty("--kb-x", `${(Math.random() * 6 - 3).toFixed(1)}%`); media.style.setProperty("--kb-y", `${(Math.random() * 6 - 3).toFixed(1)}%`); - media.src = item ? stillUrl(item, 2048) : thumbUrl(id, 768); + media.src = item && item.kind === "image" ? stillUrl(item, 2048) : thumbUrl(id, 768); void media.decode().then(reveal, reveal); } else { reveal(); diff --git a/frontend/src/ui/components/editor.ts b/frontend/src/ui/components/editor.ts index 0850482..0f25249 100644 --- a/frontend/src/ui/components/editor.ts +++ b/frontend/src/ui/components/editor.ts @@ -1,5 +1,4 @@ import { api, thumbUrl, thumbVersions } from "../../engine/api.js"; -import { formatDuration } from "../../engine/format.js"; import { patchMedia, state as store } from "../../engine/store.js"; import type { Media } from "../../engine/types.js"; import type { CtxEntry } from "../contextmenu.js"; @@ -10,6 +9,7 @@ import { promptText } from "../prompt.js"; import { toast } from "../toast.js"; import { tileHooks } from "./grid.js"; import { selectbarExtras } from "./selectbar.js"; +import { honorTrim, isTrimming, openTrim } from "./trim.js"; import { viewerHooks } from "./viewer.js"; type Dict = Record; @@ -110,8 +110,8 @@ export async function copyEdits(id: number): Promise { } export function openEditor(item: Media): void { - if (open) return; - if (item.kind === "video") { + if (open || isTrimming()) return; + if (item.kind === "video" || item.kind === "audio") { openTrim(item); return; } @@ -829,94 +829,10 @@ export function openEditor(item: Media): void { }, { once: true }); } -function openTrim(item: Media): void { - open = true; - const video = h("video", { src: `/api/media/${item.id}/file`, controls: true, playsinline: true, class: "trim-video" }) as HTMLVideoElement; - const inRange = h("input", { type: "range", min: "0", max: "1000", value: "0", class: "ed-range" }) as HTMLInputElement; - const outRange = h("input", { type: "range", min: "0", max: "1000", value: "1000", class: "ed-range" }) as HTMLInputElement; - const inVal = h("span", { class: "ed-val" }, "0:00"); - const outVal = h("span", { class: "ed-val" }, "0:00"); - let duration = item.duration ?? 0; - const t = (r: HTMLInputElement) => (Number(r.value) / 1000) * duration; - const sync = () => { - setText(inVal, formatDuration(t(inRange))); - setText(outVal, formatDuration(t(outRange))); - }; - video.addEventListener("loadedmetadata", () => { - duration = video.duration || duration; - if (item.trim_in) inRange.value = String(Math.round((item.trim_in / duration) * 1000)); - if (item.trim_out) outRange.value = String(Math.round((item.trim_out / duration) * 1000)); - sync(); - }); - for (const [r, isIn] of [[inRange, true], [outRange, false]] as const) { - r.addEventListener("input", () => { - if (Number(inRange.value) >= Number(outRange.value) - 5) r.value = isIn ? String(Number(outRange.value) - 5) : String(Number(inRange.value) + 5); - video.currentTime = t(r); - sync(); - }); - } - const cancel = h("button", { class: "btn", type: "button" }, "Cancel"); - const reset = h("button", { class: "btn", type: "button" }, "Reset Trim"); - const asNew = h("button", { class: "btn", type: "button" }, "Save as New Clip"); - const done = h("button", { class: "btn primary", type: "button" }, "Done"); - const root = h("div", { class: "editor" }, - h("div", { class: "ed-top" }, cancel, h("span", { class: "head-spacer" }), h("span", { class: "ed-title" }, `Trim ${item.name}`), h("span", { class: "head-spacer" }), reset, asNew, done), - h("div", { class: "trim-main" }, video, - h("div", { class: "trim-rows glass-panel" }, h("label", { class: "ed-row" }, h("span", { class: "ed-label" }, "Start"), inVal, inRange), - h("label", { class: "ed-row" }, h("span", { class: "ed-label" }, "End"), outVal, outRange)))); - document.body.append(root); - requestAnimationFrame(() => root.classList.add("open")); - const escape = (event: KeyboardEvent) => { - if (event.key !== "Escape") return; - event.stopPropagation(); - event.preventDefault(); - close(); - }; - window.addEventListener("keydown", escape, true); - const close = () => { - open = false; - window.removeEventListener("keydown", escape, true); - root.classList.remove("open"); - setTimeout(() => root.remove(), 180); - }; - const save = async (): Promise => { - const tin = t(inRange); - const tout = t(outRange); - const body = { trim_in: tin > 0.05 ? tin : null, trim_out: tout < duration - 0.05 ? tout : null }; - await api(`/media/${item.id}/trim`, { method: "POST", body: JSON.stringify(body) }); - patchMedia([item.id], body as Partial); - return Boolean(body.trim_in || body.trim_out); - }; - cancel.addEventListener("click", close); - reset.addEventListener("click", () => { inRange.value = "0"; outRange.value = "1000"; sync(); }); - done.addEventListener("click", async () => { await save(); toast("Trim saved"); close(); }); - asNew.addEventListener("click", async () => { - if (!(await save())) { toast("Move the start or end first"); return; } - try { - await api<{ id: number }>(`/media/${item.id}/trim/export`, { method: "POST" }); - toast("Saved the trimmed clip as a new item"); - close(); - } catch (err) { - toast(String((err as Error).message), "error"); - } - }); -} - -function honorTrim(video: HTMLVideoElement, id: number): void { - const item = store.byId.get(id); - if (!item || (!item.trim_in && !item.trim_out)) return; - video.addEventListener("loadedmetadata", () => { if (item.trim_in) video.currentTime = item.trim_in; }, { once: true }); - video.addEventListener("timeupdate", () => { - if (item.trim_out && video.currentTime >= item.trim_out) { - video.pause(); - video.currentTime = item.trim_in ?? 0; - } - }); -} - function editEntries(item: Media): CtxEntry[] { const ids = store.selection.has(item.id) && store.selection.size > 1 ? [...store.selection] : [item.id]; - const entries: CtxEntry[] = [{ label: item.kind === "video" ? "Trim..." : "Edit...", icon: item.kind === "video" ? "scissors" : "sliders", action: () => openEditor(item) }]; + const timed = item.kind === "video" || item.kind === "audio"; + const entries: CtxEntry[] = [{ label: timed ? "Trim..." : "Edit...", icon: timed ? "scissors" : "sliders", action: () => openEditor(item) }]; if (item.kind === "image") { if (item.edit_json) entries.push({ label: "Copy Edits", icon: "copy", action: () => void copyEdits(item.id) }); if (clipboard) entries.push({ label: "Paste Edits", icon: "copy", action: () => void pasteEdits(ids) }); @@ -940,7 +856,7 @@ export function registerEditor(): void { return btn; }); viewerHooks.keys.push((event, id) => { - if (event.key !== "e" || event.metaKey || event.ctrlKey || open) return false; + if (event.key !== "e" || event.metaKey || event.ctrlKey || open || isTrimming()) return false; const target = event.target as HTMLElement | null; if (target && target.closest("input, textarea, select")) return false; const item = store.byId.get(id); @@ -950,6 +866,7 @@ export function registerEditor(): void { return true; }); viewerHooks.videoReady = honorTrim; + viewerHooks.audioReady = honorTrim; tileHooks.ctx.push(editEntries); selectbarExtras.push({ label: "Paste Edits", icon: "copy", handler: (ids) => { if (clipboard) void pasteEdits(ids); else toast("Copy edits from an edited photo first"); } }); window.addEventListener("keydown", (event) => { diff --git a/frontend/src/ui/components/grid.ts b/frontend/src/ui/components/grid.ts index a029a85..0bd5e32 100644 --- a/frontend/src/ui/components/grid.ts +++ b/frontend/src/ui/components/grid.ts @@ -334,9 +334,10 @@ export function tileFor(item: Media, context: () => number[], selectable = true, const badges = h("div", { class: "tile-badges" }); if (item.favorite) badges.append(h("span", { class: "fav-mark" }, iconEl("heartFill"))); if (item.kind === "video") badges.append(iconEl("video")); + if (item.kind === "audio") badges.append(iconEl("audio")); if (item.kind === "image" && item.live_video_id) badges.append(h("span", { class: "live-chip" }, "LIVE")); const parts: HTMLElement[] = [img, badges]; - if (item.kind === "video" && item.duration) { + if ((item.kind === "video" || item.kind === "audio") && item.duration) { parts.push(h("span", { class: "tile-duration" }, formatDuration(item.duration))); } const tile = h("div", { class: "tile", "data-id": String(item.id) }, ...parts); @@ -357,6 +358,7 @@ export function tileFor(item: Media, context: () => number[], selectable = true, { label: "Move to Trash", icon: "trash", danger: true, action: () => void trashMedia(item.id) }, ]); }); + if (item.kind === "audio") tile.append(h("span", { class: "kind-mark", title: "Audio" }, iconEl("audio"))); if (item.kind === "video") { tile.append(h("span", { class: "kind-mark", title: "Video" }, iconEl("video"))); let preview: HTMLVideoElement | null = null; diff --git a/frontend/src/ui/components/importer.ts b/frontend/src/ui/components/importer.ts index 64f2424..b173e27 100644 --- a/frontend/src/ui/components/importer.ts +++ b/frontend/src/ui/components/importer.ts @@ -125,13 +125,14 @@ export function mountImportPage(host: HTMLElement): () => void { "dng", "mov", "mp4", "m4v", "webm", "mkv", "3gp", "avi", "avif", "mts", "cr2", "cr3", "crw", "nef", "nrw", "arw", "srf", "sr2", "raf", "orf", "rw2", "rwl", "pef", "srw", "x3f", "3fr", "iiq", "erf", "kdc", "dcr", "mos", "mrw", + "mp3", "m4a", "aac", "wav", "aiff", "aif", "flac", "ogg", "oga", "opus", "caf", "wma", ]); function mediaFiles(list: FileList | null): globalThis.File[] { if (!list) return []; return [...list].filter((file) => { const ext = file.name.split(".").pop()?.toLowerCase() ?? ""; - return file.type.startsWith("image/") || file.type.startsWith("video/") || MEDIA_DROP.has(ext); + return file.type.startsWith("image/") || file.type.startsWith("video/") || file.type.startsWith("audio/") || MEDIA_DROP.has(ext); }); } @@ -287,9 +288,9 @@ export function mountImportPage(host: HTMLElement): () => void { browseGrid.replaceChildren(...browseFiles.map((file) => { const tile = h("button", { class: "ptile", type: "button", "data-key": String(file.key), title: file.name }, h("img", { alt: file.name, draggable: "false" }), - h("span", { class: "ptile-ph" }, iconEl(file.kind === "video" ? "video" : "image")), + h("span", { class: "ptile-ph" }, iconEl(file.kind === "video" ? "video" : file.kind === "audio" ? "audio" : "image")), h("span", { class: "sel-dot" }, iconEl("check"))) as HTMLButtonElement; - if (file.kind === "video" && file.duration) tile.append(h("span", { class: "ptile-dur" }, formatDuration(file.duration))); + if ((file.kind === "video" || file.kind === "audio") && file.duration) tile.append(h("span", { class: "ptile-dur" }, formatDuration(file.duration))); tile.addEventListener("click", () => { if (phoneImporting) return; if (selectedKeys.has(file.key)) { diff --git a/frontend/src/ui/components/infopanel.ts b/frontend/src/ui/components/infopanel.ts index 954e5c4..fec7078 100644 --- a/frontend/src/ui/components/infopanel.ts +++ b/frontend/src/ui/components/infopanel.ts @@ -1,4 +1,5 @@ import { api } from "../../engine/api.js"; +import { audioSpecLine } from "../../engine/audiofmt.js"; import { formatDuration, fullStamp, humanBytes } from "../../engine/format.js"; import { closeViewer, keywordState, loadKeywords, navigate, on, patched, saveMeta, state } from "../../engine/store.js"; import type { LookupResult, MediaDetails } from "../../engine/types.js"; @@ -45,6 +46,7 @@ function exposureLine(d: MediaDetails): string { function typeLine(d: MediaDetails): string { const flags: string[] = []; if (d.kind === "video") flags.push("Video"); + else if (d.kind === "audio") flags.push("Audio"); else if (d.live_video_id) flags.push("Live Photo"); else flags.push("Photo"); if (d.is_raw) flags.push("RAW"); @@ -153,6 +155,10 @@ export function createInfoPanel(onLocationEdit?: (id: number) => void, onDateEdi const rDims = row("Dimensions"); const rSize = row("Size"); const rDuration = row("Duration"); + const rArtist = row("Artist"); + const rAlbum = row("Album"); + const rGenre = row("Genre"); + const rAudio = row("Audio"); const rImported = row("Imported"); const exifTable = h("div", { class: "exif-table" }); const exifToggle = h("button", { class: "link-btn", type: "button" }, "Show all metadata") as HTMLButtonElement; @@ -195,7 +201,7 @@ export function createInfoPanel(onLocationEdit?: (id: number) => void, onDateEdi section("Subjects", subjectList), ocrSection, rCaptured.wrap, rPlace.wrap, rCamera.wrap, rLens.wrap, rExposure.wrap, - rType.wrap, rFile.wrap, rDims.wrap, rSize.wrap, rDuration.wrap, rImported.wrap, + rType.wrap, rFile.wrap, rDims.wrap, rSize.wrap, rDuration.wrap, rArtist.wrap, rAlbum.wrap, rGenre.wrap, rAudio.wrap, rImported.wrap, section("Albums", albumList), section("Accessibility", altIn), exifToggle, exifTable, @@ -259,6 +265,13 @@ export function createInfoPanel(onLocationEdit?: (id: number) => void, onDateEdi setText(rSize.value, humanBytes(d.size)); setText(rDuration.value, d.duration ? formatDuration(d.duration) : ""); rDuration.wrap.classList.toggle("hidden", !d.duration); + const albumLine = [d.album_title, d.track ? `track ${d.track}` : "", d.release_year ? String(d.release_year) : ""].filter(Boolean).join(" · "); + const audioLine = d.kind === "audio" ? audioSpecLine(d) : ""; + for (const [r, v] of [[rArtist, d.artist ?? ""], [rAlbum, albumLine], [rGenre, d.genre ?? ""], [rAudio, audioLine]] as const) { + setText(r.value, v); + r.wrap.classList.toggle("hidden", !v); + } + rDims.wrap.classList.toggle("hidden", d.kind === "audio"); setText(rImported.value, `${fullStamp(d.imported_ts)}${d.batch ? ` · ${d.batch.label ?? d.batch.source}` : ""}`); const exifRows = Object.entries(d.exif ?? {}).sort(([a], [b]) => a.localeCompare(b)); patchList(exifTable, exifRows, ([k]) => k, ([k, v]) => diff --git a/frontend/src/ui/components/libmanage.ts b/frontend/src/ui/components/libmanage.ts index 663f5d8..01ffba6 100644 --- a/frontend/src/ui/components/libmanage.ts +++ b/frontend/src/ui/components/libmanage.ts @@ -263,8 +263,8 @@ export function mountDiskPage(host: HTMLElement, startPath: string): () => void function quickLook(f: DiskFile): void { const modal = openModal(f.name, 900); const src = `/api/disk/file?path=${encodeURIComponent(f.path)}`; - const media = f.kind === "video" - ? h("video", { src, controls: true, autoplay: true, class: "quicklook" }) + const media = f.kind === "video" || f.kind === "audio" + ? h(f.kind, { src, controls: true, autoplay: true, class: "quicklook" }) : h("img", { src, alt: f.name, class: "quicklook" }); modal.body.append(media, h("div", { class: "field-hint" }, `${humanBytes(f.size)} · ${f.path}`)); } diff --git a/frontend/src/ui/components/library.ts b/frontend/src/ui/components/library.ts index 5fd9d89..39f9643 100644 --- a/frontend/src/ui/components/library.ts +++ b/frontend/src/ui/components/library.ts @@ -14,6 +14,7 @@ const FILTER_LABELS: Record = { favorites: "Favorites", photos: "Photos", videos: "Videos", + audio: "Audio", screenshots: "Screenshots", screenrecs: "Screen Recordings", not_in_album: "Not in an Album", @@ -62,15 +63,17 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo { label: "Recently viewed", icon: "eye", selected: state.sort === "viewed", action: () => setSort("viewed") }, { label: "Highest rated", icon: "star", selected: state.sort === "rating", action: () => setSort("rating") }, { label: "Recently edited", icon: "wand", selected: state.sort === "edited", action: () => setSort("edited") }, + { label: "Longest first", icon: "clock", selected: state.sort === "duration", action: () => setSort("duration") }, + { label: "Shortest first", icon: "clock", selected: state.sort === "duration_short", action: () => setSort("duration_short") }, ]); }); const filterBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Filter" }, iconEl("sliders")); const menu = h("div", { class: "menu pop-surface hidden" }); const menuAnchor = h("div", { class: "menu-anchor" }, filterBtn, menu); - const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "screenshots", "not_in_album"]; + const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "screenshots", "not_in_album"]; const FILTER_ICONS: Partial> = { - all: "library", favorites: "heart", photos: "image", videos: "video", + all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", screenshots: "screenshot", not_in_album: "albumOff", }; for (const key of filterKeys) { @@ -145,6 +148,7 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo favorites: state.summary.favorites, photos: state.summary.photos, videos: state.summary.videos, + audio: state.summary.audio, screenshots: state.summary.screenshots, screenrecs: state.summary.screenrecs, recently_viewed: state.summary.recently_viewed, diff --git a/frontend/src/ui/components/organize.ts b/frontend/src/ui/components/organize.ts index f1a5b58..344f91a 100644 --- a/frontend/src/ui/components/organize.ts +++ b/frontend/src/ui/components/organize.ts @@ -338,7 +338,7 @@ const RULE_FIELDS: Array<[string, string]> = [ ["text", "Text in photo"], ["subject", "Subject"], ["visual", "Looks like"], ["iso", "ISO"], ["aperture", "Aperture"], ["focal", "Focal length"], ]; const FLAG_VALUES: Array<[string, string]> = [ - ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["raw", "RAW"], ["live", "Live Photo"], + ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["raw", "RAW"], ["live", "Live Photo"], ["panorama", "Panorama"], ["selfie", "Selfie"], ["portrait", "Portrait"], ["slomo", "Slo-mo"], ["burst", "Burst"], ["screenshot", "Screenshot"], ["screen_recording", "Screen Recording"], ["edited", "Edited"], ["rejected", "Rejected"], ["located", "Has location"], ["not_located", "No location"], ["not_in_album", "Not in an album"], @@ -532,7 +532,7 @@ export async function moveAlbumFlow(albumId: number): Promise { export function openQuickFilters(anchor: HTMLElement): void { const rect = anchor.getBoundingClientRect(); const flags: Array<[string, string]> = [ - ["favorite", "Favorites"], ["photo", "Photos"], ["video", "Videos"], ["edited", "Edited"], ["raw", "RAW"], + ["favorite", "Favorites"], ["photo", "Photos"], ["video", "Videos"], ["audio", "Audio"], ["edited", "Edited"], ["raw", "RAW"], ["not_rejected", "Hide rejected"], ["located", "With location"], ["has_keywords", "With keywords"], ["not_in_album", "Not in an album"], ]; const libs = ["personal_library", "shared_library"]; diff --git a/frontend/src/ui/components/pages.ts b/frontend/src/ui/components/pages.ts index 521d025..1992d7e 100644 --- a/frontend/src/ui/components/pages.ts +++ b/frontend/src/ui/components/pages.ts @@ -72,7 +72,7 @@ interface MediaType { } const TYPE_ICONS: Record = { - video: "video", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", + video: "video", audio: "audio", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", burst: "stack", raw: "file", screenshot: "screenshot", screen_recording: "stage", timelapse: "clock", cinematic: "video", spatial: "cube", long_exposure: "wave", animated: "play", }; diff --git a/frontend/src/ui/components/sidebar.ts b/frontend/src/ui/components/sidebar.ts index f286415..3d3791c 100644 --- a/frontend/src/ui/components/sidebar.ts +++ b/frontend/src/ui/components/sidebar.ts @@ -19,6 +19,7 @@ const PINNED: RowSpec[] = [ { label: "Favorites", icon: "heart", hash: "#/f/favorites" }, { label: "Recently Saved", icon: "save", hash: "#/f/recently_saved" }, { label: "Videos", icon: "video", hash: "#/f/videos" }, + { label: "Audio", icon: "audio", hash: "#/f/audio" }, { label: "Screenshots", icon: "screenshot", hash: "#/f/screenshots" }, { label: "People", icon: "people", hash: "#/people" }, { label: "Memories", icon: "memory", hash: "#/memories" }, diff --git a/frontend/src/ui/components/trim.ts b/frontend/src/ui/components/trim.ts new file mode 100644 index 0000000..dc14bea --- /dev/null +++ b/frontend/src/ui/components/trim.ts @@ -0,0 +1,119 @@ +import { api, fileUrl } from "../../engine/api.js"; +import { formatDuration } from "../../engine/format.js"; +import { patchMedia, state as store } from "../../engine/store.js"; +import type { Media } from "../../engine/types.js"; +import { h } from "../dom.js"; +import { setText } from "../keyed.js"; +import { toast } from "../toast.js"; +import { createAudioPlayer } from "./audioplayer.js"; + +let trimming = false; + +export function isTrimming(): boolean { + return trimming; +} + +function trimSurface(item: Media): { el: HTMLElement; media: HTMLMediaElement; dispose: () => void } { + if (item.kind === "audio") { + const player = createAudioPlayer(item, false); + player.el.classList.add("trim-audio"); + return { el: player.el, media: player.audio, dispose: player.dispose }; + } + const video = h("video", { src: fileUrl(item.id), controls: true, playsinline: true, class: "trim-video" }) as HTMLVideoElement; + return { el: video, media: video, dispose: () => video.pause() }; +} + +export function openTrim(item: Media): void { + trimming = true; + const surface = trimSurface(item); + const media = surface.media; + const inRange = h("input", { type: "range", min: "0", max: "1000", value: "0", class: "ed-range" }) as HTMLInputElement; + const outRange = h("input", { type: "range", min: "0", max: "1000", value: "1000", class: "ed-range" }) as HTMLInputElement; + const inVal = h("span", { class: "ed-val" }, "0:00"); + const outVal = h("span", { class: "ed-val" }, "0:00"); + let duration = item.duration ?? 0; + const t = (r: HTMLInputElement) => (Number(r.value) / 1000) * duration; + const sync = () => { + setText(inVal, formatDuration(t(inRange))); + setText(outVal, formatDuration(t(outRange))); + }; + media.addEventListener("loadedmetadata", () => { + duration = media.duration || duration; + if (item.trim_in) inRange.value = String(Math.round((item.trim_in / duration) * 1000)); + if (item.trim_out) outRange.value = String(Math.round((item.trim_out / duration) * 1000)); + sync(); + }); + for (const [r, isIn] of [[inRange, true], [outRange, false]] as const) { + r.addEventListener("input", () => { + if (Number(inRange.value) >= Number(outRange.value) - 5) r.value = isIn ? String(Number(outRange.value) - 5) : String(Number(inRange.value) + 5); + media.currentTime = t(r); + sync(); + }); + } + const loud = h("input", { type: "checkbox" }) as HTMLInputElement; + const loudRow = h("label", { class: "field-check" }, loud, "Normalise loudness in the new clip"); + const cancel = h("button", { class: "btn", type: "button" }, "Cancel"); + const reset = h("button", { class: "btn", type: "button" }, "Reset Trim"); + const asNew = h("button", { class: "btn", type: "button" }, "Save as New Clip"); + const done = h("button", { class: "btn primary", type: "button" }, "Done"); + const rows = h("div", { class: "trim-rows glass-panel" }, h("label", { class: "ed-row" }, h("span", { class: "ed-label" }, "Start"), inVal, inRange), + h("label", { class: "ed-row" }, h("span", { class: "ed-label" }, "End"), outVal, outRange)); + if (item.kind === "audio") rows.append(loudRow); + const root = h("div", { class: "editor" }, + h("div", { class: "ed-top" }, cancel, h("span", { class: "head-spacer" }), h("span", { class: "ed-title" }, `Trim ${item.name}`), h("span", { class: "head-spacer" }), reset, asNew, done), + h("div", { class: "trim-main" }, surface.el, rows)); + document.body.append(root); + requestAnimationFrame(() => root.classList.add("open")); + const escape = (event: KeyboardEvent) => { + if (event.key !== "Escape") return; + event.stopPropagation(); + event.preventDefault(); + close(); + }; + window.addEventListener("keydown", escape, true); + const close = () => { + trimming = false; + surface.dispose(); + window.removeEventListener("keydown", escape, true); + root.classList.remove("open"); + setTimeout(() => root.remove(), 180); + }; + const save = async (): Promise => { + const tin = t(inRange); + const tout = t(outRange); + const body = { trim_in: tin > 0.05 ? tin : null, trim_out: tout < duration - 0.05 ? tout : null }; + await api(`/media/${item.id}/trim`, { method: "POST", body: JSON.stringify(body) }); + patchMedia([item.id], body as Partial); + return Boolean(body.trim_in || body.trim_out); + }; + cancel.addEventListener("click", close); + reset.addEventListener("click", () => { inRange.value = "0"; outRange.value = "1000"; sync(); }); + done.addEventListener("click", async () => { await save(); toast("Trim saved"); close(); }); + asNew.addEventListener("click", async () => { + if (!(await save())) { toast("Move the start or end first"); return; } + try { + const query = item.kind === "audio" && loud.checked ? "?normalise=true" : ""; + await api<{ id: number }>(`/media/${item.id}/trim/export${query}`, { method: "POST" }); + toast("Saved the trimmed clip as a new item"); + close(); + } catch (err) { + toast(String((err as Error).message), "error"); + } + }); +} + +export function honorTrim(media: HTMLMediaElement, id: number): void { + const item = store.byId.get(id); + if (!item || (!item.trim_in && !item.trim_out)) return; + media.addEventListener("loadedmetadata", () => { if (item.trim_in) media.currentTime = item.trim_in; }, { once: true }); + media.addEventListener("timeupdate", () => { + if (item.trim_out && media.currentTime >= item.trim_out) { + if (media.loop) { + media.currentTime = item.trim_in ?? 0; + return; + } + media.pause(); + media.currentTime = item.trim_in ?? 0; + } + }); +} diff --git a/frontend/src/ui/components/viewer.ts b/frontend/src/ui/components/viewer.ts index 775e547..5718ac0 100644 --- a/frontend/src/ui/components/viewer.ts +++ b/frontend/src/ui/components/viewer.ts @@ -1,7 +1,9 @@ import { api, fileUrl, stillUrl, thumbUrl } from "../../engine/api.js"; import { countFmt, timeLabel, dayLabel } from "../../engine/format.js"; import { closeViewer, dropFromCaches, markViewed, on, patched, saveMeta, setFavorite, state, stepViewer, trashMedia } from "../../engine/store.js"; +import { createAudioPlayer, type AudioPlayer } from "./audioplayer.js"; import { createInfoPanel, type InfoPanel } from "./infopanel.js"; +import type { Media } from "../../engine/types.js"; import { h } from "../dom.js"; import { iconEl, iconInto } from "../icons.js"; import { toast } from "../toast.js"; @@ -32,6 +34,7 @@ export const viewerHooks: { refreshInfo?: () => void; reloadStill?: () => void; videoReady?: (video: HTMLVideoElement, id: number) => void; + audioReady?: (audio: HTMLAudioElement, id: number) => void; toolbar: Array<(id: () => number | null) => HTMLElement>; keys: Array<(event: KeyboardEvent, id: number) => boolean>; } = { toolbar: [], keys: [] }; @@ -183,6 +186,8 @@ export function mountViewer(host: HTMLElement): void { let imgB: HTMLImageElement; let videoHolder: HTMLElement; let liveHolder: HTMLElement; + let audioHolder: HTMLElement; + let player: AudioPlayer | null = null; let liveBtn: HTMLButtonElement; let stripSlot: HTMLElement; let infoPanel: HTMLElement; @@ -232,7 +237,8 @@ export function mountViewer(host: HTMLElement): void { imgB = h("img", { class: "stage-img", alt: "" }) as HTMLImageElement; videoHolder = h("div", { class: "stage-video hidden" }); liveHolder = h("div", { class: "stage-video stage-live hidden" }); - zoomLayer = h("div", { class: "zoom-layer" }, imgA, imgB, videoHolder, liveHolder); + audioHolder = h("div", { class: "stage-audio hidden" }); + zoomLayer = h("div", { class: "zoom-layer" }, imgA, imgB, videoHolder, liveHolder, audioHolder); zoomBox = h("div", { class: "zoom-box hidden" }); const media = h("div", { class: "stage-media" }, zoomLayer, zoomBox); const stage = h("div", { class: "viewer-stage" }, media); @@ -240,7 +246,7 @@ export function mountViewer(host: HTMLElement): void { media.addEventListener("pointerdown", (event) => { if (event.button !== 0) return; const item = state.byId.get(currentId() ?? -1); - if (!item || item.kind === "video") return; + if (!item || item.kind !== "image") return; if (zScale === 1 && !(event.target as HTMLElement).classList.contains("stage-img")) return; const rect = media.getBoundingClientRect(); const startX = event.clientX; @@ -417,8 +423,30 @@ export function mountViewer(host: HTMLElement): void { liveBtn.classList.add("playing"); } + function stopAudio(): void { + player?.dispose(); + player = null; + audioHolder.classList.add("hidden"); + audioHolder.replaceChildren(); + } + + function showAudio(item: Media): void { + mediaSeq++; + imgA.classList.remove("active"); + imgB.classList.remove("active"); + videoHolder.classList.add("hidden"); + videoHolder.replaceChildren(); + stopLive(); + stopAudio(); + player = createAudioPlayer(item); + audioHolder.replaceChildren(player.el); + audioHolder.classList.remove("hidden"); + viewerHooks.audioReady?.(player.audio, item.id); + } + function showImage(id: number, name: string): void { const seq = ++mediaSeq; + stopAudio(); videoHolder.classList.add("hidden"); videoHolder.replaceChildren(); stopLive(); @@ -447,6 +475,7 @@ export function mountViewer(host: HTMLElement): void { imgA.classList.remove("active"); imgB.classList.remove("active"); stopLive(); + stopAudio(); videoHolder.classList.remove("hidden"); const video = h("video", { src: fileUrl(id), controls: true, autoplay: true, playsinline: true }) as HTMLVideoElement; videoHolder.replaceChildren(video); @@ -461,6 +490,7 @@ export function mountViewer(host: HTMLElement): void { resetZoom(false); if (item.kind === "video") showVideo(id); + else if (item.kind === "audio") showAudio(item); else showImage(id, item.name); liveBtn.classList.toggle("hidden", !(item.kind === "image" && item.live_video_id)); @@ -496,6 +526,7 @@ export function mountViewer(host: HTMLElement): void { const id = currentId(); if (id === null) { if (root) { + stopAudio(); root.classList.remove("open"); const dead = root; setTimeout(() => dead.remove(), 170); @@ -523,6 +554,7 @@ export function mountViewer(host: HTMLElement): void { if (!state.viewer) return; const shown = currentId(); if (shown !== null && viewerHooks.keys.some((fn) => fn(event, shown))) return; + if (player && player.key(event)) return; if (event.key === "Escape") closeViewer(); if (event.key === "ArrowLeft") stepViewer(-1); if (event.key === "ArrowRight") stepViewer(1); diff --git a/frontend/src/ui/icons-extra.ts b/frontend/src/ui/icons-extra.ts index 36d96c5..4945a41 100644 --- a/frontend/src/ui/icons-extra.ts +++ b/frontend/src/ui/icons-extra.ts @@ -1,4 +1,8 @@ export const EXTRA_GLYPHS = { + audio: '', + loop: '', + volume: '', + mute: '', tag: '', flag: '', stack: '', diff --git a/frontend/tests/audio.test.ts b/frontend/tests/audio.test.ts new file mode 100644 index 0000000..4bc2c2e --- /dev/null +++ b/frontend/tests/audio.test.ts @@ -0,0 +1,65 @@ +import { describe, expect, it } from "vitest"; +import { audioKeyAction, audioSpecLine, channelLabel, clampVolume, codecLabel, rateLabel, resamplePeaks, seekFraction } from "../src/engine/audiofmt.js"; +import type { LibrarySummary, Media, MediaKind } from "../src/engine/types.js"; + +describe("audio formatting", () => { + it("names codecs, rates and channels", () => { + expect(codecLabel("pcm_s24le")).toBe("PCM"); + expect(codecLabel("flac")).toBe("FLAC"); + expect(codecLabel("wmav2")).toBe("WMA"); + expect(codecLabel("")).toBe(""); + expect(rateLabel(44100)).toBe("44.1 kHz"); + expect(rateLabel(48000)).toBe("48 kHz"); + expect(channelLabel(1)).toBe("Mono"); + expect(channelLabel(2)).toBe("Stereo"); + expect(channelLabel(6)).toBe("6 channels"); + }); + + it("joins only the known parts of a spec", () => { + expect(audioSpecLine({ audio_codec: "mp3", sample_rate: 44100, channels: 2, bitrate: 192000 })).toBe("MP3 · 44.1 kHz · Stereo · 192 kbps"); + expect(audioSpecLine({ audio_codec: "pcm_s16le", sample_rate: 8000, channels: 1, bit_depth: 16 })).toBe("PCM · 8 kHz · Mono · 16-bit"); + expect(audioSpecLine({})).toBe(""); + }); +}); + +describe("waveform and transport", () => { + it("max-pools peaks to the bar count", () => { + expect(resamplePeaks([0.1, 0.9, 0.2, 0.4], 2)).toEqual([0.9, 0.4]); + expect(resamplePeaks([0.5], 3)).toEqual([0.5, 0.5, 0.5]); + expect(resamplePeaks([], 4)).toEqual([]); + expect(resamplePeaks([0.3, 0.7], 0)).toEqual([]); + }); + + it("clamps seek fractions and volume", () => { + expect(seekFraction(150, 100, 200)).toBe(0.25); + expect(seekFraction(50, 100, 200)).toBe(0); + expect(seekFraction(400, 100, 200)).toBe(1); + expect(seekFraction(10, 0, 0)).toBe(0); + expect(clampVolume(1.4)).toBe(1); + expect(clampVolume(-0.2)).toBe(0); + expect(clampVolume(Number.NaN)).toBe(1); + }); + + it("maps the player keys", () => { + expect(audioKeyAction(" ", false)).toBe("toggle"); + expect(audioKeyAction("k", false)).toBe("toggle"); + expect(audioKeyAction("j", false)).toBe("back"); + expect(audioKeyAction("l", false)).toBe("forward"); + expect(audioKeyAction("L", true)).toBe("loop"); + expect(audioKeyAction("m", false)).toBe("mute"); + expect(audioKeyAction("ArrowUp", false)).toBe("louder"); + expect(audioKeyAction("ArrowDown", false)).toBe("quieter"); + expect(audioKeyAction("ArrowLeft", false)).toBeNull(); + expect(audioKeyAction("3", false)).toBeNull(); + }); +}); + +describe("audio types", () => { + it("accepts audio as a media kind with its counts", () => { + const kind: MediaKind = "audio"; + const item: Pick = { kind, artist: "Field", sample_rate: 48000 }; + const summary: Pick = { audio: 2, videos: 1 }; + expect(item.kind).toBe("audio"); + expect(summary.audio).toBe(2); + }); +}); From 75a8d6eb30f81dce39cbfcbc843d73731f882cc2 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 12:24:49 -0500 Subject: [PATCH 04/35] docs: note audio formats and what ffmpeg adds for audio --- LICENSES.md | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSES.md b/LICENSES.md index 05533cd..b4c8d3d 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -83,7 +83,7 @@ The Linux bundles also carry the build machine's WebKitGTK, GTK and GLib (LGPL-2 | Component | License | Decision | | --- | --- | --- | -| ffmpeg / ffprobe 7.1.5 | LGPL-2.1-or-later for the downloaded build; an installed one keeps its own licence | called as subprocess on PATH; never copied into the bundle, keeping the .app proprietary-safe & the binary user-replaceable. When none is installed, the engine downloads the LGPL build (`--disable-gpl --disable-nonfree`; libopus and libvpx BSD-3-Clause) from the nodemode-dev/formai-binaries release on first run (builds made before the repository was renamed use the older name, nodemode-dev/formcut-binaries, which keeps working), checks every file's SHA-256 against `backend/app/ffmpeg_record.py`, and puts it first on PATH; its source is attached to that release | +| ffmpeg / ffprobe 7.1.5 | LGPL-2.1-or-later for the downloaded build; an installed one keeps its own licence | called as subprocess on PATH (video and audio probing, posters, waveforms, cover art, trims and loudness normalising); never copied into the bundle, keeping the .app proprietary-safe & the binary user-replaceable. When none is installed, the engine downloads the LGPL build (`--disable-gpl --disable-nonfree`; libopus and libvpx BSD-3-Clause) from the nodemode-dev/formai-binaries release on first run (builds made before the repository was renamed use the older name, nodemode-dev/formcut-binaries, which keeps working), checks every file's SHA-256 against `backend/app/ffmpeg_record.py`, and puts it first on PATH; its source is attached to that release | | tesseract | Apache-2.0 | OCR for text search; same tier & reasoning as ffmpeg. brew install tesseract | | pymobiledevice3 (<8) | GPL-3.0-or-later | REMOVED from the bundle at zip v1.15.0: it had been collected into the frozen engine since v0.11.0 w/o a ledger row, & GPL is banned in anything we distribute. The AFC code path remains as an optional dev fallback that only activates if the user pip-installs the package themselves (never bundled); the native ImageCaptureCore path replaces it | diff --git a/README.md b/README.md index c18477b..5be62f6 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ The viewer open on a Venice waterfront photo with the info panel showing rating, labels, keywords, location and camera data
The viewer with its info panel.

Look closely, organize fast

- Full-size photos and video with ratings, colour labels, keywords, location and exposure beside them. Everything works from the keyboard. + Full-size photos, video and audio with ratings, colour labels, keywords, location and exposure beside them. Everything works from the keyboard. The editor with the Adjust tab: lens corrections, light, colour, black and white and detail sliders beside a Venice photo @@ -98,7 +98,7 @@

Formats

- Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, 23 camera RAW extensions, video via ffmpeg · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP + Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, 23 camera RAW extensions, video via ffmpeg, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP @@ -124,7 +124,7 @@ All FormDAM builds are compiled and released from [FormCompiler](https://github. Prefer it in your browser, or want to contribute? Run the web UI straight from this repo. -**Requires:** Python 3.10+, Node 20.19 or 22.12+. `ffmpeg` on PATH is optional and adds video thumbnails and video scanning. The desktop app, when no ffmpeg is installed, downloads its own LGPL build on first run, from the `formai-binaries` release first and the older `formcut-binaries` address second, and installs nothing that does not match the recorded SHA-256; a source run does not download it unless `FORM_FFMPEG_AUTO=1` is set. +**Requires:** Python 3.10+, Node 20.19 or 22.12+. `ffmpeg` on PATH is optional and adds video thumbnails, video scanning, audio tags, cover art, waveforms for formats other than WAV, and playback of audio formats the window cannot play itself. The desktop app, when no ffmpeg is installed, downloads its own LGPL build on first run, from the `formai-binaries` release first and the older `formcut-binaries` address second, and installs nothing that does not match the recorded SHA-256; a source run does not download it unless `FORM_FFMPEG_AUTO=1` is set. ```sh git clone git@github.com:nodemode-dev/formDAM.git From 735b3474458770c76b818f8504ed30527e55233e Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 12:34:07 -0500 Subject: [PATCH 05/35] fix: audio shares redraw the cover and late caches of protected items 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. --- backend/HASHOUT_LOG.md | 11 ++- backend/app/routers/audio.py | 2 + backend/app/services/gallerysvc.py | 48 +++++++++---- backend/app/services/packagesvc.py | 14 +++- backend/app/services/thumbs.py | 5 +- backend/app/services/waveform.py | 15 ++++ backend/tests/test_audio_privacy.py | 103 ++++++++++++++++++++++++++++ 7 files changed, 178 insertions(+), 20 deletions(-) create mode 100644 backend/tests/test_audio_privacy.py diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index f1a3e78..d810a67 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -19,10 +19,19 @@ The grid thumb is the embedded cover art when there is one, scaled to the bucket Trim and trim export take audio as they take video. Export with normalise=true re-encodes the trimmed range through loudnorm (I -16, TP -1.5, LRA 11) at the source sample rate, into the same format when the ffmpeg in use has the encoder, else into FLAC: the LGPL ffmpeg the app downloads has no MP3 or Vorbis encoder. It is refused for video, which keeps its stream copy. -Sharing, packages and export strip all metadata from audio (ffmpeg -map_metadata -1, keeping the cover art stream) whenever location is left out or no metadata is asked for, as they do for video. The database's empty lat is not taken as proof that the file carries no place: a recorder can write one the engine never read. The reader also takes the location tags (location, location-eng, com.apple.quicktime.location.ISO6709 and the QuickTime xyz atom) into lat, lon and alt, so the catalog shows and hides an audio item's place like a video's. +Sharing, packages and export strip all metadata from audio (ffmpeg -map_metadata -1) whenever location is left out or no metadata is asked for, as they do for video. The database's empty lat is not taken as proof that the file carries no place: a recorder can write one the engine never read. The reader also takes the location tags (location, location-eng, com.apple.quicktime.location.ISO6709 and the QuickTime xyz atom) into lat, lon and alt, so the catalog shows and hides an audio item's place like a video's. The listen copy and the waveform cache are plain files. When an item becomes protected (hidden, trashed or in a private album) the vault's settle step deletes both before anything else, with or without a vault set up; sealing and deleting scrub the listen folder with the other caches, and the start-up sweep of vaulted items covers it. A protected item's listen copy is streamed from ffmpeg and never written. +### services/packagesvc.py, gallerysvc.py, waveform.py, routers/audio.py · the cover and late caches leak nothing +- refers-to: packagesvc._strip_audio, audio_clean_streams; gallerysvc._timed_variants, _cut_timed, download_path; waveform.keep_if_plain, cached; thumbs.ensure_thumb (audio branch); routers/audio.media_listen; tests/test_audio_privacy.py +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +-map_metadata -1 with -c copy left the embedded cover picture byte for byte, and a JPEG cover keeps its own EXIF, GPS included. When location is left out the cover is now re-encoded to PNG (a decode and encode keeps no EXIF) with the attached_pic disposition; a container that cannot hold a PNG picture (WAV, some Ogg muxers) fails that run and the copy is made again with the sound only. For a trimmed share the picture comes from a second, unseeked input of the same file, since an input seek drops the single cover frame. + +An item could become hidden, trashed or private while its listen copy or waveform was being written, after the vault's settle step had already deleted the caches, so the new file outlived the protection. Every writer now re-reads the row after os.replace and deletes its file when the item is protected or vaulted. The flag is written before settle runs, so either settle sees the file or the writer sees the flag. A listen request that loses this race gets 409 and the window falls back as for any failed play. The audio thumb drawn from the waveform takes the same check. + ### ../setup/build_windows_app.bat WINDOWED · the Windows engine is frozen with no console of its own - refers-to: setup/build_windows_app.bat WINDOWED, FORMDAM_ENGINE_WINDOWED; desktop_entry.py the stream guard at the top, _Tee, _open_log; src-tauri/src/main.rs backend_command, forward_lines, read_port; tests/test_entry_streams.py (three new tests) - kind: decision diff --git a/backend/app/routers/audio.py b/backend/app/routers/audio.py index 1da18f6..822c378 100644 --- a/backend/app/routers/audio.py +++ b/backend/app/routers/audio.py @@ -115,6 +115,8 @@ def media_listen(media_id: int, request: Request): if done.returncode != 0 or not os.path.isfile(tmp) or os.path.getsize(tmp) == 0: raise HTTPException(500, detail="ffmpeg could not decode this audio") os.replace(tmp, out) + if not waveform.keep_if_plain(media_id, out): + raise HTTPException(409, detail="This item was protected while it was prepared") except subprocess.TimeoutExpired as exc: raise HTTPException(504, detail="Decoding this audio took too long") from exc finally: diff --git a/backend/app/services/gallerysvc.py b/backend/app/services/gallerysvc.py index b26a26b..054fc84 100644 --- a/backend/app/services/gallerysvc.py +++ b/backend/app/services/gallerysvc.py @@ -24,6 +24,38 @@ def _shareable_ids(ids: List[int]) -> List[int]: +def _timed_variants(row, strip: bool) -> List[List[str]]: + if row["kind"] != "audio": + tail = ["-map_metadata", "-1"] if strip else [] + return [["-map", "0:v:0", "-map", "0:a?", "-dn", "-c", "copy", *tail]] + if not strip: + return [["-map", "0:a:0", "-map", "1:v?", "-dn", "-c", "copy"]] + from .packagesvc import audio_clean_streams + + return [[*streams, "-dn", "-map_metadata", "-1"] for streams in audio_clean_streams(cover_input=1)] + + +def _cut_timed(ff: str, row, src: str, tmp: str, strip: bool) -> bool: + head = [ff, "-y", "-v", "error"] + if row["trim_in"] is not None: + head += ["-ss", f"{float(row['trim_in']):.3f}"] + if row["trim_out"] is not None: + head += ["-to", f"{float(row['trim_out']):.3f}"] + head += ["-i", src] + if row["kind"] == "audio": + head += ["-i", src] + for variant in _timed_variants(row, strip): + done = subprocess.run([*head, *variant, tmp], stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, timeout=600) + if done.returncode == 0 and os.path.isfile(tmp) and os.path.getsize(tmp) > 0: + return True + try: + os.unlink(tmp) + except OSError: + pass + return False + + def download_path(share, media_id: int) -> Optional[str]: from . import libraryfs @@ -45,21 +77,7 @@ def download_path(share, media_id: int) -> Optional[str]: if not ff: return None tmp = out + ".part" + os.path.splitext(out)[1] - args = [ff, "-y", "-v", "error"] - if row["trim_in"] is not None: - args += ["-ss", f"{float(row['trim_in']):.3f}"] - if row["trim_out"] is not None: - args += ["-to", f"{float(row['trim_out']):.3f}"] - streams = ["-map", "0:a:0", "-map", "0:v?"] if row["kind"] == "audio" else ["-map", "0:v:0", "-map", "0:a?"] - args += ["-i", src, *streams, "-dn", "-c", "copy"] - if not share["include_location"] or row["location_hidden"]: - args += ["-map_metadata", "-1"] - done = subprocess.run(args + [tmp], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=600) - if done.returncode != 0 or not os.path.isfile(tmp) or os.path.getsize(tmp) == 0: - try: - os.unlink(tmp) - except OSError: - pass + if not _cut_timed(ff, row, src, tmp, not share["include_location"] or bool(row["location_hidden"])): return None os.replace(tmp, out) return out diff --git a/backend/app/services/packagesvc.py b/backend/app/services/packagesvc.py index 4c4e938..17db17c 100644 --- a/backend/app/services/packagesvc.py +++ b/backend/app/services/packagesvc.py @@ -135,9 +135,17 @@ def _strip_audio(src: str, dest: str) -> bool: ff = ffmpeg_path() if not ff: return False - done = subprocess.run([ff, "-y", "-v", "error", "-i", src, "-map", "0:a", "-map", "0:v?", "-dn", "-map_metadata", "-1", - "-c", "copy", dest], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=900) - return done.returncode == 0 and os.path.isfile(dest) and os.path.getsize(dest) > 0 + for streams in audio_clean_streams(): + done = subprocess.run([ff, "-y", "-v", "error", "-i", src, *streams, "-dn", "-map_metadata", "-1", dest], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=900) + if done.returncode == 0 and os.path.isfile(dest) and os.path.getsize(dest) > 0: + return True + return False + + +def audio_clean_streams(cover_input: int = 0) -> List[List[str]]: + redrawn = ["-map", "0:a", "-map", f"{cover_input}:v?", "-c:a", "copy", "-c:v", "png", "-disposition:v", "attached_pic"] + return [redrawn, ["-map", "0:a", "-c", "copy"]] def strip_timed(row, src: str, dest: str) -> bool: diff --git a/backend/app/services/thumbs.py b/backend/app/services/thumbs.py index d8faa8b..cd4d4ba 100644 --- a/backend/app/services/thumbs.py +++ b/backend/app/services/thumbs.py @@ -90,7 +90,10 @@ def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int) -> Opt if kind == "audio": frame = audio_still(src, size, media_id) if frame is not None: - return _save_webp(frame, out) + from .waveform import keep_if_plain + + saved = _save_webp(frame, out) + return saved if saved and keep_if_plain(media_id, saved) else None ffmpeg = ffmpeg_path() if ffmpeg and kind != "audio": token = secrets.token_hex(4) diff --git a/backend/app/services/waveform.py b/backend/app/services/waveform.py index ad7f3fd..a66e3eb 100644 --- a/backend/app/services/waveform.py +++ b/backend/app/services/waveform.py @@ -169,9 +169,24 @@ def cached(media_id: int, src: str, duration: Optional[float]) -> Optional[List[ except OSError: if os.path.isfile(tmp): os.unlink(tmp) + keep_if_plain(media_id, path) return found +def keep_if_plain(media_id: int, path: str) -> bool: + from .. import vaultcrypt + from ..db import q1 + + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + if row is not None and not vaultcrypt.protected(row) and not vaultcrypt.is_vaulted(media_id): + return True + try: + os.unlink(path) + except OSError: + pass + return False + + def image(peaks: List[float], width: int) -> Image.Image: height = max(2, int(width * 9 / 16)) canvas = Image.new("RGB", (width, height), BACKGROUND) diff --git a/backend/tests/test_audio_privacy.py b/backend/tests/test_audio_privacy.py new file mode 100644 index 0000000..8cd7122 --- /dev/null +++ b/backend/tests/test_audio_privacy.py @@ -0,0 +1,103 @@ +import os +import subprocess + +from PIL import Image + +from tests.conftest import HEADERS +from tests.test_audio_import import needs_ffmpeg +from tests.test_audio_organise import one_audio + +GPS_TAG = 0x8825 + + +def located_jpeg(path): + img = Image.new("RGB", (32, 32), (200, 40, 40)) + exif = Image.Exif() + exif.get_ifd(GPS_TAG).update({1: "N", 2: (51.0, 30.0, 0.0), 3: "W", 4: (0.0, 7.0, 0.0)}) + img.save(path, "JPEG", exif=exif) + return path + + +def mp3_with_located_cover(tmp_path): + cover = located_jpeg(tmp_path / "cover.jpg") + path = tmp_path / "bells.mp3" + subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", "sine=frequency=330:duration=1", + "-i", str(cover), "-map", "0:a", "-map", "1:v", "-c:a", "libmp3lame", "-c:v", "copy", + "-disposition:v", "attached_pic", str(path)], check=True, capture_output=True) + return path + + +def cover_bytes(path, out): + done = subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(path), "-map", "0:v:0", + "-c", "copy", "-f", "image2", str(out)], capture_output=True) + return out.read_bytes() if done.returncode == 0 and out.exists() else None + + +@needs_ffmpeg +def test_package_strip_leaves_no_location_in_the_cover(tmp_path): + from app.services import packagesvc + + path = mp3_with_located_cover(tmp_path) + assert b"Exif" in cover_bytes(path, tmp_path / "before.jpg") + row = {"kind": "audio", "rel_path": str(path), "name": "bells.mp3", "location_hidden": 0, "lat": None} + out = packagesvc._payload(row, False, str(tmp_path)) + after = cover_bytes(out["path"], tmp_path / "after.bin") + assert after is not None and after[:4] == b"\x89PNG" and b"Exif" not in after + + +@needs_ffmpeg +def test_share_download_leaves_no_location_in_the_cover(client, tmp_path): + from app.db import ex + from app.services import gallerysvc + + src = tmp_path / "src" + os.makedirs(src) + os.replace(mp3_with_located_cover(tmp_path), src / "bells.mp3") + from tests.conftest import import_dir + + import_dir(client, src) + media_id = client.get("/api/media", params={"filter": "audio"}).json()["items"][0]["id"] + ex("UPDATE media SET trim_in=0.1, trim_out=0.8 WHERE id=?", (media_id,)) + out = gallerysvc.download_path({"include_location": 0}, media_id) + assert out and os.path.isfile(out) + after = cover_bytes(out, tmp_path / "after.bin") + assert after is not None and after[:4] == b"\x89PNG" and b"Exif" not in after + + +def test_waveform_written_while_item_is_hidden_is_dropped(client, tmp_path, monkeypatch): + from app.db import ex + from app.services import libraryfs, waveform + + item = one_audio(client, tmp_path) + media_id = item["id"] + cache = waveform.cache_path(media_id) + if os.path.exists(cache): + os.unlink(cache) + + def hide_then_decode(**_): + ex("UPDATE media SET hidden=1 WHERE id=?", (media_id,)) + return [0.5, 1.0, 0.25] + + monkeypatch.setattr(waveform, "decode", hide_then_decode) + assert waveform.cached(media_id, libraryfs.abs_path(item["rel_path"]), 2.0) == [0.5, 1.0, 0.25] + assert not os.path.exists(cache) + + +@needs_ffmpeg +def test_listen_copy_written_while_item_is_hidden_is_dropped(client, tmp_path, monkeypatch): + from app.db import ex + from app.routers import audio + + item = one_audio(client, tmp_path) + media_id = item["id"] + real_run = subprocess.run + + def run_then_hide(*args, **kwargs): + done = real_run(*args, **kwargs) + ex("UPDATE media SET hidden=1 WHERE id=?", (media_id,)) + return done + + monkeypatch.setattr(audio.subprocess, "run", run_then_hide) + res = client.get(f"/api/media/{media_id}/listen", headers=HEADERS) + assert res.status_code == 409 + assert not os.path.exists(audio.listen_path(media_id)) From 7811d0e305d8ac2a9373da039b9e1a6d37ef3edb Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 12:52:19 -0500 Subject: [PATCH 06/35] feat: Form project files are a kind with previews made in the background 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. --- LICENSES.md | 1 + README.md | 2 +- backend/HASHOUT_LOG.md | 17 ++ backend/app/data/form_apps.json | 23 +++ backend/app/db.py | 16 +- backend/app/main.py | 7 +- backend/app/routers/assets.py | 43 +++++ backend/app/routers/browse.py | 2 +- backend/app/routers/importer.py | 2 +- backend/app/routers/library.py | 3 + backend/app/routers/mediaapi.py | 1 + backend/app/routers/people.py | 2 +- backend/app/routers/system.py | 1 + backend/app/services/assetkinds.py | 43 +++++ backend/app/services/assetstore.py | 91 ++++++++++ backend/app/services/assetwork.py | 142 ++++++++++++++++ backend/app/services/cards.py | 127 ++++++++++++++ backend/app/services/classify.py | 24 +++ backend/app/services/clipsvc.py | 4 +- backend/app/services/curatesvc.py | 2 +- backend/app/services/dedupsvc.py | 2 +- backend/app/services/facesvc.py | 2 +- backend/app/services/formapps.py | 126 ++++++++++++++ backend/app/services/gallerysvc.py | 17 +- backend/app/services/libraryfs.py | 14 +- backend/app/services/metasvc.py | 5 + backend/app/services/ocrsvc.py | 2 +- backend/app/services/projectfile.py | 130 +++++++++++++++ backend/app/services/query.py | 4 +- backend/app/services/thumbs.py | 41 ++++- backend/app/services/waveform.py | 12 +- backend/app/vaultcrypt.py | 19 ++- backend/tests/test_form_projects.py | 210 ++++++++++++++++++++++++ frontend/HASHOUT_LOG.md | 7 + frontend/index.html | 1 + frontend/src/engine/assetkinds.ts | 93 +++++++++++ frontend/src/engine/store.ts | 1 + frontend/src/engine/types.ts | 19 ++- frontend/src/styles/assets.css | 18 ++ frontend/src/ui/components/assetview.ts | 56 +++++++ frontend/src/ui/components/grid.ts | 7 +- frontend/src/ui/components/importer.ts | 9 +- frontend/src/ui/components/infopanel.ts | 11 +- frontend/src/ui/components/library.ts | 6 +- frontend/src/ui/components/organize.ts | 9 +- frontend/src/ui/components/pages.ts | 2 +- frontend/src/ui/components/sidebar.ts | 1 + frontend/src/ui/components/viewer.ts | 25 ++- frontend/src/ui/icons-extra.ts | 5 + frontend/tests/assets.test.ts | 29 ++++ 50 files changed, 1381 insertions(+), 55 deletions(-) create mode 100644 backend/app/data/form_apps.json create mode 100644 backend/app/routers/assets.py create mode 100644 backend/app/services/assetkinds.py create mode 100644 backend/app/services/assetstore.py create mode 100644 backend/app/services/assetwork.py create mode 100644 backend/app/services/cards.py create mode 100644 backend/app/services/formapps.py create mode 100644 backend/app/services/projectfile.py create mode 100644 backend/tests/test_form_projects.py create mode 100644 frontend/src/engine/assetkinds.ts create mode 100644 frontend/src/styles/assets.css create mode 100644 frontend/src/ui/components/assetview.ts create mode 100644 frontend/tests/assets.test.ts diff --git a/LICENSES.md b/LICENSES.md index b4c8d3d..7044cbb 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -53,6 +53,7 @@ Adobe, Bridge, Lightroom and Photoshop are either registered trademarks or trade | BioCLIP species text embeddings (imageomics/bioclip-demo space revision eeb91af, txt_emb_species.npy and .json, 384,490 taxa) | MIT | sha256-pinned download, converted at install to int8 (bioclip_species_int8.npy, about 197 MB) by services/species.py prepare; the fp32 source is deleted | | Wikidata landmarks, artworks and dishes (backend/app/data/lookup_world.json.gz, built by setup/gen_lookup_data.py via the QLever Wikidata endpoint) | CC0-1.0 | Look Up names, coordinates and artist credits; no attribution required | | YOLOX-s (opencv/object_detection_yolox, object_detection_yolox_2022nov.onnx, revision 78c368f) | Apache-2.0 | Clean Up distraction suggestions (COCO classes) in services/cleanmodels.py; sha256-pinned like LaMa | +| Form app extensions and identifiers (backend/app/data/form_apps.json) | written for formDAM (Apache-2.0, as the repository) | app ids, names, bundle identifiers and project file extensions, which are facts about the family's apps; no code or text is copied from the FormPortal catalogue it agrees with. App icons are not copied: the engine draws a monogram tile instead | | formDAM icon artwork | user-provided | src-tauri/icons/icon.png, used verbatim | | rapidocr-onnxruntime 1.2.3 (macOS) | Apache-2.0 | text-in-image search (services/ocrsvc.py); the wheel carries its PP-OCR detection, classification and recognition ONNX models (PaddleOCR, Apache-2.0). Installed only by requirements_macos.txt, so the Linux and Windows engines search text with tesseract on PATH | | Other Python packages frozen into the engine | MIT: annotated-doc, annotated-types, anyio, fastapi, h11, pydantic, pydantic-core, typing-inspection; MIT-0: cffi; BSD-3-Clause: click, idna, pycparser, protobuf, starlette; BSD: uvicorn; Apache-2.0: flatbuffers; Apache-2.0 OR BSD-2-Clause: packaging; PSF-2.0: typing-extensions; exifread: its own permissive notice (Copyright 2002-2007 Gene Cash) | read from the installed metadata of backend/requirements.txt, 2026-10-23 | diff --git a/README.md b/README.md index 5be62f6..1ae85cd 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@

Formats

- Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, 23 camera RAW extensions, video via ffmpeg, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP + Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, 23 camera RAW extensions, video via ffmpeg, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index d810a67..8f790c2 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -23,6 +23,23 @@ Sharing, packages and export strip all metadata from audio (ffmpeg -map_metadata The listen copy and the waveform cache are plain files. When an item becomes protected (hidden, trashed or in a private album) the vault's settle step deletes both before anything else, with or without a vault set up; sealing and deleting scrub the listen folder with the other caches, and the start-up sweep of vaulted items covers it. A protected item's listen copy is streamed from ffmpeg and never written. +### services/formapps.py, projectfile.py, assetwork.py, assetstore.py, assetkinds.py, cards.py · Form project files and file kinds +- refers-to: data/form_apps.json (new); formapps.registry, extension_map, app_for_name, portal_binary, open_plan, open_in_app; projectfile.read_convention, summarise, extract; assetkinds.Extract, register, handler_for; assetwork.pending_ids, process, drain, requeue, kick, startup, stop; assetstore.preview_path, extra_path, keep_if_plain, save_image, save_json, load_json, read_capped; cards.app_icon, kind_card, text_page, swatches; classify.FILE_KINDS, VISUAL_KINDS, file_kind, is_file_kind, subkind_of; db.py migration 13 (ASSET_COLUMNS, idx_media_subkind) and media_dict asset; libraryfs.import_one; metasvc.apply; thumbs.ensure_thumb sealing, file_thumb, card_path; vaultcrypt.PLAIN_EXTRAS, _drop_plain_audio sealing, _settle; query FLAGS project and has_preview, TEXT_FIELDS app and format, NUM_FIELDS pages; mediaapi FILTERS projects; system summary projects; browse MEDIA_TYPES; importer upload check; gallerysvc.file_download and the gallery page; routers/assets.py (new) /form-apps, /media/{id}/open-in-app, /media/{id}/previews/refresh; the visual jobs now name image and video instead of leaving out audio; tests/test_form_projects.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +Form app project files are a fourth kind, "project", and the first of the file kinds (project, document, model, resource, sequence) that are not pictures or sound. A file kind is imported like any item (sha256 and size, the dated originals folder, ratings, labels, keywords, albums, sidecars, trash, the vault, export and share) but nothing probes it at import: face_state, clip_state and ocr_text are set to done and metasvc.apply only stamps meta_ver. Its preview, key facts and text come from a background worker afterwards, so an import of any size returns as fast as copying the files. + +The extension list is not in the code. data/form_apps.json is a copy of the family registry's project_extensions (formcut .fc, formvis .fmv .formvis, formwav .fmw, formcel .fcel, formsculpt .fsc) plus the extensions the apps' own open dialogs use that the registry does not list yet, marked source proposed (.fcad, .fdoc, .fdec and .fsld, .ftxt, .fpth, .frig, .ffbrc, .fmo, .fpub, .fweb, .formpkg, .fvd). When FormPortal is installed, its catalogue copy (catalog/apps.json under its data folder, or FORMPORTAL_ROOT) is read on top, so a new app's extension is recognised once the registry names it, without a formDAM release. Reading is cached by the file's mtime. + +The preview and manifest convention, proposed for the family and read when present: a project that is a zip carries manifest.json (or form-manifest.json) and preview.png, preview.webp or preview.jpg at the archive root; a project that is a JSON document carries a top-level "manifest" object and a "preview" data URL (data:image/png;base64,...), or the data URL inside the manifest. The manifest's fields are app, format_version, title, created and modified (ISO 8601 or seconds) and a count of what the project holds, either as top-level pages, frames, scenes, slides, sheets, tracks, layers or clips, or as a "count" object with those keys; formDAM shows the first count it finds as the item's pages. A title fills the item's title only when the person has not given one; created replaces the file-system date unless the date came from EXIF or was adjusted. Members larger than 1 MiB (manifest) or 32 MiB (preview) are not read. A project without the convention, or any other binary, is shown with the app's icon: a monogram tile drawn by the engine in a colour derived from the app id, since vendor or app artwork is not copied into this repository. + +Open in the app asks FormPortal first (formportal open-file PATH, the binary from FORMPORTAL_BIN, PATH or the macOS app bundle), which knows the installed channel; without it, macOS opens the app by its bundle identifier from the registry (open -b), and otherwise the operating system's handler for the extension. Protected items are refused as for Reveal and Open With. + +The worker is one thread, started with the app and stopped at lifespan exit and before a library switch, as the vault sweep is. It handles the visible items whose preview_state is 0, newest import last, and never a hidden, trashed, private or vaulted one; an item becomes pending again when it is unhidden or when its preview has gone (ensure_thumb requeues it). Until the preview exists the grid gets a drawn card (extension and name) stored as {id}_card_{size}; the card is sealed as the item's placeholder poster (.p384) when it is the only thumb at protect time, so unhiding never restores it as a real thumb. + +Every generated file sits in the thumbs folder under the media id ({id}_preview_v1.webp and {id}__v1.json), so the vault's scrub of thumbs/{id}_* removes it on protect and delete. The settle step drops the plain previews and extras of a protected item as it does the waveform and listen copy, keeping only the large preview while the vault is about to seal, so the sealed poster is the real one; the protect step then scrubs it. Each writer re-reads the row after os.replace and deletes its file when the item became protected meanwhile (assetstore.keep_if_plain, which the waveform and listen writers now share). + ### services/packagesvc.py, gallerysvc.py, waveform.py, routers/audio.py · the cover and late caches leak nothing - refers-to: packagesvc._strip_audio, audio_clean_streams; gallerysvc._timed_variants, _cut_timed, download_path; waveform.keep_if_plain, cached; thumbs.ensure_thumb (audio branch); routers/audio.media_listen; tests/test_audio_privacy.py - kind: fix diff --git a/backend/app/data/form_apps.json b/backend/app/data/form_apps.json new file mode 100644 index 0000000..04c2f77 --- /dev/null +++ b/backend/app/data/form_apps.json @@ -0,0 +1,23 @@ +{ + "format": "formdam.form_apps", + "format_version": 1, + "note": "A copy of the family registry's project_extensions, plus extensions named by the apps' own open dialogs that the registry does not list yet (source proposed). FormPortal's catalogue copy, when installed, is read on top of this.", + "products": [ + {"id": "formcut", "name": "FormCut", "identifier": "app.formcut.desktop", "project_extensions": [".fc"], "source": "registry"}, + {"id": "formvis", "name": "FormVis", "identifier": "ai.nodemode.formvis", "project_extensions": [".fmv", ".formvis", ".fvd"], "source": "registry"}, + {"id": "formwav", "name": "FormWav", "identifier": "ai.nodemode.formwav", "project_extensions": [".fmw"], "source": "registry"}, + {"id": "formcel", "name": "FormCel", "identifier": "ai.nodemode.formcel", "project_extensions": [".fcel"], "source": "registry"}, + {"id": "formsculpt", "name": "FormSculpt", "identifier": "ai.nodemode.formsculpt", "project_extensions": [".fsc"], "source": "registry"}, + {"id": "formcad", "name": "FormCAD", "identifier": null, "project_extensions": [".fcad"], "source": "proposed"}, + {"id": "formdesign", "name": "FormDesign", "identifier": "dev.formai.formdesign", "project_extensions": [".fdoc"], "source": "proposed"}, + {"id": "formslide", "name": "FormDeck", "identifier": "ai.nodemode.formdeck", "project_extensions": [".fdec", ".fsld"], "source": "proposed"}, + {"id": "formtxt", "name": "FormTxt", "identifier": "ai.nodemode.formtxt", "project_extensions": [".ftxt"], "source": "proposed"}, + {"id": "formpath", "name": "FormPath", "identifier": "dev.formai.formpath", "project_extensions": [".fpth"], "source": "proposed"}, + {"id": "formrig", "name": "FormRig", "identifier": null, "project_extensions": [".frig"], "source": "proposed"}, + {"id": "formfabric", "name": "FormFabric", "identifier": null, "project_extensions": [".ffbrc"], "source": "proposed"}, + {"id": "formmorpheus", "name": "FormMorpheus", "identifier": null, "project_extensions": [".fmo"], "source": "proposed"}, + {"id": "formpublisher", "name": "FormPublisher", "identifier": null, "project_extensions": [".fpub"], "source": "proposed"}, + {"id": "formweb", "name": "FormWeb", "identifier": "dev.formai.formweb", "project_extensions": [".fweb"], "source": "proposed"}, + {"id": "formext", "name": "form.ext", "identifier": null, "project_extensions": [".formpkg"], "source": "proposed"} + ] +} diff --git a/backend/app/db.py b/backend/app/db.py index 6b5e7d1..0d986d4 100644 --- a/backend/app/db.py +++ b/backend/app/db.py @@ -1,3 +1,4 @@ +import json import os import sqlite3 import threading @@ -142,7 +143,7 @@ def connect() -> sqlite3.Connection: return conn -SCHEMA_VERSION = 12 +SCHEMA_VERSION = 13 MEDIA_V5_COLUMNS = ( "make TEXT", "model TEXT", "lens TEXT", "focal REAL", "focal35 REAL", "aperture REAL", "shutter REAL", @@ -169,7 +170,15 @@ def connect() -> sqlite3.Connection: "has_cover INTEGER NOT NULL DEFAULT 0", ) +ASSET_COLUMNS = ( + "subkind TEXT", "app_id TEXT", "pages INTEGER", "asset_json TEXT", "preview_state INTEGER NOT NULL DEFAULT 0", +) + MIGRATIONS = { + 13: [f"ALTER TABLE media ADD COLUMN {col}" for col in ASSET_COLUMNS] + [ + "CREATE INDEX IF NOT EXISTS idx_media_subkind ON media(subkind)", + "UPDATE media SET preview_state=1", + ], 12: [f"ALTER TABLE media ADD COLUMN {col}" for col in AUDIO_COLUMNS] + [ "CREATE INDEX IF NOT EXISTS idx_media_kind ON media(kind)", ], @@ -365,6 +374,11 @@ def media_dict(row: sqlite3.Row) -> Dict[str, Any]: d["hidden"] = bool(d.get("hidden")) for heavy in ("exif_json", "iptc_json", "lookup_json"): d.pop(heavy, None) + raw = d.pop("asset_json", None) + try: + d["asset"] = json.loads(raw) if raw else {} + except ValueError: + d["asset"] = {} return d diff --git a/backend/app/main.py b/backend/app/main.py index 546d3a9..7b16b69 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -10,7 +10,7 @@ from . import ffmpeg_fetch, mediacodecs, upgrade_thumbs, wiring from .db import init_db, q, ex, setting_get, setting_set from .services import classify -from .routers import albums, audio, automation, browse, curate, dedup, discover, edit, files, geo, importer, library, mediaapi, organize, output, packages, people, render, syncapi, system, trash +from .routers import albums, assets, audio, automation, browse, curate, dedup, discover, edit, files, geo, importer, library, mediaapi, organize, output, packages, people, render, syncapi, system, trash from .security import local_only_guard mimetypes.add_type("text/javascript", ".js") @@ -57,7 +57,10 @@ async def lifespan(app: FastAPI): pass housekeeping.register(syncsvc.ensure) syncsvc.ensure() + from .services import assetwork + assetwork.startup() yield + assetwork.stop() familyserver.stop() vaultcrypt.stop() @@ -79,7 +82,7 @@ def _reclassify_screenshots() -> None: app = FastAPI(title="formDAM", version=VERSION, lifespan=lifespan) app.middleware("http")(local_only_guard) -for module in (automation, system, importer, browse, render, edit, organize, files, geo, discover, output, curate, library, packages, syncapi, mediaapi, audio, albums, people, trash, dedup): +for module in (automation, system, importer, browse, render, edit, organize, files, geo, discover, output, curate, library, packages, syncapi, mediaapi, audio, assets, albums, people, trash, dedup): app.include_router(module.router, prefix="/api") _dist = env("DIST", os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "frontend", "dist")) diff --git a/backend/app/routers/assets.py b/backend/app/routers/assets.py new file mode 100644 index 0000000..d4e7fa9 --- /dev/null +++ b/backend/app/routers/assets.py @@ -0,0 +1,43 @@ +from fastapi import APIRouter, HTTPException, Request + +from ..db import q1 +from ..services import classify, formapps +from .files import _path +from .guard import ensure_visible + +router = APIRouter() + + +@router.get("/form-apps") +def form_apps(): + apps = sorted(formapps.registry().values(), key=lambda app: app["name"].lower()) + return {"apps": apps, "portal": formapps.portal_binary() is not None} + + +@router.post("/media/{media_id}/open-in-app") +def open_in_app(media_id: int, request: Request): + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + ensure_visible(row, request) + if row["kind"] != "project": + raise HTTPException(415, detail="Only Form project files open in their app") + app = formapps.registry().get(row["app_id"] or "") or formapps.app_for_name(row["name"]) + if app is None: + raise HTTPException(404, detail="No Form app is known for this file type") + path = _path(media_id, request) + try: + via = formapps.open_in_app(path, app) + except OSError as exc: + raise HTTPException(502, detail=f"{app['name']} could not be started") from exc + return {"ok": True, "app": app["name"], "via": via} + + +@router.post("/media/{media_id}/previews/refresh") +def refresh_preview(media_id: int, request: Request): + from ..services import assetwork + + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + ensure_visible(row, request) + if not classify.is_file_kind(row["kind"]): + raise HTTPException(415, detail="Only files with a generated preview refresh it") + assetwork.requeue(media_id) + return {"ok": True} diff --git a/backend/app/routers/browse.py b/backend/app/routers/browse.py index c0d1d31..93b4857 100644 --- a/backend/app/routers/browse.py +++ b/backend/app/routers/browse.py @@ -11,7 +11,7 @@ router = APIRouter() MEDIA_TYPES = [ - ("video", "Videos"), ("audio", "Audio"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), + ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), ("panorama", "Panoramas"), ("timelapse", "Time-lapse"), ("slomo", "Slo-mo"), ("cinematic", "Cinematic"), ("burst", "Bursts"), ("spatial", "Spatial"), ("long_exposure", "Long Exposure"), ("animated", "Animated"), ("raw", "RAW"), ("screenshot", "Screenshots"), ("screen_recording", "Screen Recordings"), diff --git a/backend/app/routers/importer.py b/backend/app/routers/importer.py index 7788c3d..4629fa7 100644 --- a/backend/app/routers/importer.py +++ b/backend/app/routers/importer.py @@ -84,7 +84,7 @@ def import_upload(files: List[UploadFile] = File(...)): with tempfile.TemporaryDirectory(prefix="dam-drop-") as tmp: for upload in files: name = os.path.basename(upload.filename or "dropped") - if os.path.splitext(name)[1].lower() not in UPLOAD_EXTS: + if os.path.splitext(name)[1].lower() not in UPLOAD_EXTS and classify.media_kind(name)[0] is None: counts["skipped"] += 1 continue local = os.path.join(tmp, name) diff --git a/backend/app/routers/library.py b/backend/app/routers/library.py index 67f4052..dafd40b 100644 --- a/backend/app/routers/library.py +++ b/backend/app/routers/library.py @@ -79,11 +79,14 @@ def switch_library(body: SwitchIn): from .. import vaultcrypt vaultcrypt.stop() + from ..services import assetwork + assetwork.stop() os.environ["FORMDAM_LIBRARY"] = path init_db() os.makedirs(originals_dir(), exist_ok=True) os.makedirs(cache_dir(), exist_ok=True) vaultcrypt.startup() + assetwork.startup() _reset_caches() libraries.remember(path, body.name) from . import browse, curate, discover, geo diff --git a/backend/app/routers/mediaapi.py b/backend/app/routers/mediaapi.py index 94992bc..7e12955 100644 --- a/backend/app/routers/mediaapi.py +++ b/backend/app/routers/mediaapi.py @@ -21,6 +21,7 @@ "photos": ("AND kind='image'", "created_ts DESC, id DESC"), "videos": ("AND kind='video'", "created_ts DESC, id DESC"), "audio": ("AND kind='audio'", "created_ts DESC, id DESC"), + "projects": ("AND kind='project'", "created_ts DESC, id DESC"), "screenshots": ("AND is_screenshot=1", "created_ts DESC, id DESC"), "screenrecs": ("AND is_screen_rec=1", "created_ts DESC, id DESC"), "not_in_album": ("AND id NOT IN (SELECT media_id FROM album_items)", "created_ts DESC, id DESC"), diff --git a/backend/app/routers/people.py b/backend/app/routers/people.py index ea73b4b..b1c7598 100644 --- a/backend/app/routers/people.py +++ b/backend/app/routers/people.py @@ -21,7 +21,7 @@ class RenameIn(BaseModel): @router.get("/people/status") def people_status(): info = facesvc.status() - pending = q1("SELECT COUNT(*) AS n FROM media WHERE face_state=0 AND trashed_ts IS NULL AND kind<>'audio'")["n"] + pending = q1("SELECT COUNT(*) AS n FROM media WHERE face_state=0 AND trashed_ts IS NULL AND kind IN ('image','video')")["n"] info["pending_media"] = pending active = jobs.running("faces") info["job"] = active diff --git a/backend/app/routers/system.py b/backend/app/routers/system.py index c24e430..7d0a345 100644 --- a/backend/app/routers/system.py +++ b/backend/app/routers/system.py @@ -105,6 +105,7 @@ def count(sql: str) -> int: "photos": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='image'"), "videos": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='video'"), "audio": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='audio'"), + "projects": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='project'"), "screenshots": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screenshot=1"), "screenrecs": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screen_rec=1"), "favorites": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND favorite=1"), diff --git a/backend/app/services/assetkinds.py b/backend/app/services/assetkinds.py new file mode 100644 index 0000000..ef40884 --- /dev/null +++ b/backend/app/services/assetkinds.py @@ -0,0 +1,43 @@ +from dataclasses import dataclass, field +from typing import Any, Callable, Dict, Optional + +from PIL import Image + + +@dataclass(frozen=True) +class Extract: + meta: Dict[str, Any] = field(default_factory=dict) + pages: Optional[int] = None + text: Optional[str] = None + title: Optional[str] = None + width: Optional[int] = None + height: Optional[int] = None + duration: Optional[float] = None + created_ts: Optional[float] = None + preview: Optional[Image.Image] = None + extras: Dict[str, Any] = field(default_factory=dict) + + +Handler = Callable[[str, Dict[str, Any]], Extract] +_HANDLERS: Dict[str, Handler] = {} + + +def register(key: str, handler: Handler) -> None: + _HANDLERS[key] = handler + + +def handler_for(kind: str, subkind: Optional[str]) -> Optional[Handler]: + _load() + return _HANDLERS.get(f"{kind}:{subkind}") or _HANDLERS.get(kind) + + +_loaded = {"done": False} + + +def _load() -> None: + if _loaded["done"]: + return + _loaded["done"] = True + from . import projectfile + + register("project", projectfile.extract) diff --git a/backend/app/services/assetstore.py b/backend/app/services/assetstore.py new file mode 100644 index 0000000..b68e024 --- /dev/null +++ b/backend/app/services/assetstore.py @@ -0,0 +1,91 @@ +import json +import os +import secrets +from typing import Any, Optional + +from PIL import Image + +PREVIEW_VER = 1 +PREVIEW_LONG = 1024 +MAX_READ = 512 * 1024 * 1024 + + +def preview_path(media_id: int) -> str: + from .thumbs import thumb_folder + + return os.path.join(thumb_folder(), f"{media_id}_preview_v{PREVIEW_VER}.webp") + + +def extra_path(media_id: int, tag: str, ext: str) -> str: + from .thumbs import thumb_folder + + return os.path.join(thumb_folder(), f"{media_id}_{tag}_v{PREVIEW_VER}.{ext}") + + +def keep_if_plain(media_id: int, path: str) -> bool: + from .. import vaultcrypt + from ..db import q1 + + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + if row is not None and not vaultcrypt.protected(row) and not vaultcrypt.is_vaulted(media_id): + return True + discard(path) + return False + + +def discard(path: str) -> None: + try: + os.unlink(path) + except OSError: + pass + + +def _atomic(path: str, write) -> bool: + tmp = f"{path}.{secrets.token_hex(4)}.tmp" + try: + write(tmp) + os.replace(tmp, path) + return True + except (OSError, ValueError): + return False + finally: + discard(tmp) + + +def save_image(media_id: int, img: Image.Image, path: Optional[str] = None, long_side: int = PREVIEW_LONG) -> Optional[str]: + target = path or preview_path(media_id) + frame = img.convert("RGBA" if "A" in img.getbands() else "RGB") + frame.thumbnail((long_side, long_side), Image.Resampling.LANCZOS) + if not _atomic(target, lambda tmp: frame.save(tmp, "WEBP", quality=82, method=4)): + return None + return target if keep_if_plain(media_id, target) else None + + +def save_json(media_id: int, tag: str, value: Any) -> Optional[str]: + target = extra_path(media_id, tag, "json") + + def write(tmp: str) -> None: + with open(tmp, "w", encoding="utf-8") as handle: + json.dump(value, handle, separators=(",", ":")) + + if not _atomic(target, write): + return None + return target if keep_if_plain(media_id, target) else None + + +def load_json(media_id: int, tag: str) -> Optional[Any]: + try: + with open(extra_path(media_id, tag, "json"), "r", encoding="utf-8") as handle: + return json.load(handle) + except (OSError, ValueError): + return None + + +def read_capped(path: str) -> Optional[bytes]: + try: + if os.path.getsize(path) > MAX_READ: + return None + with open(path, "rb") as handle: + return handle.read() + except OSError: + return None diff --git a/backend/app/services/assetwork.py b/backend/app/services/assetwork.py new file mode 100644 index 0000000..34137b5 --- /dev/null +++ b/backend/app/services/assetwork.py @@ -0,0 +1,142 @@ +import json +import logging +import os +import threading +from typing import Any, Dict, List, Optional + +from ..config import library_root +from ..db import ex, q, q1, reset_thread_conn +from . import assetkinds, assetstore, classify, libraryfs + +logger = logging.getLogger(__name__) + +PENDING, DONE, NONE = 0, 1, 2 +MAX_TEXT = 200_000 +BATCH = 50 +_wake = threading.Event() +_halt = threading.Event() +_state: Dict[str, Optional[threading.Thread]] = {"worker": None} +_lock = threading.Lock() + + +def _kinds_sql() -> str: + return ",".join(f"'{k}'" for k in classify.FILE_KINDS) + + +def pending_ids(limit: int = BATCH) -> List[int]: + rows = q(f"""SELECT id FROM media WHERE kind IN ({_kinds_sql()}) AND preview_state=0 AND trashed_ts IS NULL + AND hidden=0 AND private=0 AND id NOT IN (SELECT media_id FROM vault_items) ORDER BY id LIMIT ?""", (limit,)) + return [row["id"] for row in rows] + + +def _clean_text(text: Optional[str]) -> Optional[str]: + if text is None: + return None + flat = " ".join(text.split()) + return flat[:MAX_TEXT] + + +def _store(row, found: assetkinds.Extract) -> None: + media_id = row["id"] + sets = ["asset_json=?", "pages=?", "preview_state=?"] + vals: List[Any] = [json.dumps(found.meta, separators=(",", ":"), default=str), found.pages, + DONE if found.preview is not None else NONE] + for column, value in (("width", found.width), ("height", found.height), ("duration", found.duration)): + if value is not None: + sets.append(f"{column}=?") + vals.append(value) + if found.title and not row["title"]: + sets.append("title=?") + vals.append(found.title[:300]) + if found.text is not None: + sets.append("ocr_text=?") + vals.append(_clean_text(found.text)) + if found.created_ts and row["created_src"] not in ("exif", "adjusted"): + sets += ["created_ts=?", "created_src=?"] + vals += [found.created_ts, "file"] + ex(f"UPDATE media SET {', '.join(sets)} WHERE id=?", (*vals, media_id)) + + +def process(media_id: int) -> bool: + from .. import vaultcrypt + + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + if row is None or not classify.is_file_kind(row["kind"]) or vaultcrypt.protected(row) or vaultcrypt.is_vaulted(media_id): + return False + path = libraryfs.abs_path(row["rel_path"]) + handler = assetkinds.handler_for(row["kind"], row["subkind"]) + found = assetkinds.Extract() + if handler is not None and os.path.isfile(path): + try: + found = handler(path, dict(row)) + except Exception as exc: + logger.warning("preview for item %s failed: %s", media_id, exc) + found = assetkinds.Extract(meta={"error": "This file could not be read"}) + if found.preview is not None and assetstore.save_image(media_id, found.preview) is None: + found = assetkinds.Extract(**{**found.__dict__, "preview": None}) + for tag, value in found.extras.items(): + assetstore.save_json(media_id, tag, value) + _store(row, found) + return True + + +def drain(limit: Optional[int] = None) -> int: + root = library_root() + done = 0 + seen: set = set() + with _lock: + while not _halt.is_set() and library_root() == root: + ids = [media_id for media_id in pending_ids() if media_id not in seen] + if not ids: + break + for media_id in ids: + if _halt.is_set() or library_root() != root: + return done + seen.add(media_id) + process(media_id) + done += 1 + if limit is not None and done >= limit: + return done + return done + + +def _loop() -> None: + while not _halt.is_set(): + _wake.wait(60) + _wake.clear() + if _halt.is_set(): + break + try: + drain() + except Exception as exc: + logger.warning("asset previews stopped: %s", exc) + finally: + reset_thread_conn() + + +def requeue(media_id: int) -> None: + ex("UPDATE media SET preview_state=0 WHERE id=? AND preview_state<>0", (media_id,)) + kick() + + +def kick() -> None: + _wake.set() + + +def startup() -> None: + if _state["worker"] is None: + _halt.clear() + _state["worker"] = threading.Thread(target=_loop, name="asset-previews", daemon=True) + _state["worker"].start() + _wake.set() + + +def stop() -> None: + thread = _state["worker"] + if thread is None: + return + _halt.set() + _wake.set() + thread.join() + _state["worker"] = None + _wake.clear() diff --git a/backend/app/services/cards.py b/backend/app/services/cards.py new file mode 100644 index 0000000..5aab911 --- /dev/null +++ b/backend/app/services/cards.py @@ -0,0 +1,127 @@ +import hashlib +from typing import List, Sequence, Tuple + +from PIL import Image, ImageDraw, ImageFont + +CARD_BG = (24, 22, 18) +CARD_INK = (226, 214, 190) +CARD_DIM = (150, 140, 122) +PAGE_BG = (250, 248, 243) +PAGE_INK = (38, 36, 32) +Color = Tuple[int, int, int] + + +def font(size: int) -> ImageFont.ImageFont: + try: + return ImageFont.load_default(size) + except (TypeError, OSError): + return ImageFont.load_default() + + +def tint(key: str) -> Color: + digest = hashlib.sha1(key.encode("utf-8")).digest() + hue = digest[0] / 255.0 + sat, val = 0.45, 0.78 + i = int(hue * 6) % 6 + f = hue * 6 - int(hue * 6) + p, q, t = val * (1 - sat), val * (1 - f * sat), val * (1 - (1 - f) * sat) + rgb = [(val, t, p), (q, val, p), (p, val, t), (p, q, val), (t, p, val), (val, p, q)][i] + return tuple(int(c * 255) for c in rgb) # type: ignore[return-value] + + +def monogram(name: str) -> str: + rest = name[4:] if name.lower().startswith("form") and len(name) > 4 else name + rest = rest.lstrip(".") + letters = [c for c in rest if c.isalnum()] + if not letters: + return "F" + caps = [c for c in rest if c.isupper()] + if len(caps) >= 2: + return "".join(caps[:3]) + return "".join(letters[:2]).capitalize() + + +def _centered(draw: ImageDraw.ImageDraw, box: Tuple[int, int, int, int], text: str, face, fill: Color) -> None: + left, top, right, bottom = draw.textbbox((0, 0), text, font=face) + x = box[0] + (box[2] - box[0] - (right - left)) / 2 - left + y = box[1] + (box[3] - box[1] - (bottom - top)) / 2 - top + draw.text((x, y), text, font=face, fill=fill) + + +def app_icon(app_name: str, app_id: str, size: int = 1024) -> Image.Image: + width, height = size, max(2, int(size * 9 / 16)) + canvas = Image.new("RGB", (width, height), CARD_BG) + draw = ImageDraw.Draw(canvas) + side = int(height * 0.56) + left, top = (width - side) // 2, int(height * 0.12) + draw.rounded_rectangle([left, top, left + side, top + side], radius=side // 5, fill=tint(app_id)) + _centered(draw, (left, top, left + side, top + side), monogram(app_name), font(int(side * 0.42)), CARD_BG) + _centered(draw, (0, top + side, width, height), app_name, font(int(height * 0.09)), CARD_INK) + return canvas + + +def kind_card(label: str, lines: Sequence[str], key: str, size: int = 1024) -> Image.Image: + width, height = size, max(2, int(size * 9 / 16)) + canvas = Image.new("RGB", (width, height), CARD_BG) + draw = ImageDraw.Draw(canvas) + band = int(height * 0.5) + draw.rectangle([0, 0, width, band], fill=tint(key)) + _centered(draw, (0, 0, width, band), label.upper()[:8], font(int(band * 0.42)), CARD_BG) + face = font(int(height * 0.07)) + y = band + int(height * 0.06) + for index, line in enumerate(list(lines)[:3]): + _centered(draw, (0, y, width, y + int(height * 0.12)), line[:48], face, CARD_INK if index == 0 else CARD_DIM) + y += int(height * 0.13) + return canvas + + +def wrap(text: str, face, width: int, draw: ImageDraw.ImageDraw) -> List[str]: + out: List[str] = [] + for para in text.splitlines(): + words, line = para.split(), "" + if not words: + out.append("") + continue + for word in words: + trial = f"{line} {word}".strip() + if draw.textlength(trial, font=face) <= width or not line: + line = trial + else: + out.append(line) + line = word + out.append(line) + return out + + +def text_page(text: str, heading: str = "", size: int = 1024) -> Image.Image: + width, height = int(size * 0.75), size + canvas = Image.new("RGB", (width, height), PAGE_BG) + draw = ImageDraw.Draw(canvas) + margin = int(width * 0.08) + y = margin + if heading: + head = font(int(width * 0.05)) + draw.text((margin, y), heading[:60], font=head, fill=PAGE_INK) + y += int(width * 0.08) + body = font(int(width * 0.032)) + step = int(width * 0.045) + for line in wrap(text[:6000], body, width - 2 * margin, draw): + if y + step > height - margin: + break + draw.text((margin, y), line, font=body, fill=PAGE_INK) + y += step + return canvas + + +def swatches(colors: Sequence[Color], size: int = 1024) -> Image.Image: + width, height = size, max(2, int(size * 9 / 16)) + canvas = Image.new("RGB", (width, height), CARD_BG) + draw = ImageDraw.Draw(canvas) + shown = list(colors)[:64] or [CARD_DIM] + cols = min(8, len(shown)) + rows = (len(shown) + cols - 1) // cols + cell_w, cell_h = width / cols, height / rows + for i, color in enumerate(shown): + x, y = (i % cols) * cell_w, (i // cols) * cell_h + draw.rectangle([x, y, x + cell_w, y + cell_h], fill=tuple(color)) + return canvas diff --git a/backend/app/services/classify.py b/backend/app/services/classify.py index adf6dea..cade7d4 100644 --- a/backend/app/services/classify.py +++ b/backend/app/services/classify.py @@ -24,6 +24,9 @@ AUDIO_ONLY_MIMES = {"mp4": "audio/mp4", "m4v": "audio/mp4", "mov": "audio/mp4", "3gp": "audio/3gpp", "webm": "audio/webm", "mkv": "audio/x-matroska"} TIMED_KINDS = ("video", "audio") +VISUAL_KINDS = ("image", "video") +FILE_KINDS = ("project", "document", "model", "resource", "sequence") +PROJECT_MIME = "application/x-form-project" SCREENSHOT_NAME = re.compile(r"screen[\s_-]?shot|screenshot", re.IGNORECASE) SCREENREC_NAME = re.compile(r"screen[\s_-]?record|screenrecording|rpreplay", re.IGNORECASE) @@ -41,9 +44,30 @@ def media_kind(name: str): return "video", VIDEO_EXTS[ext] if ext in AUDIO_EXTS: return "audio", AUDIO_EXTS[ext] + found = file_kind(name) + if found is not None: + return found[0], found[1] return None, None +def file_kind(name: str): + from . import formapps + + app = formapps.app_for_name(name) + if app is not None: + return "project", PROJECT_MIME, app["id"] + return None + + +def is_file_kind(kind) -> bool: + return kind in FILE_KINDS + + +def subkind_of(name: str): + found = file_kind(name) + return found[2] if found else None + + def is_timed(kind) -> bool: return kind in TIMED_KINDS diff --git a/backend/app/services/clipsvc.py b/backend/app/services/clipsvc.py index 9599e75..146ff98 100644 --- a/backend/app/services/clipsvc.py +++ b/backend/app/services/clipsvc.py @@ -67,7 +67,7 @@ def status() -> Dict[str, Any]: runtime = True except Exception: runtime = False - pending = q1("SELECT COUNT(*) AS n FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio'")["n"] + pending = q1("SELECT COUNT(*) AS n FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind IN ('image','video')")["n"] done = q1("SELECT COUNT(*) AS n FROM clip_vectors")["n"] return {"ready": runtime and not missing, "runtime": runtime, "missing": missing, "pending": pending, "indexed": done} @@ -215,7 +215,7 @@ def index_job(state: Dict[str, Any]) -> None: counts = {"indexed": 0, "failed": 0, "total": info["pending"]} state["counts"] = counts - rows = q("SELECT id, rel_path, kind FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio' ORDER BY created_ts DESC") + rows = q("SELECT id, rel_path, kind FROM media WHERE clip_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind IN ('image','video') ORDER BY created_ts DESC") for start in range(0, len(rows), BATCH): chunk, images, paths_ = [], [], [] for row in rows[start:start + BATCH]: diff --git a/backend/app/services/curatesvc.py b/backend/app/services/curatesvc.py index 9c5c40e..c469078 100644 --- a/backend/app/services/curatesvc.py +++ b/backend/app/services/curatesvc.py @@ -55,7 +55,7 @@ def _pick(rows: List[Any], limit: int = MEMORY_MAX) -> List[int]: seen_stacks, chosen = set(), [] scored = [] for r in rows: - if r["is_screenshot"] or r["rejected"] or r["is_screen_rec"] or r["kind"] == "audio": + if r["is_screenshot"] or r["rejected"] or r["is_screen_rec"] or r["kind"] not in ("image", "video"): continue if r["stack_id"] and r["stack_id"] in seen_stacks: continue diff --git a/backend/app/services/dedupsvc.py b/backend/app/services/dedupsvc.py index 23d3d3b..35c873b 100644 --- a/backend/app/services/dedupsvc.py +++ b/backend/app/services/dedupsvc.py @@ -125,7 +125,7 @@ def scan_job(state: Dict[str, Any], threshold: int, include_videos: bool = True, ) entries: List[Dict[str, Any]] = [] for row in rows: - if row["kind"] == "audio": + if row["kind"] not in ("image", "video"): continue if row["kind"] == "video" and (not has_ffmpeg or not include_videos): counts["videos_skipped"] += 1 diff --git a/backend/app/services/facesvc.py b/backend/app/services/facesvc.py index 28fcb79..c859d70 100644 --- a/backend/app/services/facesvc.py +++ b/backend/app/services/facesvc.py @@ -196,7 +196,7 @@ def scan_job(state: Dict[str, Any]) -> None: clusterer = _Clusterer() counts = {"scanned": 0, "faces": 0, "people_new": 0, "videos": 0, "failed": 0} state["counts"] = counts - rows = q("SELECT id, rel_path, kind FROM media WHERE face_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio' ORDER BY id") + rows = q("SELECT id, rel_path, kind FROM media WHERE face_state=0 AND trashed_ts IS NULL AND live_of IS NULL AND kind IN ('image','video') ORDER BY id") for row in rows: path = libraryfs.abs_path(row["rel_path"]) frames: List[Tuple[float, Any]] = [] diff --git a/backend/app/services/formapps.py b/backend/app/services/formapps.py new file mode 100644 index 0000000..37d51e8 --- /dev/null +++ b/backend/app/services/formapps.py @@ -0,0 +1,126 @@ +import json +import logging +import os +import shutil +import subprocess +import sys +from functools import lru_cache +from typing import Any, Dict, List, Optional, Tuple + + +logger = logging.getLogger(__name__) + +SNAPSHOT = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "data", "form_apps.json") +PORTAL_ENV = "FORMPORTAL_ROOT" + + +def _portal_root() -> Optional[str]: + root = os.environ.get(PORTAL_ENV) + if root: + return root + home = os.path.expanduser("~") + if sys.platform == "darwin": + return os.path.join(home, "Library", "Application Support", "dev.formai.portal") + if os.name == "nt": + base = os.environ.get("LOCALAPPDATA") or os.path.join(home, "AppData", "Local") + return os.path.join(base, "FormPortal") + base = os.environ.get("XDG_DATA_HOME") or os.path.join(home, ".local", "share") + return os.path.join(base, "formportal") + + +def _products(path: str) -> List[Dict[str, Any]]: + try: + with open(path, "r", encoding="utf-8") as handle: + data = json.load(handle) + except (OSError, ValueError): + return [] + found = data.get("products") if isinstance(data, dict) else None + return [p for p in found or [] if isinstance(p, dict) and isinstance(p.get("id"), str)] + + +def _merge(base: Dict[str, Dict[str, Any]], extra: List[Dict[str, Any]]) -> Dict[str, Dict[str, Any]]: + merged = dict(base) + for product in extra: + exts = [str(e).lower() for e in product.get("project_extensions") or [] if isinstance(e, str) and e.startswith(".")] + known = merged.get(product["id"], {}) + if not exts and not known: + continue + merged[product["id"]] = { + "id": product["id"], + "name": str(product.get("name") or known.get("name") or product["id"]), + "identifier": product.get("identifier") or known.get("identifier"), + "project_extensions": sorted(set(known.get("project_extensions", [])) | set(exts)), + "source": "registry" if exts else known.get("source", "registry"), + } + return merged + + +@lru_cache(maxsize=4) +def _registry(portal_catalog: Optional[str], stamp: float) -> Dict[str, Dict[str, Any]]: + base = _merge({}, _products(SNAPSHOT)) + if portal_catalog and stamp: + base = _merge(base, _products(portal_catalog)) + return base + + +def registry() -> Dict[str, Dict[str, Any]]: + root = _portal_root() + catalog = os.path.join(root, "catalog", "apps.json") if root else None + try: + stamp = os.path.getmtime(catalog) if catalog else 0.0 + except OSError: + stamp = 0.0 + return _registry(catalog, stamp) + + +def extension_map() -> Dict[str, str]: + out: Dict[str, str] = {} + for app_id, app in sorted(registry().items()): + for ext in app["project_extensions"]: + out.setdefault(ext, app_id) + return out + + +def app_for_name(name: str) -> Optional[Dict[str, Any]]: + ext = os.path.splitext(name)[1].lower() + app_id = extension_map().get(ext) + return registry().get(app_id) if app_id else None + + +def portal_binary() -> Optional[str]: + override = os.environ.get("FORMPORTAL_BIN", "") + if override: + return override if os.path.isfile(override) else None + found = shutil.which("formportal") + if found: + return found + if sys.platform == "darwin": + bundled = "/Applications/FormPortal.app/Contents/MacOS/formportal" + return bundled if os.path.isfile(bundled) else None + return None + + +def open_plan(path: str, app: Dict[str, Any]) -> Tuple[str, List[str]]: + portal = portal_binary() + if portal: + return "formportal", [portal, "open-file", path] + if sys.platform == "darwin" and app.get("identifier"): + return "app", ["open", "-b", str(app["identifier"]), path] + if sys.platform == "darwin": + return "system", ["open", path] + if os.name == "nt": + return "system", [] + return "system", ["xdg-open", path] + + +def open_in_app(path: str, app: Dict[str, Any]) -> str: + via, cmd = open_plan(path, app) + try: + if not cmd: + os.startfile(path) # type: ignore[attr-defined] + return via + subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + return via + except OSError as exc: + logger.warning("open in %s failed: %s", app.get("name"), exc) + raise diff --git a/backend/app/services/gallerysvc.py b/backend/app/services/gallerysvc.py index 054fc84..fd2f155 100644 --- a/backend/app/services/gallerysvc.py +++ b/backend/app/services/gallerysvc.py @@ -6,7 +6,7 @@ from ..config import cache_dir from ..db import q1 -from . import thumbs +from . import classify, thumbs SHAREABLE = "m.trashed_ts IS NULL AND m.private=0 AND m.hidden=0 AND m.live_of IS NULL" @@ -56,11 +56,19 @@ def _cut_timed(ff: str, row, src: str, tmp: str, strip: bool) -> bool: return False +def file_download(row, src: str, keep_location: bool) -> Optional[str]: + return src if os.path.isfile(src) else None + + def download_path(share, media_id: int) -> Optional[str]: from . import libraryfs + from . import classify + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) src = libraryfs.abs_path(row["rel_path"]) + if classify.is_file_kind(row["kind"]): + return file_download(row, src, bool(share["include_location"]) and not row["location_hidden"]) timed = row["kind"] in ("video", "audio") trimmed = timed and (row["trim_in"] is not None or row["trim_out"] is not None) if share["include_location"] and not row["location_hidden"] and not row["edit_json"] and not trimmed: @@ -145,7 +153,7 @@ def web_gallery(ids: List[int], title: str, dest: str, include_location: bool, s for pos, media_id in enumerate(ok, start=1): row = q1("SELECT * FROM media WHERE id=?", (media_id,)) stem = f"{pos:04d}" - if row["kind"] in ("video", "audio"): + if row["kind"] in ("video", "audio") or classify.is_file_kind(row["kind"]): src = download_path(fake, media_id) if src is None: counts["skipped"] += 1 @@ -170,7 +178,8 @@ def web_gallery(ids: List[int], title: str, dest: str, include_location: bool, s img.convert("RGB").save(os.path.join(folder, full), "JPEG", quality=90) img.thumbnail((640, 640)) img.convert("RGB").save(os.path.join(folder, f"thumbs/{stem}.jpg"), "JPEG", quality=82) - entries.append({"full": full, "thumb": f"thumbs/{stem}.jpg", "kind": row["kind"], "title": row["title"] or "", "caption": row["caption"] or ""}) + kind = "file" if classify.is_file_kind(row["kind"]) else row["kind"] + entries.append({"full": full, "thumb": f"thumbs/{stem}.jpg", "kind": kind, "name": row["name"], "title": row["title"] or "", "caption": row["caption"] or ""}) counts["written"] += 1 data = json.dumps({"title": title, "items": entries}).replace(" str: const grid = document.getElementById("grid"), view = document.getElementById("view"), stage = document.getElementById("stage"), cap = document.getElementById("cap"); let at = -1; D.items.forEach((it, i) => { const a = document.createElement("a"); a.href = it.full; const img = document.createElement("img"); img.src = it.thumb; img.alt = it.title; img.loading = "lazy"; a.append(img); a.onclick = (e) => { e.preventDefault(); show(i); }; grid.append(a); }); -function show(i) { if (i < 0 || i >= D.items.length) return; at = i; const it = D.items[i]; const timed = it.kind === "video" || it.kind === "audio"; const m = document.createElement(timed ? it.kind : "img"); m.src = it.full; if (timed) m.controls = true; stage.replaceChildren(m); cap.textContent = [it.title, it.caption].filter(Boolean).join(" · "); view.hidden = false; } +function show(i) { if (i < 0 || i >= D.items.length) return; at = i; const it = D.items[i]; const timed = it.kind === "video" || it.kind === "audio"; const m = document.createElement(timed ? it.kind : "img"); m.src = it.kind === "file" ? it.thumb : it.full; if (timed) m.controls = true; const parts = [m]; if (it.kind === "file") { const a = document.createElement("a"); a.href = it.full; a.download = it.name; a.textContent = it.name; a.className = "file"; parts.push(a); } stage.replaceChildren(...parts); cap.textContent = [it.title, it.caption].filter(Boolean).join(" · "); view.hidden = false; } view.querySelector(".close").onclick = () => { view.hidden = true; stage.replaceChildren(); }; view.querySelector(".prev").onclick = () => show(at - 1); view.querySelector(".next").onclick = () => show(at + 1); document.addEventListener("keydown", (e) => { if (view.hidden) return; if (e.key === "Escape") view.querySelector(".close").onclick(); if (e.key === "ArrowLeft") show(at - 1); if (e.key === "ArrowRight") show(at + 1); }); diff --git a/backend/app/services/libraryfs.py b/backend/app/services/libraryfs.py index 16558be..4773e1e 100644 --- a/backend/app/services/libraryfs.py +++ b/backend/app/services/libraryfs.py @@ -66,7 +66,9 @@ def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[s width = height = None duration = None exif_ts = None - if kind == "image": + if classify.is_file_kind(kind): + pass + elif kind == "image": width, height, exif_ts = mediainfo.image_meta(path) elif kind == "audio": duration, exif_ts = mediainfo.audio_meta(path) @@ -99,8 +101,12 @@ def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[s ) if reference: ex("UPDATE media SET referenced=1 WHERE id=?", (media_id,)) - if kind == "audio": + if kind not in classify.VISUAL_KINDS: ex("UPDATE media SET face_state=2, clip_state=2, ocr_text='' WHERE id=?", (media_id,)) + if classify.is_file_kind(kind): + subkind = classify.subkind_of(name) + app = subkind if kind == "project" else None + ex("UPDATE media SET subkind=?, app_id=?, preview_state=0 WHERE id=?", (subkind, app, media_id)) batch_id = getattr(_batch, "id", None) if batch_id: ex("UPDATE media SET batch_id=? WHERE id=?", (batch_id, media_id)) @@ -117,6 +123,10 @@ def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[s xmpsvc.import_sidecar(media_id, path, dest) except Exception: pass + if classify.is_file_kind(kind): + from . import assetwork + + assetwork.kick() return {"status": "imported", "media_id": media_id, "id": media_id, "kind": kind, "rel_path": rel} diff --git a/backend/app/services/metasvc.py b/backend/app/services/metasvc.py index b1df84b..11d18cf 100644 --- a/backend/app/services/metasvc.py +++ b/backend/app/services/metasvc.py @@ -59,6 +59,11 @@ def apply(media_id: int, meta: Optional[Dict[str, Any]] = None) -> Optional[Dict path = libraryfs.abs_path(row["rel_path"]) if not os.path.isfile(path): return None + from . import classify + + if classify.is_file_kind(row["kind"]): + ex("UPDATE media SET meta_ver=? WHERE id=?", (META_VER, media_id)) + return {} if meta is None: meta = read(path, row["kind"]) width, height = row["width"], row["height"] diff --git a/backend/app/services/ocrsvc.py b/backend/app/services/ocrsvc.py index f9671fa..d379a76 100644 --- a/backend/app/services/ocrsvc.py +++ b/backend/app/services/ocrsvc.py @@ -98,7 +98,7 @@ def scan_job(state: Dict[str, Any]) -> None: state["counts"] = counts import time as _time - rows = q("SELECT id, rel_path, kind FROM media WHERE ocr_text IS NULL AND trashed_ts IS NULL AND live_of IS NULL AND kind<>'audio' ORDER BY id") + rows = q("SELECT id, rel_path, kind FROM media WHERE ocr_text IS NULL AND trashed_ts IS NULL AND live_of IS NULL AND kind IN ('image','video') ORDER BY id") try: for row in rows: text = "" diff --git a/backend/app/services/projectfile.py b/backend/app/services/projectfile.py new file mode 100644 index 0000000..63cf9c8 --- /dev/null +++ b/backend/app/services/projectfile.py @@ -0,0 +1,130 @@ +import base64 +import binascii +import io +import json +import zipfile +from datetime import datetime, timezone +from typing import Any, Dict, Optional, Tuple + +from PIL import Image + +from . import cards, formapps +from .assetkinds import Extract + +MANIFEST_NAMES = ("manifest.json", "form-manifest.json") +PREVIEW_NAMES = ("preview.png", "preview.webp", "preview.jpg", "preview.jpeg") +MAX_MANIFEST = 1024 * 1024 +MAX_PREVIEW = 32 * 1024 * 1024 +MAX_JSON_PROJECT = 64 * 1024 * 1024 +COUNT_KEYS = ("pages", "frames", "scenes", "slides", "sheets", "tracks", "layers", "clips") + + +def _stamp(value: Any) -> Optional[float]: + if isinstance(value, (int, float)) and value > 0: + return float(value) + if not isinstance(value, str) or not value.strip(): + return None + try: + parsed = datetime.fromisoformat(value.strip().replace("Z", "+00:00")) + except ValueError: + return None + if parsed.tzinfo is None: + parsed = parsed.replace(tzinfo=timezone.utc) + return parsed.timestamp() + + +def _image(data: Optional[bytes]) -> Optional[Image.Image]: + if not data: + return None + try: + with Image.open(io.BytesIO(data)) as img: + img.load() + return img.convert("RGBA" if "A" in img.getbands() else "RGB") + except Exception: + return None + + +def _data_url(value: Any) -> Optional[bytes]: + if not isinstance(value, str) or not value.startswith("data:image/") or "," not in value: + return None + head, body = value.split(",", 1) + if ";base64" not in head or len(body) > MAX_PREVIEW * 4 // 3 + 4: + return None + try: + return base64.b64decode(body, validate=False) + except (binascii.Error, ValueError): + return None + + +def _member(archive: zipfile.ZipFile, names: Tuple[str, ...], cap: int) -> Optional[bytes]: + lower = {info.filename.lower(): info for info in archive.infolist()} + for name in names: + info = lower.get(name) + if info is not None and info.file_size <= cap: + return archive.read(info) + return None + + +def read_convention(path: str) -> Tuple[Dict[str, Any], Optional[Image.Image]]: + if zipfile.is_zipfile(path): + try: + with zipfile.ZipFile(path) as archive: + raw = _member(archive, MANIFEST_NAMES, MAX_MANIFEST) + preview = _image(_member(archive, PREVIEW_NAMES, MAX_PREVIEW)) + except (zipfile.BadZipFile, OSError, KeyError): + return {}, None + try: + manifest = json.loads(raw) if raw else {} + except ValueError: + manifest = {} + return (manifest if isinstance(manifest, dict) else {}), preview + return _json_convention(path) + + +def _json_convention(path: str) -> Tuple[Dict[str, Any], Optional[Image.Image]]: + try: + with open(path, "rb") as handle: + head = handle.read(1) + if head not in (b"{", b" ", b"\n", b"\r", b"\t"): + return {}, None + body = head + handle.read(MAX_JSON_PROJECT) + data = json.loads(body) + except (OSError, ValueError): + return {}, None + if not isinstance(data, dict): + return {}, None + manifest = data.get("manifest") if isinstance(data.get("manifest"), dict) else {} + return manifest, _image(_data_url(data.get("preview") or manifest.get("preview"))) + + +def summarise(manifest: Dict[str, Any]) -> Dict[str, Any]: + counts = {key: int(manifest[key]) for key in COUNT_KEYS + if isinstance(manifest.get(key), (int, float)) and not isinstance(manifest.get(key), bool) and manifest[key] >= 0} + nested = manifest.get("count") if isinstance(manifest.get("count"), dict) else {} + for key, value in nested.items(): + if key in COUNT_KEYS and isinstance(value, (int, float)) and not isinstance(value, bool) and value >= 0: + counts.setdefault(key, int(value)) + out: Dict[str, Any] = {"counts": counts} + for key in ("app", "format_version", "title"): + value = manifest.get(key) + if isinstance(value, (str, int, float)) and not isinstance(value, bool): + out[key] = str(value)[:200] if isinstance(value, str) else value + for key in ("created", "modified"): + stamp = _stamp(manifest.get(key)) + if stamp is not None: + out[key] = stamp + return out + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + app = formapps.registry().get(row.get("app_id") or "") or formapps.app_for_name(row.get("name") or "") or {} + app_name = app.get("name") or "Form app" + manifest, preview = read_convention(path) + info = summarise(manifest) + counts = info.get("counts", {}) + pages = next((counts[key] for key in COUNT_KEYS if key in counts), None) + meta = {**info, "app_name": app_name, "app_id": app.get("id") or row.get("app_id"), + "has_manifest": bool(manifest), "preview": "embedded" if preview is not None else "app_icon"} + image = preview if preview is not None else cards.app_icon(app_name, str(app.get("id") or app_name)) + return Extract(meta=meta, pages=pages, title=info.get("title"), created_ts=info.get("created"), + preview=image) diff --git a/backend/app/services/query.py b/backend/app/services/query.py index 8dbad5a..6cd065d 100644 --- a/backend/app/services/query.py +++ b/backend/app/services/query.py @@ -30,6 +30,7 @@ FLAGS = { "favorite": "m.favorite=1", "photo": "m.kind='image'", "video": "m.kind='video'", "audio": "m.kind='audio'", + "project": "m.kind='project'", "has_preview": "m.preview_state=1", "cover_art": "m.has_cover=1", "lossless": "(m.audio_codec IN ('flac','alac','wavpack','ape','tta') OR m.audio_codec LIKE 'pcm%')", "screenshot": "m.is_screenshot=1", "screen_recording": "m.is_screen_rec=1", "raw": "m.is_raw=1", "live": "m.live_video_id IS NOT NULL", "panorama": "m.is_panorama=1", "selfie": "m.is_selfie=1", @@ -53,13 +54,14 @@ "lens": "m.lens", "place": "(COALESCE(m.place,'')||' '||COALESCE(m.admin,'')||' '||COALESCE(m.country,''))", "text": "m.ocr_text", "folder": "m.rel_path", "alt_text": "m.alt_text", "artist": "m.artist", "album_title": "m.album_title", "genre": "m.genre", "codec": "m.audio_codec", + "app": "m.app_id", "format": "m.subkind", } NUM_FIELDS = { "rating": "m.rating", "iso": "m.iso", "aperture": "m.aperture", "focal": "m.focal", "shutter": "m.shutter", "size": "m.size", "width": "m.width", "height": "m.height", "duration": "m.duration", "created": "m.created_ts", "imported": "m.imported_ts", "sample_rate": "m.sample_rate", "channels": "m.channels", "bit_depth": "m.bit_depth", "bitrate": "m.bitrate", - "release_year": "m.release_year", + "release_year": "m.release_year", "pages": "m.pages", } OPS = {"=": "=", "!=": "<>", ">=": ">=", "<=": "<=", ">": ">", "<": "<"} MONTHS = {m: i for i, m in enumerate(["january", "february", "march", "april", "may", "june", "july", "august", diff --git a/backend/app/services/thumbs.py b/backend/app/services/thumbs.py index cd4d4ba..3e60709 100644 --- a/backend/app/services/thumbs.py +++ b/backend/app/services/thumbs.py @@ -58,7 +58,7 @@ def convert_legacy(src: str, dst: str) -> bool: return False -def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int) -> Optional[str]: +def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int, sealing: bool = False) -> Optional[str]: size = _bucket(requested) out = thumb_path(media_id, size) if os.path.isfile(out): @@ -69,6 +69,10 @@ def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int) -> Opt src = libraryfs.abs_path(rel_path) if not os.path.isfile(src): return None + from . import classify + + if classify.is_file_kind(kind): + return file_thumb(media_id, kind, size, out, sealing) if kind == "image": try: from . import decode, editsvc @@ -93,7 +97,7 @@ def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int) -> Opt from .waveform import keep_if_plain saved = _save_webp(frame, out) - return saved if saved and keep_if_plain(media_id, saved) else None + return saved if saved and (sealing or keep_if_plain(media_id, saved)) else None ffmpeg = ffmpeg_path() if ffmpeg and kind != "audio": token = secrets.token_hex(4) @@ -125,6 +129,39 @@ def ensure_thumb(media_id: int, rel_path: str, kind: str, requested: int) -> Opt return ph if os.path.isfile(ph) else None +def card_path(media_id: int, size: int) -> str: + return os.path.join(thumb_folder(), f"{media_id}_card_{size}_v{THUMB_VER}.webp") + + +def file_thumb(media_id: int, kind: str, size: int, out: str, sealing: bool = False) -> Optional[str]: + from . import assetstore, assetwork, cards + from ..db import q1 + + preview = assetstore.preview_path(media_id) + if os.path.isfile(preview): + try: + with Image.open(preview) as img: + frame = img.convert("RGB") + frame.thumbnail((size, size), Image.Resampling.LANCZOS) + saved = _save_webp(frame, out) + return saved if saved and (sealing or assetstore.keep_if_plain(media_id, saved)) else None + except Exception: + return None + row = q1("SELECT name, subkind, preview_state FROM media WHERE id=?", (media_id,)) + if row is None: + return None + if row["preview_state"] == assetwork.DONE and not sealing: + assetwork.requeue(media_id) + target = card_path(media_id, size) + if not os.path.isfile(target): + ext = os.path.splitext(row["name"])[1].lstrip(".") or kind + card = cards.kind_card(ext, [row["name"]], row["subkind"] or kind, size) + saved = _save_webp(card, target) + if not saved or not (sealing or assetstore.keep_if_plain(media_id, saved)): + return None + return target + + def cover_art(src: str, size: int) -> Optional[Image.Image]: ffmpeg = ffmpeg_path() if not ffmpeg: diff --git a/backend/app/services/waveform.py b/backend/app/services/waveform.py index a66e3eb..1271cf7 100644 --- a/backend/app/services/waveform.py +++ b/backend/app/services/waveform.py @@ -174,17 +174,9 @@ def cached(media_id: int, src: str, duration: Optional[float]) -> Optional[List[ def keep_if_plain(media_id: int, path: str) -> bool: - from .. import vaultcrypt - from ..db import q1 + from .assetstore import keep_if_plain as keep - row = q1("SELECT * FROM media WHERE id=?", (media_id,)) - if row is not None and not vaultcrypt.protected(row) and not vaultcrypt.is_vaulted(media_id): - return True - try: - os.unlink(path) - except OSError: - pass - return False + return keep(media_id, path) def image(peaks: List[float], width: int) -> Image.Image: diff --git a/backend/app/vaultcrypt.py b/backend/app/vaultcrypt.py index aac816b..0770497 100644 --- a/backend/app/vaultcrypt.py +++ b/backend/app/vaultcrypt.py @@ -417,9 +417,9 @@ def _protect(row, home: str) -> None: if os.path.isfile(plain): _encrypt_file(plain, _blob(blob, f".t{size}"), ck) if not os.path.isfile(_blob(blob, ".t384")): - made = thumbs.ensure_thumb(media_id, row["rel_path"], row["kind"], 384) + made = thumbs.ensure_thumb(media_id, row["rel_path"], row["kind"], 384, sealing=True) if made and os.path.isfile(made): - _encrypt_file(made, _blob(blob, ".p384" if "_ph." in made else ".t384"), ck) + _encrypt_file(made, _blob(blob, ".p384" if "_ph." in made or "_card_" in made else ".t384"), ck) _encrypt_file(src, _blob(blob), ck) meta = json.dumps({"ocr": row["ocr_text"], "face_state": row["face_state"]}).encode() nonce = os.urandom(12) @@ -475,18 +475,25 @@ def _reseal(item, home: str) -> None: ex("UPDATE vault_items SET sealed=?, home=? WHERE media_id=?", (_seal(ck, _home_pub(home)), home, item["media_id"])) -def _drop_plain_audio(media_id: int) -> None: - patterns = ((os.path.join(cache_dir(), "listen"), f"{media_id}_*"), (os.path.join(cache_dir(), "thumbs"), f"{media_id}_wave_*")) +PLAIN_EXTRAS = ("wave", "preview", "card", "mesh", "pages", "page", "cues", "specimen", "lut") + + +def _drop_plain_audio(media_id: int, sealing: bool = False) -> None: + thumbs_dir = os.path.join(cache_dir(), "thumbs") + tags = [tag for tag in PLAIN_EXTRAS if not (sealing and tag == "preview")] + patterns = ((os.path.join(cache_dir(), "listen"), f"{media_id}_*"), + *((thumbs_dir, f"{media_id}_{tag}_*") for tag in tags), + *((thumbs_dir, f"{media_id}_{tag}[0-9]*") for tag in ("page",))) for folder, name in patterns: for path in glob.glob(os.path.join(glob.escape(folder), name)): _unlink(path) def _settle(row) -> bool: - if protected(row): - _drop_plain_audio(row["id"]) try: home = home_for(row) + if protected(row): + _drop_plain_audio(row["id"], sealing=home is not None) item = _item(row["id"]) if home is not None and item is None: _protect(row, home) diff --git a/backend/tests/test_form_projects.py b/backend/tests/test_form_projects.py new file mode 100644 index 0000000..c0184bc --- /dev/null +++ b/backend/tests/test_form_projects.py @@ -0,0 +1,210 @@ +import base64 +import io +import json +import os +import time +import zipfile + +from PIL import Image + +from tests.conftest import HEADERS, import_dir + + +def png_bytes(color, size=(64, 40)): + out = io.BytesIO() + Image.new("RGB", size, color).save(out, "PNG") + return out.getvalue() + + +def zip_project(path, manifest=None, preview=None): + with zipfile.ZipFile(path, "w") as archive: + archive.writestr("document.json", json.dumps({"shapes": []})) + if manifest is not None: + archive.writestr("manifest.json", json.dumps(manifest)) + if preview is not None: + archive.writestr("preview.png", preview) + return path + + +def settle(client): + from app.services import assetwork + + assetwork.drain() + + +def item_named(client, name): + items = client.get("/api/media", params={"filter": "projects"}).json()["items"] + return next(i for i in items if i["name"] == name) + + +def test_registry_maps_family_extensions(tmp_path, monkeypatch): + from app.services import classify, formapps + + monkeypatch.setenv("FORMPORTAL_ROOT", str(tmp_path / "portal")) + exts = formapps.extension_map() + for ext, app in ((".fcad", "formcad"), (".fdoc", "formdesign"), (".fmw", "formwav"), (".formpkg", "formext"), (".fc", "formcut")): + assert exts[ext] == app + assert classify.media_kind("plan.FCAD") == ("project", classify.PROJECT_MIME) + os.makedirs(tmp_path / "portal" / "catalog") + (tmp_path / "portal" / "catalog" / "apps.json").write_text(json.dumps( + {"products": [{"id": "formnew", "name": "FormNew", "identifier": "dev.example.formnew", "project_extensions": [".fnew"]}, + {"id": "formcad", "name": "FormCAD", "project_extensions": [".fcadx"]}]})) + exts = formapps.extension_map() + assert exts[".fnew"] == "formnew" and exts[".fcadx"] == "formcad" and exts[".fcad"] == "formcad" + + +def test_project_with_preview_and_manifest(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + manifest = {"app": "formcad", "format_version": 3, "title": "Bracket", "pages": 4, + "created": "2026-01-02T03:04:05Z", "modified": "2026-02-03T04:05:06Z"} + zip_project(src / "bracket.fcad", manifest, png_bytes((10, 200, 30))) + import_dir(client, src) + settle(client) + item = item_named(client, "bracket.fcad") + assert (item["kind"], item["app_id"], item["subkind"]) == ("project", "formcad", "formcad") + assert item["preview_state"] == 1 and item["pages"] == 4 and item["title"] == "Bracket" + assert item["asset"]["preview"] == "embedded" and item["asset"]["format_version"] == 3 + assert item["asset"]["app_name"] == "FormCAD" and item["asset"]["counts"] == {"pages": 4} + assert abs(item["created_ts"] - 1767323045.0) < 1 + thumb = client.get(f"/api/media/{item['id']}/thumb", params={"s": 192}) + assert thumb.status_code == 200 + with Image.open(io.BytesIO(thumb.content)) as img: + r, g, b = img.convert("RGB").getpixel((img.width // 2, img.height // 2)) + assert g > 150 and r < 60 + + +def test_project_without_convention_uses_the_app_icon(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + (src / "mix.fmw").write_bytes(b"\x00binary session") + import_dir(client, src) + settle(client) + item = item_named(client, "mix.fmw") + assert item["asset"]["preview"] == "app_icon" and item["asset"]["has_manifest"] is False + assert item["asset"]["app_name"] == "FormWav" and item["preview_state"] == 1 + assert client.get(f"/api/media/{item['id']}/thumb").status_code == 200 + + +def test_json_project_carries_its_manifest_and_preview(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + url = "data:image/png;base64," + base64.b64encode(png_bytes((200, 10, 10))).decode() + (src / "deck.fdec").write_text(json.dumps({"manifest": {"title": "Pitch", "count": {"slides": 12}}, "preview": url})) + import_dir(client, src) + settle(client) + item = item_named(client, "deck.fdec") + assert item["asset"]["preview"] == "embedded" and item["pages"] == 12 and item["title"] == "Pitch" + + +def test_projects_filter_count_search_and_smart_rules(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + zip_project(src / "a.fcad", {"pages": 2}) + zip_project(src / "b.fdoc", {"pages": 9}) + Image.new("RGB", (20, 20)).save(src / "photo.png") + import_dir(client, src) + settle(client) + assert client.get("/api/summary").json()["projects"] == 2 + assert {i["name"] for i in client.get("/api/media", params={"filter": "projects"}).json()["items"]} == {"a.fcad", "b.fdoc"} + spec = {"rules": [{"field": "flag", "value": "project"}, {"field": "app", "op": "contains", "value": "formdesign"}]} + assert [m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == ["b.fdoc"] + spec = {"rules": [{"field": "pages", "op": ">=", "value": 5}]} + assert [m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == ["b.fdoc"] + + +def test_organise_trash_and_hide_projects(client, tmp_path): + from app.services import assetstore + + src = tmp_path / "src" + os.makedirs(src) + zip_project(src / "plan.fcad", {"pages": 1}, png_bytes((0, 0, 255))) + import_dir(client, src) + settle(client) + media_id = item_named(client, "plan.fcad")["id"] + assert client.patch(f"/api/media/{media_id}/meta", json={"rating": 5, "label": "red"}, headers=HEADERS).status_code == 200 + assert client.post("/api/media/keywords", json={"ids": [media_id], "add": ["bracket"], "remove": []}, headers=HEADERS).status_code == 200 + album = client.post("/api/albums", json={"name": "Parts"}, headers=HEADERS).json()["id"] + assert client.post(f"/api/albums/{album}/items", json={"media_ids": [media_id]}, headers=HEADERS).json()["added"] == 1 + details = client.get(f"/api/media/{media_id}/details").json() + assert (details["rating"], details["label"], [k["name"] for k in details["keywords"]]) == (5, "red", ["bracket"]) + assert os.path.isfile(assetstore.preview_path(media_id)) + assert client.post(f"/api/media/{media_id}/hide", headers=HEADERS).status_code == 200 + assert not os.path.exists(assetstore.preview_path(media_id)) + assert client.get("/api/summary").json()["projects"] == 0 + + +def test_hidden_project_is_sealed_in_the_vault(client, tmp_path): + from app.services import assetstore, libraryfs + + src = tmp_path / "src" + os.makedirs(src) + zip_project(src / "secret.fcad", {"pages": 1}, png_bytes((255, 255, 0))) + import_dir(client, src) + settle(client) + item = item_named(client, "secret.fcad") + original = libraryfs.abs_path(item["rel_path"]) + token = client.post("/api/vault/setup", json={"passkey": "vaultkey9"}, headers=HEADERS).json()["token"] + auth = {**HEADERS, "x-dam-vault": token} + assert client.post(f"/api/media/{item['id']}/hide", headers=HEADERS).status_code == 200 + deadline = time.monotonic() + 10 + while os.path.exists(original) and time.monotonic() < deadline: + time.sleep(0.05) + assert not os.path.exists(original) and not os.path.exists(assetstore.preview_path(item["id"])) + res = client.get(f"/api/media/{item['id']}/thumb", headers=auth) + assert res.status_code == 200 and res.headers["cache-control"] == "no-store" + assert client.post(f"/api/media/{item['id']}/open-in-app", headers=auth).status_code == 409 + + +def test_open_in_app_goes_through_formportal_when_present(client, tmp_path, monkeypatch): + from app.services import formapps + + src = tmp_path / "src" + os.makedirs(src) + zip_project(src / "part.fcad", {}) + import_dir(client, src) + media_id = item_named(client, "part.fcad")["id"] + portal = tmp_path / "formportal" + portal.write_text("") + monkeypatch.setenv("FORMPORTAL_BIN", str(portal)) + calls = [] + monkeypatch.setattr(formapps.subprocess, "Popen", lambda cmd, **_: calls.append(cmd)) + res = client.post(f"/api/media/{media_id}/open-in-app", headers=HEADERS) + assert res.status_code == 200 and res.json()["via"] == "formportal" and res.json()["app"] == "FormCAD" + assert calls[0][:2] == [str(portal), "open-file"] and calls[0][2].endswith("part.fcad") + monkeypatch.setenv("FORMPORTAL_BIN", str(tmp_path / "missing")) + via, cmd = formapps.open_plan("/x/part.fdoc", formapps.registry()["formdesign"]) + assert via in ("app", "system") and cmd[-1] == "/x/part.fdoc" + + +def test_slow_preview_never_blocks_import(client, tmp_path, monkeypatch): + from app.services import assetkinds + + def slow(path, row): + time.sleep(3) + return assetkinds.Extract() + + monkeypatch.setattr(assetkinds, "handler_for", lambda kind, subkind: slow) + src = tmp_path / "src" + os.makedirs(src) + for n in range(3): + zip_project(src / f"p{n}.fcad", {"pages": n}) + started = time.monotonic() + counts = import_dir(client, src) + assert counts["imported"] == 3 and time.monotonic() - started < 2.5 + + +def test_export_and_share_projects_as_originals(client, tmp_path): + from app.services import gallerysvc + from tests.conftest import wait_job + + src = tmp_path / "src" + os.makedirs(src) + zip_project(src / "kit.fcad", {"pages": 1}) + import_dir(client, src) + media_id = item_named(client, "kit.fcad")["id"] + dest = tmp_path / "out" + job = client.post("/api/export", json={"ids": [media_id], "dest": str(dest), "options": {"location": False}}, headers=HEADERS).json()["job_id"] + assert wait_job(client, job)["phase"] == "done" + assert zipfile.is_zipfile(dest / "kit.fcad") + assert gallerysvc.download_path({"include_location": 0}, media_id).endswith("kit.fcad") diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 0c9d171..342abd9 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### engine/assetkinds.ts, ui/components/assetview.ts · file kinds in the window, Form projects first +- refers-to: assetkinds.ts (new) FILE_KINDS, isFileKind, kindIcon, kindLabel, countLine, appName, openLabel, projectFacts, assetFacts; assetview.ts (new) createAssetView, assetBody; viewer.ts showAsset; types.ts MediaKind, AssetFacts, the asset fields, summary and filter names; grid.ts kind marks; infopanel.ts asset facts; sidebar.ts Form Projects; library.ts, store.ts, organize.ts (rules app, format, pages), pages.ts; importer.ts drop filter; icons-extra.ts project, cube, swatch, frames, launch; styles/assets.css; tests/assets.test.ts +- kind: feat +- logged: after v1.32.4 · 2026-11-29 + +A project, document, model, design resource or image sequence opens in the viewer as a Glass panel: the engine's preview, the facts the engine read (assetFacts, one table per kind), Download, and for a Form project "Open in ". A kind can give the panel a richer body than the still (pages, a turntable, a player) through assetBody, keyed by kind or kind:subkind. The drop zone now passes every file with an extension to the engine, which skips what it does not know and counts it. + ### engine/audiofmt.ts, ui/components/audioplayer.ts, trim.ts · the audio player and the Audio section - refers-to: audiofmt.ts (new); audioplayer.ts (new) createAudioPlayer; trim.ts (new) openTrim, honorTrim, isTrimming, moved out of editor.ts; viewer.ts showAudio, stopAudio, audioReady; types.ts MediaKind, the audio fields, LibrarySummary.audio, FilterName audio; store.ts LEGACY_SPECS audio, SortOrder duration; sidebar.ts, library.ts, grid.ts, infopanel.ts, organize.ts, pages.ts, importer.ts, libmanage.ts, curate.ts; icons-extra.ts audio, loop, volume, mute; styles/audio.css; tests/audio.test.ts - kind: feat diff --git a/frontend/index.html b/frontend/index.html index c7cf8a5..9c4b8b6 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -11,6 +11,7 @@ + diff --git a/frontend/src/engine/assetkinds.ts b/frontend/src/engine/assetkinds.ts new file mode 100644 index 0000000..b3bb720 --- /dev/null +++ b/frontend/src/engine/assetkinds.ts @@ -0,0 +1,93 @@ +import type { AssetFacts, Media, MediaKind } from "./types.js"; + +export const FILE_KINDS: readonly MediaKind[] = ["project", "document", "model", "resource", "sequence"]; + +export type KindIcon = "project" | "doc" | "cube" | "swatch" | "frames"; + +const KIND_ICONS: Record = { + project: "project", document: "doc", model: "cube", resource: "swatch", sequence: "frames", +}; + +const KIND_LABELS: Record = { + project: "Form project", document: "Document", model: "3D model", resource: "Design resource", sequence: "Image sequence", +}; + +const SUBKIND_LABELS: Record = { + font: "Font", lut: "Colour LUT", caption: "Captions", palette: "Palette", lottie: "Lottie animation", +}; + +const COUNT_LABELS: Record = { + pages: ["page", "pages"], frames: ["frame", "frames"], scenes: ["scene", "scenes"], slides: ["slide", "slides"], + sheets: ["sheet", "sheets"], tracks: ["track", "tracks"], layers: ["layer", "layers"], clips: ["clip", "clips"], +}; + +export function isFileKind(kind: string | null | undefined): boolean { + return !!kind && (FILE_KINDS as readonly string[]).includes(kind); +} + +export function kindIcon(kind: string): KindIcon | null { + return KIND_ICONS[kind] ?? null; +} + +export function kindLabel(kind: string, subkind?: string | null): string { + if (kind === "resource" && subkind && SUBKIND_LABELS[subkind]) return SUBKIND_LABELS[subkind]; + return KIND_LABELS[kind] ?? kind; +} + +function str(facts: AssetFacts, key: string): string { + const value = facts[key]; + return typeof value === "string" || typeof value === "number" ? String(value) : ""; +} + +export function countLine(counts: unknown): string { + if (!counts || typeof counts !== "object") return ""; + const parts: string[] = []; + for (const [key, value] of Object.entries(counts as Record)) { + if (typeof value !== "number" || !COUNT_LABELS[key]) continue; + const [one, many] = COUNT_LABELS[key]; + parts.push(`${value} ${value === 1 ? one : many}`); + } + return parts.join(" · "); +} + +export function appName(item: Pick): string { + if (item.kind !== "project") return ""; + return str(item.asset ?? {}, "app_name") || item.app_id || ""; +} + +export function openLabel(item: Pick): string { + const app = appName(item); + return app ? `Open in ${app}` : ""; +} + +function stampLabel(value: unknown): string { + if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return ""; + return new Date(value * 1000).toISOString().slice(0, 10); +} + +export type FactRow = [string, string]; + +export function projectFacts(facts: AssetFacts): FactRow[] { + return [ + ["App", str(facts, "app_name")], + ["Format version", str(facts, "format_version")], + ["Contents", countLine(facts.counts)], + ["Created", stampLabel(facts.created)], + ["Modified", stampLabel(facts.modified)], + ["Preview", facts.preview === "embedded" ? "From the file" : facts.preview === "app_icon" ? "App icon (the file carries no preview)" : ""], + ]; +} + +const FACTS: Record FactRow[]> = { project: projectFacts }; + +export function registerFacts(kind: string, fn: (facts: AssetFacts) => FactRow[]): void { + FACTS[kind] = fn; +} + +export function assetFacts(item: Pick): FactRow[] { + const facts = item.asset ?? {}; + const key = item.subkind && FACTS[`${item.kind}:${item.subkind}`] ? `${item.kind}:${item.subkind}` : item.kind; + const rows = FACTS[key]?.(facts) ?? []; + if (typeof facts.error === "string") rows.push(["Note", facts.error]); + return rows.filter(([, value]) => value !== ""); +} diff --git a/frontend/src/engine/store.ts b/frontend/src/engine/store.ts index b91d6cb..de3ba75 100644 --- a/frontend/src/engine/store.ts +++ b/frontend/src/engine/store.ts @@ -214,6 +214,7 @@ const LEGACY_SPECS: Record = { photos: { rules: [{ field: "flag", value: "photo" }] }, videos: { rules: [{ field: "flag", value: "video" }] }, audio: { rules: [{ field: "flag", value: "audio" }] }, + projects: { rules: [{ field: "flag", value: "project" }] }, screenshots: { rules: [{ field: "flag", value: "screenshot" }] }, screenrecs: { rules: [{ field: "flag", value: "screen_recording" }] }, not_in_album: { rules: [{ field: "flag", value: "not_in_album" }] }, diff --git a/frontend/src/engine/types.ts b/frontend/src/engine/types.ts index 9aee0b2..34e0a34 100644 --- a/frontend/src/engine/types.ts +++ b/frontend/src/engine/types.ts @@ -1,4 +1,6 @@ -export type MediaKind = "image" | "video" | "audio"; +export type MediaKind = "image" | "video" | "audio" | "project" | "document" | "model" | "resource" | "sequence"; + +export type AssetFacts = Record; export interface Media { id: number; @@ -70,6 +72,11 @@ export interface Media { track?: string | null; release_year?: number | null; has_cover?: number; + subkind?: string | null; + app_id?: string | null; + pages?: number | null; + preview_state?: number; + asset?: AssetFacts; edited_ts?: number | null; trim_in?: number | null; trim_out?: number | null; @@ -172,6 +179,11 @@ export interface LibrarySummary { photos: number; videos: number; audio: number; + projects?: number; + documents?: number; + models?: number; + resources?: number; + sequences?: number; screenshots: number; screenrecs: number; favorites: number; @@ -189,6 +201,11 @@ export type FilterName = | "photos" | "videos" | "audio" + | "projects" + | "documents" + | "models" + | "resources" + | "sequences" | "screenshots" | "screenrecs" | "not_in_album" diff --git a/frontend/src/styles/assets.css b/frontend/src/styles/assets.css new file mode 100644 index 0000000..b626f4d --- /dev/null +++ b/frontend/src/styles/assets.css @@ -0,0 +1,18 @@ +.stage-asset { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--space-4); overflow: auto; } +.stage-asset.hidden { display: none; } +.asset-panel { width: min(960px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border-radius: 14px; overflow: auto; } +.asset-head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; } +.asset-kind { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--glass-bg-2); color: var(--text-muted); flex: none; } +.asset-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; } +.asset-title { font-size: 17px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.asset-sub { font-size: 13px; color: var(--text-muted); } +.asset-preview { width: 100%; max-height: 56vh; object-fit: contain; border-radius: 10px; background: var(--glass-bg-2); } +.asset-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-3); font-size: 13px; } +.asset-fact { display: contents; } +.asset-fact-k { color: var(--text-faint); } +.asset-fact-v { color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; } +.asset-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); } +.asset-actions .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; } +@media (max-width: 560px) { + .asset-facts { grid-template-columns: 1fr; } +} diff --git a/frontend/src/ui/components/assetview.ts b/frontend/src/ui/components/assetview.ts new file mode 100644 index 0000000..d41eb20 --- /dev/null +++ b/frontend/src/ui/components/assetview.ts @@ -0,0 +1,56 @@ +import { api, fileUrl, thumbUrl } from "../../engine/api.js"; +import { assetFacts, kindIcon, kindLabel, openLabel } from "../../engine/assetkinds.js"; +import type { Media } from "../../engine/types.js"; +import { h } from "../dom.js"; +import { iconEl } from "../icons.js"; +import { toast } from "../toast.js"; + +export interface AssetView { + el: HTMLElement; + dispose: () => void; +} + +export type AssetBody = (item: Media, signal: AbortSignal) => HTMLElement | null; + +const BODIES: Record = {}; + +export function assetBody(key: string, body: AssetBody): void { + BODIES[key] = body; +} + +async function openInApp(item: Media): Promise { + try { + const done = await api<{ app: string; via: string }>(`/media/${item.id}/open-in-app`, { method: "POST" }); + toast(`Opening in ${done.app}`); + } catch (error) { + toast(error instanceof Error && error.message ? error.message : "The app could not be opened", "error"); + } +} + +function factsTable(item: Media): HTMLElement { + const rows = assetFacts(item).map(([label, value]) => + h("div", { class: "asset-fact" }, h("span", { class: "asset-fact-k" }, label), h("span", { class: "asset-fact-v" }, value))); + return h("div", { class: "asset-facts" }, ...rows); +} + +export function createAssetView(item: Media): AssetView { + const control = new AbortController(); + const icon = kindIcon(item.kind); + const actions = h("div", { class: "asset-actions" }); + const open = openLabel(item); + if (open) { + const btn = h("button", { class: "btn primary", type: "button" }, iconEl("launch"), open) as HTMLButtonElement; + btn.addEventListener("click", () => void openInApp(item), { signal: control.signal }); + actions.append(btn); + } + actions.append(h("a", { class: "btn", href: fileUrl(item.id), download: item.name }, iconEl("download"), "Download")); + const body = (BODIES[`${item.kind}:${item.subkind ?? ""}`] ?? BODIES[item.kind])?.(item, control.signal) ?? null; + const preview = body ?? h("img", { class: "asset-preview", alt: item.name, src: thumbUrl(item.id, 768), draggable: "false" }); + const head = h("div", { class: "asset-head" }, + icon ? h("span", { class: "asset-kind" }, iconEl(icon)) : h("span"), + h("div", { class: "asset-meta" }, + h("div", { class: "asset-title" }, item.title || item.name), + h("div", { class: "asset-sub" }, kindLabel(item.kind, item.subkind)))); + const el = h("div", { class: "asset-panel glass-panel" }, head, preview, factsTable(item), actions); + return { el, dispose: () => control.abort() }; +} diff --git a/frontend/src/ui/components/grid.ts b/frontend/src/ui/components/grid.ts index 0bd5e32..048e1a8 100644 --- a/frontend/src/ui/components/grid.ts +++ b/frontend/src/ui/components/grid.ts @@ -10,6 +10,7 @@ import { attachMarquee } from "../marquee.js"; import { toast } from "../toast.js"; import { addToAlbumFlow } from "./selectbar.js"; import { iconEl } from "../icons.js"; +import { kindIcon, kindLabel } from "../../engine/assetkinds.js"; // Deterministic 13-row preload. IntersectionObserver failed three ways on real // WKWebView (null roots, the lazy-attr veto, opaque callback scheduling), so @@ -335,9 +336,11 @@ export function tileFor(item: Media, context: () => number[], selectable = true, if (item.favorite) badges.append(h("span", { class: "fav-mark" }, iconEl("heartFill"))); if (item.kind === "video") badges.append(iconEl("video")); if (item.kind === "audio") badges.append(iconEl("audio")); + const badgeIcon = kindIcon(item.kind); + if (badgeIcon) badges.append(iconEl(badgeIcon)); if (item.kind === "image" && item.live_video_id) badges.append(h("span", { class: "live-chip" }, "LIVE")); const parts: HTMLElement[] = [img, badges]; - if ((item.kind === "video" || item.kind === "audio") && item.duration) { + if ((item.kind === "video" || item.kind === "audio" || item.kind === "sequence") && item.duration) { parts.push(h("span", { class: "tile-duration" }, formatDuration(item.duration))); } const tile = h("div", { class: "tile", "data-id": String(item.id) }, ...parts); @@ -359,6 +362,8 @@ export function tileFor(item: Media, context: () => number[], selectable = true, ]); }); if (item.kind === "audio") tile.append(h("span", { class: "kind-mark", title: "Audio" }, iconEl("audio"))); + const fileIcon = kindIcon(item.kind); + if (fileIcon) tile.append(h("span", { class: "kind-mark", title: kindLabel(item.kind, item.subkind) }, iconEl(fileIcon))); if (item.kind === "video") { tile.append(h("span", { class: "kind-mark", title: "Video" }, iconEl("video"))); let preview: HTMLVideoElement | null = null; diff --git a/frontend/src/ui/components/importer.ts b/frontend/src/ui/components/importer.ts index b173e27..f7186a9 100644 --- a/frontend/src/ui/components/importer.ts +++ b/frontend/src/ui/components/importer.ts @@ -2,6 +2,7 @@ import { api, apiUpload } from "../../engine/api.js"; import { countFmt, formatDuration } from "../../engine/format.js"; import { invalidateMedia, pollJob, refreshSummary } from "../../engine/store.js"; import { h } from "../dom.js"; +import { kindIcon } from "../../engine/assetkinds.js"; import { openModal } from "../modal.js"; import { iconEl } from "../icons.js"; import { toast } from "../toast.js"; @@ -117,8 +118,8 @@ export function mountImportPage(host: HTMLElement): () => void { const dropZone = h("div", { class: "drop-zone" }, iconEl("upload"), - h("div", { class: "drop-title" }, "Drop photos & videos here"), - h("div", { class: "drop-sub" }, "Single files or a whole selection; every image & video type. Imports run through the same pipeline: sha-deduped, HEIC decoded, posters generated.")); + h("div", { class: "drop-title" }, "Drop photos, videos & files here"), + h("div", { class: "drop-sub" }, "Single files or a whole selection: every image, video and audio type, Form projects, documents, 3D models and design resources. Imports run through the same pipeline: sha-deduped, HEIC decoded, previews made in the background.")); const MEDIA_DROP = new Set([ "jpg", "jpeg", "png", "heic", "heif", "gif", "webp", "tif", "tiff", "bmp", @@ -132,7 +133,7 @@ export function mountImportPage(host: HTMLElement): () => void { if (!list) return []; return [...list].filter((file) => { const ext = file.name.split(".").pop()?.toLowerCase() ?? ""; - return file.type.startsWith("image/") || file.type.startsWith("video/") || file.type.startsWith("audio/") || MEDIA_DROP.has(ext); + return file.type.startsWith("image/") || file.type.startsWith("video/") || file.type.startsWith("audio/") || MEDIA_DROP.has(ext) || (ext !== "" && ext !== file.name.toLowerCase()); }); } @@ -288,7 +289,7 @@ export function mountImportPage(host: HTMLElement): () => void { browseGrid.replaceChildren(...browseFiles.map((file) => { const tile = h("button", { class: "ptile", type: "button", "data-key": String(file.key), title: file.name }, h("img", { alt: file.name, draggable: "false" }), - h("span", { class: "ptile-ph" }, iconEl(file.kind === "video" ? "video" : file.kind === "audio" ? "audio" : "image")), + h("span", { class: "ptile-ph" }, iconEl(file.kind === "video" ? "video" : file.kind === "audio" ? "audio" : kindIcon(file.kind) ?? "image")), h("span", { class: "sel-dot" }, iconEl("check"))) as HTMLButtonElement; if ((file.kind === "video" || file.kind === "audio") && file.duration) tile.append(h("span", { class: "ptile-dur" }, formatDuration(file.duration))); tile.addEventListener("click", () => { diff --git a/frontend/src/ui/components/infopanel.ts b/frontend/src/ui/components/infopanel.ts index fec7078..5a5f5c7 100644 --- a/frontend/src/ui/components/infopanel.ts +++ b/frontend/src/ui/components/infopanel.ts @@ -1,5 +1,6 @@ import { api } from "../../engine/api.js"; import { audioSpecLine } from "../../engine/audiofmt.js"; +import { assetFacts, isFileKind, kindLabel } from "../../engine/assetkinds.js"; import { formatDuration, fullStamp, humanBytes } from "../../engine/format.js"; import { closeViewer, keywordState, loadKeywords, navigate, on, patched, saveMeta, state } from "../../engine/store.js"; import type { LookupResult, MediaDetails } from "../../engine/types.js"; @@ -45,8 +46,9 @@ function exposureLine(d: MediaDetails): string { function typeLine(d: MediaDetails): string { const flags: string[] = []; - if (d.kind === "video") flags.push("Video"); + if (d.kind === "video") flags.push(d.subkind === "camera_raw" ? "Camera raw video" : "Video"); else if (d.kind === "audio") flags.push("Audio"); + else if (isFileKind(d.kind)) flags.push(kindLabel(d.kind, d.subkind)); else if (d.live_video_id) flags.push("Live Photo"); else flags.push("Photo"); if (d.is_raw) flags.push("RAW"); @@ -159,6 +161,7 @@ export function createInfoPanel(onLocationEdit?: (id: number) => void, onDateEdi const rAlbum = row("Album"); const rGenre = row("Genre"); const rAudio = row("Audio"); + const assetBox = h("div", { class: "info-asset" }); const rImported = row("Imported"); const exifTable = h("div", { class: "exif-table" }); const exifToggle = h("button", { class: "link-btn", type: "button" }, "Show all metadata") as HTMLButtonElement; @@ -201,7 +204,7 @@ export function createInfoPanel(onLocationEdit?: (id: number) => void, onDateEdi section("Subjects", subjectList), ocrSection, rCaptured.wrap, rPlace.wrap, rCamera.wrap, rLens.wrap, rExposure.wrap, - rType.wrap, rFile.wrap, rDims.wrap, rSize.wrap, rDuration.wrap, rArtist.wrap, rAlbum.wrap, rGenre.wrap, rAudio.wrap, rImported.wrap, + rType.wrap, rFile.wrap, rDims.wrap, rSize.wrap, rDuration.wrap, rArtist.wrap, rAlbum.wrap, rGenre.wrap, rAudio.wrap, assetBox, rImported.wrap, section("Albums", albumList), section("Accessibility", altIn), exifToggle, exifTable, @@ -271,7 +274,9 @@ export function createInfoPanel(onLocationEdit?: (id: number) => void, onDateEdi setText(r.value, v); r.wrap.classList.toggle("hidden", !v); } - rDims.wrap.classList.toggle("hidden", d.kind === "audio"); + rDims.wrap.classList.toggle("hidden", d.kind === "audio" || (isFileKind(d.kind) && !(d.width && d.height))); + assetBox.replaceChildren(...assetFacts(d).map(([k, v]) => + h("div", { class: "info-row" }, h("span", { class: "info-k" }, k), h("span", { class: "info-v" }, v)))); setText(rImported.value, `${fullStamp(d.imported_ts)}${d.batch ? ` · ${d.batch.label ?? d.batch.source}` : ""}`); const exifRows = Object.entries(d.exif ?? {}).sort(([a], [b]) => a.localeCompare(b)); patchList(exifTable, exifRows, ([k]) => k, ([k, v]) => diff --git a/frontend/src/ui/components/library.ts b/frontend/src/ui/components/library.ts index 39f9643..f348014 100644 --- a/frontend/src/ui/components/library.ts +++ b/frontend/src/ui/components/library.ts @@ -15,6 +15,7 @@ const FILTER_LABELS: Record = { photos: "Photos", videos: "Videos", audio: "Audio", + projects: "Form Projects", screenshots: "Screenshots", screenrecs: "Screen Recordings", not_in_album: "Not in an Album", @@ -71,9 +72,9 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo const filterBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Filter" }, iconEl("sliders")); const menu = h("div", { class: "menu pop-surface hidden" }); const menuAnchor = h("div", { class: "menu-anchor" }, filterBtn, menu); - const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "screenshots", "not_in_album"]; + const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "screenshots", "not_in_album"]; const FILTER_ICONS: Partial> = { - all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", + all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", screenshots: "screenshot", not_in_album: "albumOff", }; for (const key of filterKeys) { @@ -149,6 +150,7 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo photos: state.summary.photos, videos: state.summary.videos, audio: state.summary.audio, + projects: state.summary.projects ?? 0, screenshots: state.summary.screenshots, screenrecs: state.summary.screenrecs, recently_viewed: state.summary.recently_viewed, diff --git a/frontend/src/ui/components/organize.ts b/frontend/src/ui/components/organize.ts index 344f91a..c1fb368 100644 --- a/frontend/src/ui/components/organize.ts +++ b/frontend/src/ui/components/organize.ts @@ -336,9 +336,10 @@ const RULE_FIELDS: Array<[string, string]> = [ ["album", "Album"], ["date", "Date"], ["recent_days", "In the last (days)"], ["filename", "Filename"], ["title", "Title"], ["caption", "Caption"], ["camera", "Camera"], ["lens", "Lens"], ["place", "Place"], ["text", "Text in photo"], ["subject", "Subject"], ["visual", "Looks like"], ["iso", "ISO"], ["aperture", "Aperture"], ["focal", "Focal length"], + ["app", "Form app"], ["format", "File format"], ["pages", "Pages or frames"], ]; const FLAG_VALUES: Array<[string, string]> = [ - ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["raw", "RAW"], ["live", "Live Photo"], + ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["raw", "RAW"], ["live", "Live Photo"], ["panorama", "Panorama"], ["selfie", "Selfie"], ["portrait", "Portrait"], ["slomo", "Slo-mo"], ["burst", "Burst"], ["screenshot", "Screenshot"], ["screen_recording", "Screen Recording"], ["edited", "Edited"], ["rejected", "Rejected"], ["located", "Has location"], ["not_located", "No location"], ["not_in_album", "Not in an album"], @@ -400,8 +401,8 @@ export function ruleEditor(rules: QueryRule[], onChange: () => void): HTMLElemen function opControl(rule: QueryRule): HTMLElement { const f = rule.field; - const opts = ["rating", "iso", "aperture", "focal"].includes(f) ? NUM_OPS - : ["filename", "title", "caption", "camera", "lens", "place", "text"].includes(f) ? TEXT_OPS + const opts = ["rating", "iso", "aperture", "focal", "pages"].includes(f) ? NUM_OPS + : ["filename", "title", "caption", "camera", "lens", "place", "text", "app", "format"].includes(f) ? TEXT_OPS : ["date", "recent_days"].includes(f) ? [["=", "is"] as [string, string]] : IS_OPS; const sel = select(opts, rule.op ?? opts[0][0]); rule.op = sel.value; @@ -532,7 +533,7 @@ export async function moveAlbumFlow(albumId: number): Promise { export function openQuickFilters(anchor: HTMLElement): void { const rect = anchor.getBoundingClientRect(); const flags: Array<[string, string]> = [ - ["favorite", "Favorites"], ["photo", "Photos"], ["video", "Videos"], ["audio", "Audio"], ["edited", "Edited"], ["raw", "RAW"], + ["favorite", "Favorites"], ["photo", "Photos"], ["video", "Videos"], ["audio", "Audio"], ["project", "Form projects"], ["edited", "Edited"], ["raw", "RAW"], ["not_rejected", "Hide rejected"], ["located", "With location"], ["has_keywords", "With keywords"], ["not_in_album", "Not in an album"], ]; const libs = ["personal_library", "shared_library"]; diff --git a/frontend/src/ui/components/pages.ts b/frontend/src/ui/components/pages.ts index 1992d7e..84172d6 100644 --- a/frontend/src/ui/components/pages.ts +++ b/frontend/src/ui/components/pages.ts @@ -72,7 +72,7 @@ interface MediaType { } const TYPE_ICONS: Record = { - video: "video", audio: "audio", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", + video: "video", audio: "audio", project: "project", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", burst: "stack", raw: "file", screenshot: "screenshot", screen_recording: "stage", timelapse: "clock", cinematic: "video", spatial: "cube", long_exposure: "wave", animated: "play", }; diff --git a/frontend/src/ui/components/sidebar.ts b/frontend/src/ui/components/sidebar.ts index 3d3791c..b0330d2 100644 --- a/frontend/src/ui/components/sidebar.ts +++ b/frontend/src/ui/components/sidebar.ts @@ -20,6 +20,7 @@ const PINNED: RowSpec[] = [ { label: "Recently Saved", icon: "save", hash: "#/f/recently_saved" }, { label: "Videos", icon: "video", hash: "#/f/videos" }, { label: "Audio", icon: "audio", hash: "#/f/audio" }, + { label: "Form Projects", icon: "project", hash: "#/f/projects" }, { label: "Screenshots", icon: "screenshot", hash: "#/f/screenshots" }, { label: "People", icon: "people", hash: "#/people" }, { label: "Memories", icon: "memory", hash: "#/memories" }, diff --git a/frontend/src/ui/components/viewer.ts b/frontend/src/ui/components/viewer.ts index 5718ac0..06cdf1c 100644 --- a/frontend/src/ui/components/viewer.ts +++ b/frontend/src/ui/components/viewer.ts @@ -1,6 +1,8 @@ import { api, fileUrl, stillUrl, thumbUrl } from "../../engine/api.js"; import { countFmt, timeLabel, dayLabel } from "../../engine/format.js"; import { closeViewer, dropFromCaches, markViewed, on, patched, saveMeta, setFavorite, state, stepViewer, trashMedia } from "../../engine/store.js"; +import { isFileKind } from "../../engine/assetkinds.js"; +import { createAssetView, type AssetView } from "./assetview.js"; import { createAudioPlayer, type AudioPlayer } from "./audioplayer.js"; import { createInfoPanel, type InfoPanel } from "./infopanel.js"; import type { Media } from "../../engine/types.js"; @@ -188,6 +190,8 @@ export function mountViewer(host: HTMLElement): void { let liveHolder: HTMLElement; let audioHolder: HTMLElement; let player: AudioPlayer | null = null; + let assetHolder: HTMLElement; + let assetView: AssetView | null = null; let liveBtn: HTMLButtonElement; let stripSlot: HTMLElement; let infoPanel: HTMLElement; @@ -238,7 +242,8 @@ export function mountViewer(host: HTMLElement): void { videoHolder = h("div", { class: "stage-video hidden" }); liveHolder = h("div", { class: "stage-video stage-live hidden" }); audioHolder = h("div", { class: "stage-audio hidden" }); - zoomLayer = h("div", { class: "zoom-layer" }, imgA, imgB, videoHolder, liveHolder, audioHolder); + assetHolder = h("div", { class: "stage-asset hidden" }); + zoomLayer = h("div", { class: "zoom-layer" }, imgA, imgB, videoHolder, liveHolder, audioHolder, assetHolder); zoomBox = h("div", { class: "zoom-box hidden" }); const media = h("div", { class: "stage-media" }, zoomLayer, zoomBox); const stage = h("div", { class: "viewer-stage" }, media); @@ -428,6 +433,23 @@ export function mountViewer(host: HTMLElement): void { player = null; audioHolder.classList.add("hidden"); audioHolder.replaceChildren(); + assetView?.dispose(); + assetView = null; + assetHolder.classList.add("hidden"); + assetHolder.replaceChildren(); + } + + function showAsset(item: Media): void { + mediaSeq++; + imgA.classList.remove("active"); + imgB.classList.remove("active"); + videoHolder.classList.add("hidden"); + videoHolder.replaceChildren(); + stopLive(); + stopAudio(); + assetView = createAssetView(item); + assetHolder.replaceChildren(assetView.el); + assetHolder.classList.remove("hidden"); } function showAudio(item: Media): void { @@ -491,6 +513,7 @@ export function mountViewer(host: HTMLElement): void { resetZoom(false); if (item.kind === "video") showVideo(id); else if (item.kind === "audio") showAudio(item); + else if (isFileKind(item.kind)) showAsset(item); else showImage(id, item.name); liveBtn.classList.toggle("hidden", !(item.kind === "image" && item.live_video_id)); diff --git a/frontend/src/ui/icons-extra.ts b/frontend/src/ui/icons-extra.ts index 4945a41..d955947 100644 --- a/frontend/src/ui/icons-extra.ts +++ b/frontend/src/ui/icons-extra.ts @@ -1,4 +1,9 @@ export const EXTRA_GLYPHS = { + project: '', + cube: '', + swatch: '', + frames: '', + launch: '', audio: '', loop: '', volume: '', diff --git a/frontend/tests/assets.test.ts b/frontend/tests/assets.test.ts new file mode 100644 index 0000000..e990934 --- /dev/null +++ b/frontend/tests/assets.test.ts @@ -0,0 +1,29 @@ +import { describe, expect, it } from "vitest"; +import { assetFacts, countLine, isFileKind, kindIcon, kindLabel, openLabel } from "../src/engine/assetkinds"; + +describe("Form project files", () => { + it("names the app to open in, only for projects", () => { + expect(openLabel({ kind: "project", app_id: "formcad", asset: { app_name: "FormCAD" } })).toBe("Open in FormCAD"); + expect(openLabel({ kind: "project", app_id: "formwav", asset: {} })).toBe("Open in formwav"); + expect(openLabel({ kind: "document", app_id: null, asset: {} })).toBe(""); + }); + + it("lists manifest facts and skips the empty ones", () => { + const rows = assetFacts({ + kind: "project", subkind: "formcad", pages: 4, + asset: { app_name: "FormCAD", format_version: 3, counts: { pages: 4, scenes: 1 }, created: 1767323045, preview: "app_icon" }, + }); + expect(rows).toEqual([ + ["App", "FormCAD"], ["Format version", "3"], ["Contents", "4 pages · 1 scene"], ["Created", "2026-01-02"], + ["Preview", "App icon (the file carries no preview)"], + ]); + expect(countLine({ frames: 1, bogus: 3 })).toBe("1 frame"); + }); + + it("knows which kinds are files", () => { + expect(isFileKind("project")).toBe(true); + expect(isFileKind("image")).toBe(false); + expect(kindIcon("project")).toBe("project"); + expect(kindLabel("project")).toBe("Form project"); + }); +}); From 92fed1dd92f4a4159c92a679f032101a34711baa Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:02:35 -0500 Subject: [PATCH 07/35] feat: more still and video formats, and numbered frames as one sequence 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. --- LICENSES.md | 3 +- README.md | 2 +- backend/HASHOUT_LOG.md | 17 ++ backend/app/routers/assets.py | 58 ++++- backend/app/routers/browse.py | 2 +- backend/app/routers/guard.py | 2 +- backend/app/routers/importer.py | 4 +- backend/app/routers/mediaapi.py | 16 +- backend/app/routers/system.py | 1 + backend/app/services/assetkinds.py | 3 +- backend/app/services/classify.py | 11 + backend/app/services/decode.py | 12 +- backend/app/services/gallerysvc.py | 17 +- backend/app/services/imagex.py | 308 +++++++++++++++++++++++++ backend/app/services/libraryfs.py | 40 +++- backend/app/services/outputsvc.py | 17 ++ backend/app/services/packagesvc.py | 9 + backend/app/services/query.py | 1 + backend/app/services/sequences.py | 218 +++++++++++++++++ backend/app/vaultcrypt.py | 6 +- backend/requirements.txt | 1 + backend/requirements_macos.txt | 1 + backend/tests/test_formats_extra.py | 234 +++++++++++++++++++ frontend/src/engine/assetkinds.ts | 24 +- frontend/src/engine/store.ts | 1 + frontend/src/ui/components/library.ts | 6 +- frontend/src/ui/components/organize.ts | 2 +- frontend/src/ui/components/pages.ts | 2 +- frontend/src/ui/components/viewer.ts | 5 + 29 files changed, 986 insertions(+), 37 deletions(-) create mode 100644 backend/app/services/imagex.py create mode 100644 backend/app/services/sequences.py create mode 100644 backend/tests/test_formats_extra.py diff --git a/LICENSES.md b/LICENSES.md index 7044cbb..53e6888 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -45,6 +45,7 @@ Adobe, Bridge, Lightroom and Photoshop are either registered trademarks or trade | pyobjc-core, pyobjc-framework-Cocoa, pyobjc-framework-ImageCaptureCore, pyobjc-framework-Quartz | MIT | Python bridge to Apple's ImageCaptureCore (the Photos.app device-import framework) for iPhone/iPad import + ImageIO thumbnail encode for the device browse grid; macOS only | | YuNet model | MIT | bundled via --add-data | | SFace model | Apache-2.0 | bundled via --add-data | +| resvg_py 0.5.0 | MIT (binding); resvg and its crates MIT OR Apache-2.0, with Zlib, BSD-2-Clause, BSD-3-Clause, Unlicense OR MIT, Apache-2.0 WITH LLVM-exception and Unicode-3.0 parts, read from the wheel's CycloneDX SBOM 2026-11-29 | SVG and SVGZ thumbnails and renders (services/imagex.py). One compiled library in the wheel, no system dependency; references resolve inside an empty folder | | pyzipper 0.4.0 | MIT | AES-256 (WinZip AE-2) zip writing and reading for encrypted share packages, services/packagesvc.py | | pycryptodomex (pyzipper dependency) | BSD-2-Clause and public domain | AES and HMAC under pyzipper | | LaMa inpainting (opencv/inpainting_lama, inpainting_lama_2025jan.onnx, revision aee6d22) | Apache-2.0 | Clean Up object removal in services/cleanup.py; fetched by the installers & build script, sha256-pinned, into backend/models; bundled via --add-data like the other models. Without it Clean Up falls back to OpenCV Telea | @@ -84,7 +85,7 @@ The Linux bundles also carry the build machine's WebKitGTK, GTK and GLib (LGPL-2 | Component | License | Decision | | --- | --- | --- | -| ffmpeg / ffprobe 7.1.5 | LGPL-2.1-or-later for the downloaded build; an installed one keeps its own licence | called as subprocess on PATH (video and audio probing, posters, waveforms, cover art, trims and loudness normalising); never copied into the bundle, keeping the .app proprietary-safe & the binary user-replaceable. When none is installed, the engine downloads the LGPL build (`--disable-gpl --disable-nonfree`; libopus and libvpx BSD-3-Clause) from the nodemode-dev/formai-binaries release on first run (builds made before the repository was renamed use the older name, nodemode-dev/formcut-binaries, which keeps working), checks every file's SHA-256 against `backend/app/ffmpeg_record.py`, and puts it first on PATH; its source is attached to that release | +| ffmpeg / ffprobe 7.1.5 | LGPL-2.1-or-later for the downloaded build; an installed one keeps its own licence | called as subprocess on PATH (video and audio probing, posters, waveforms, cover art, trims and loudness normalising; EXR, HDR, DPX, PSB and, when the build has libjxl, JPEG XL stills; frames of image sequences; VP8 and Opus playable copies of videos the window cannot play); never copied into the bundle, keeping the .app proprietary-safe & the binary user-replaceable. When none is installed, the engine downloads the LGPL build (`--disable-gpl --disable-nonfree`; libopus and libvpx BSD-3-Clause) from the nodemode-dev/formai-binaries release on first run (builds made before the repository was renamed use the older name, nodemode-dev/formcut-binaries, which keeps working), checks every file's SHA-256 against `backend/app/ffmpeg_record.py`, and puts it first on PATH; its source is attached to that release | | tesseract | Apache-2.0 | OCR for text search; same tier & reasoning as ffmpeg. brew install tesseract | | pymobiledevice3 (<8) | GPL-3.0-or-later | REMOVED from the bundle at zip v1.15.0: it had been collected into the frozen engine since v0.11.0 w/o a ledger row, & GPL is banned in anything we distribute. The AFC code path remains as an optional dev fallback that only activates if the user pip-installs the package themselves (never bundled); the native ImageCaptureCore path replaces it | diff --git a/README.md b/README.md index 1ae85cd..daa8d27 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@

Formats

- Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, 23 camera RAW extensions, video via ffmpeg, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP + Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 8f790c2..087caad 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -23,6 +23,23 @@ Sharing, packages and export strip all metadata from audio (ffmpeg -map_metadata The listen copy and the waveform cache are plain files. When an item becomes protected (hidden, trashed or in a private album) the vault's settle step deletes both before anything else, with or without a vault set up; sealing and deleting scrub the listen folder with the other caches, and the start-up sweep of vaulted items covers it. A protected item's listen copy is streamed from ffmpeg and never written. +### services/imagex.py, sequences.py, routers/assets.py play · more still and video formats, image sequences +- refers-to: imagex (new) EXTRA_EXTS, open_extra, extra_size, ffmpeg_still, parse_pfm, tonemap, psd_thumbnail, svg_size, sanitise_svg, render_svg, _spill; decode.open_image and image_size; classify IMAGE_EXTS, VIDEO_EXTS, CAMERA_RAW_VIDEO, SEQUENCE_EXTS, is_camera_raw_video; libraryfs.gather_items, import_item, import_one as_kind; sequences (new) FrameSequence, group, pack, import_sequence, extract, strip_location; importer start_import; outputsvc._copy_file_kind; packagesvc._payload; gallerysvc.file_download; routers/assets.py /media/{id}/play, play_path, play_command; mediaapi.inert_headers; guard._any_token /play and /page; vaultcrypt _scrub, _scrub_vaulted and _drop_plain_audio cover cache/play; query FLAGS sequence, camera_raw_video; mediaapi FILTERS sequences; summary sequences; tests/test_formats_extra.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +PSD, TGA, ICO and JPEG 2000 open through Pillow (PSD is its flattened composite; the Pillow wheel carries OpenJPEG). EXR and Radiance HDR are decoded by ffmpeg to PFM floats and tone mapped in numpy (Reinhard on the log-average luminance, then the sRGB curve), since a straight 8-bit conversion clips everything above 1.0. DPX goes through ffmpeg to PNG. PSB is version 2 of PSD, which Pillow refuses; ffmpeg's PSD decoder is tried, then the JPEG thumbnail the file keeps in image resource 1036 (or 1033), which is small but always flattened. JPEG XL needs a decoder: Pillow has none, and the plugin that adds one is GPL-3.0, so formDAM decodes JPEG XL only when the ffmpeg in use was built with libjxl (the LGPL build formDAM downloads was not checked for it); otherwise the item imports with a placeholder, and the macOS window, whose WebKit shows JPEG XL itself, can still open the original. Any other still Pillow cannot open is also tried through ffmpeg. + +ffmpeg's single-image pipe demuxers cannot size a lone frame read from stdin ("unspecified size"), so a still decoded from bytes (a sealed item, a sequence frame) is written to a mkstemp file in cache/tmp, read by ffmpeg and deleted in a finally block. The outputs for sealed timed items already take the same short-lived file route. + +SVG and SVGZ are rendered by resvg_py at the requested size, up to 4096 px on the long side. An empty resource folder does not stop resvg from loading an image href given as an absolute path (checked: a red PNG elsewhere on disk drew into the render), so every SVG is first rebuilt by imagex.sanitise_svg: a document with a DOCTYPE or ENTITY declaration is refused outright (the stdlib parser would expand internal entities, and refusing the DTD also refuses external ones), script and foreignObject are dropped, any element whose href or xlink:href is not a data: URI or a #fragment in the same document is removed (image, use, feImage, pattern and the rest), a style element with @import or a url() that is not data: or # is removed, and so is any attribute carrying such a url(). Processing instructions such as xml-stylesheet do not survive the parse. tests/test_formats_extra.py renders an absolute path, a file:// URL, an feImage, an @import and a style url() to the same local file and checks none of it appears. The original is never served as an active document: /media/{id}/file now sends Content-Security-Policy sandbox with default-src 'none' and nosniff for every mime that is not a plain raster, video or audio type, so an SVG, PDF, text or HTML-like file opened in a tab cannot run script on the engine's origin. + +MXF, MPEG and MPG, WMV, FLV and OGV are videos for ffprobe and ffmpeg like the others. A browser plays few of them, so the window, after the original fails, asks /media/{id}/play for a VP8 and Opus WebM copy at up to 1280 wide (realtime deadline, cpu-used 8), cached under cache/play, scrubbed with the other caches and never made for a protected item. R3D and BRAW are video items with subkind camera_raw and nothing probed: ffmpeg reads neither, so they are catalogued (name, size, dates, ratings and the rest) with the drawn poster, kept out of the face, CLIP and OCR jobs, and refused by /play. + +An image sequence is a folder's run of numbered frames with the same prefix, extension and digit count: EXR or DPX from two frames, PNG or TIFF from ten and only when the numbers have no gap, so a few numbered PNG photos stay photos. The frames are packed into one stored (uncompressed) zip named prefix.[first-last].ext.zip, with each member's date taken from the frame's mtime so the same folder hashes the same way twice, and imported as one item of kind sequence with the frame extension as subkind. A zip keeps every existing mechanism (hashing, the vault's sealing, trash, export, share) working on one file; export hands over the zip. Importing with move deletes the frames once the zip is in; reference imports still pack, since a folder cannot be referenced as one file. Dropped files are not grouped, only folder imports. + +The worker reads the first frame's header for size and rate (EXR dataWindow and framesPerSecond, DPX image size and the film or TV header frame rate) and decodes the middle frame for the preview; without a stated rate the clip is taken at 24 fps and the facts say so. Duration is frames over rate, and the frame count is the item's pages. When location must go, export, packages and shares rebuild the zip with each PNG or TIFF member passed through gpsscrub, since scrubbing the zip's own bytes would break the members' CRCs. Other file kinds are handed over unchanged: formDAM reads no location from them. + ### services/formapps.py, projectfile.py, assetwork.py, assetstore.py, assetkinds.py, cards.py · Form project files and file kinds - refers-to: data/form_apps.json (new); formapps.registry, extension_map, app_for_name, portal_binary, open_plan, open_in_app; projectfile.read_convention, summarise, extract; assetkinds.Extract, register, handler_for; assetwork.pending_ids, process, drain, requeue, kick, startup, stop; assetstore.preview_path, extra_path, keep_if_plain, save_image, save_json, load_json, read_capped; cards.app_icon, kind_card, text_page, swatches; classify.FILE_KINDS, VISUAL_KINDS, file_kind, is_file_kind, subkind_of; db.py migration 13 (ASSET_COLUMNS, idx_media_subkind) and media_dict asset; libraryfs.import_one; metasvc.apply; thumbs.ensure_thumb sealing, file_thumb, card_path; vaultcrypt.PLAIN_EXTRAS, _drop_plain_audio sealing, _settle; query FLAGS project and has_preview, TEXT_FIELDS app and format, NUM_FIELDS pages; mediaapi FILTERS projects; system summary projects; browse MEDIA_TYPES; importer upload check; gallerysvc.file_download and the gallery page; routers/assets.py (new) /form-apps, /media/{id}/open-in-app, /media/{id}/previews/refresh; the visual jobs now name image and video instead of leaving out audio; tests/test_form_projects.py - kind: feature diff --git a/backend/app/routers/assets.py b/backend/app/routers/assets.py index d4e7fa9..395a000 100644 --- a/backend/app/routers/assets.py +++ b/backend/app/routers/assets.py @@ -1,9 +1,16 @@ +import os +import secrets +import subprocess + from fastapi import APIRouter, HTTPException, Request +from ..config import cache_dir from ..db import q1 -from ..services import classify, formapps +from ..dedup.visual import ffmpeg_path +from ..services import assetstore, assetwork, classify, formapps, libraryfs from .files import _path from .guard import ensure_visible +from .revalidate import must_not_store, revalidated_file router = APIRouter() @@ -33,11 +40,56 @@ def open_in_app(media_id: int, request: Request): @router.post("/media/{media_id}/previews/refresh") def refresh_preview(media_id: int, request: Request): - from ..services import assetwork - row = q1("SELECT * FROM media WHERE id=?", (media_id,)) ensure_visible(row, request) if not classify.is_file_kind(row["kind"]): raise HTTPException(415, detail="Only files with a generated preview refresh it") assetwork.requeue(media_id) return {"ok": True} + + +PLAY_VER = 1 +PLAY_TIMEOUT = 3600 + + +def play_path(media_id: int) -> str: + folder = os.path.join(cache_dir(), "play") + os.makedirs(folder, exist_ok=True) + return os.path.join(folder, f"{media_id}_v{PLAY_VER}.webm") + + +def play_command(binary: str, src: str, out: str) -> list: + return [binary, "-hide_banner", "-loglevel", "error", "-y", "-i", src, "-map", "0:v:0", "-map", "0:a:0?", + "-vf", "scale='min(1280,iw)':-2", "-c:v", "libvpx", "-deadline", "realtime", "-cpu-used", "8", + "-b:v", "2500k", "-c:a", "libopus", "-b:a", "128k", "-f", "webm", out] + + +@router.get("/media/{media_id}/play") +def media_play(media_id: int, request: Request): + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + ensure_visible(row, request) + if row["kind"] != "video" or row["subkind"] == "camera_raw": + raise HTTPException(415, detail="Only videos ffmpeg can decode have a playable copy") + if must_not_store(row): + raise HTTPException(409, detail="Protected videos play from the original only") + binary = ffmpeg_path() + if not binary: + raise HTTPException(409, detail="ffmpeg is needed to play this format") + src = libraryfs.abs_path(row["rel_path"]) + if not os.path.isfile(src): + raise HTTPException(404, detail="Original file missing on disk") + out = play_path(media_id) + if not os.path.isfile(out): + tmp = f"{out}.{secrets.token_hex(4)}.part" + try: + done = subprocess.run(play_command(binary, src, tmp), capture_output=True, timeout=PLAY_TIMEOUT) + if done.returncode != 0 or not os.path.isfile(tmp) or os.path.getsize(tmp) == 0: + raise HTTPException(500, detail="ffmpeg could not make a playable copy of this video") + os.replace(tmp, out) + if not assetstore.keep_if_plain(media_id, out): + raise HTTPException(409, detail="This item was protected while it was prepared") + except subprocess.TimeoutExpired as exc: + raise HTTPException(504, detail="Making a playable copy took too long") from exc + finally: + assetstore.discard(tmp) + return revalidated_file(request, out, "video/webm") diff --git a/backend/app/routers/browse.py b/backend/app/routers/browse.py index 93b4857..b3f3544 100644 --- a/backend/app/routers/browse.py +++ b/backend/app/routers/browse.py @@ -11,7 +11,7 @@ router = APIRouter() MEDIA_TYPES = [ - ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), + ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("sequence", "Image sequences"), ("camera_raw_video", "Camera raw video"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), ("panorama", "Panoramas"), ("timelapse", "Time-lapse"), ("slomo", "Slo-mo"), ("cinematic", "Cinematic"), ("burst", "Bursts"), ("spatial", "Spatial"), ("long_exposure", "Long Exposure"), ("animated", "Animated"), ("raw", "RAW"), ("screenshot", "Screenshots"), ("screen_recording", "Screen Recordings"), diff --git a/backend/app/routers/guard.py b/backend/app/routers/guard.py index d531aa5..e6ef8cf 100644 --- a/backend/app/routers/guard.py +++ b/backend/app/routers/guard.py @@ -11,7 +11,7 @@ def token_of(request: Request) -> str: def _any_token(request: Request, scope: str) -> bool: tokens = [token_of(request)] - if request.url.path.endswith(("/thumb", "/file", "/render", "/listen")): + if request.url.path.endswith(("/thumb", "/file", "/render", "/listen", "/play", "/page")): tokens += [value for name, value in request.cookies.items() if name == "dam_vt" or name.startswith("dam_at_")] return any(check_token(token, scope) for token in tokens if token) diff --git a/backend/app/routers/importer.py b/backend/app/routers/importer.py index 4629fa7..b046174 100644 --- a/backend/app/routers/importer.py +++ b/backend/app/routers/importer.py @@ -36,12 +36,12 @@ def run(state: Dict[str, Any]) -> None: state["counts"] = counts files = [] for target in targets: - files.extend(libraryfs.gather_media(target)) + files.extend(libraryfs.gather_items(target)) counts["found"] = len(files) libraryfs.begin_batch("folder", ", ".join(os.path.basename(t.rstrip(os.sep)) or t for t in targets)) for path in files: try: - result = libraryfs.import_one(path, move=body.move and not body.reference, reference=body.reference) + result = libraryfs.import_item(path, move=body.move and not body.reference, reference=body.reference) except Exception: counts["failed"] += 1 continue diff --git a/backend/app/routers/mediaapi.py b/backend/app/routers/mediaapi.py index 7e12955..ea6daf3 100644 --- a/backend/app/routers/mediaapi.py +++ b/backend/app/routers/mediaapi.py @@ -22,6 +22,7 @@ "videos": ("AND kind='video'", "created_ts DESC, id DESC"), "audio": ("AND kind='audio'", "created_ts DESC, id DESC"), "projects": ("AND kind='project'", "created_ts DESC, id DESC"), + "sequences": ("AND kind='sequence'", "created_ts DESC, id DESC"), "screenshots": ("AND is_screenshot=1", "created_ts DESC, id DESC"), "screenrecs": ("AND is_screen_rec=1", "created_ts DESC, id DESC"), "not_in_album": ("AND id NOT IN (SELECT media_id FROM album_items)", "created_ts DESC, id DESC"), @@ -231,6 +232,16 @@ def _parse_range(header: str, size: int) -> Optional[Tuple[int, int]]: return start, end +PLAIN_MIMES = ("image/jpeg", "image/png", "image/gif", "image/webp", "image/avif", "image/bmp") + + +def inert_headers(mime: str) -> dict: + if mime and (mime in PLAIN_MIMES or mime.startswith(("video/", "audio/"))): + return {} + return {"Content-Security-Policy": "sandbox; default-src 'none'; img-src data:; style-src 'unsafe-inline'", + "X-Content-Type-Options": "nosniff"} + + @router.get("/media/{media_id}/file") def media_file(media_id: int, request: Request): row = q1("SELECT * FROM media WHERE id=?", (media_id,)) @@ -247,10 +258,11 @@ def reader(start: int, end: int) -> Iterator[bytes]: return sealed.iter_range(start, end) if sealed is not None else _iter_range(path, start, end) range_header = request.headers.get("range") + extra = inert_headers(row["mime"]) if guarded: - headers = {"Accept-Ranges": "bytes", "Cache-Control": NO_STORE} + headers = {"Accept-Ranges": "bytes", "Cache-Control": NO_STORE, **extra} else: - headers = revalidated_headers(file_tag(path), {"Accept-Ranges": "bytes"}) + headers = revalidated_headers(file_tag(path), {"Accept-Ranges": "bytes", **extra}) if not range_header and tag_matches(request, headers["ETag"]): return Response(status_code=304, headers=headers) if range_header: diff --git a/backend/app/routers/system.py b/backend/app/routers/system.py index 7d0a345..b90d643 100644 --- a/backend/app/routers/system.py +++ b/backend/app/routers/system.py @@ -106,6 +106,7 @@ def count(sql: str) -> int: "videos": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='video'"), "audio": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='audio'"), "projects": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='project'"), + "sequences": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='sequence'"), "screenshots": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screenshot=1"), "screenrecs": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screen_rec=1"), "favorites": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND favorite=1"), diff --git a/backend/app/services/assetkinds.py b/backend/app/services/assetkinds.py index ef40884..72e2a84 100644 --- a/backend/app/services/assetkinds.py +++ b/backend/app/services/assetkinds.py @@ -38,6 +38,7 @@ def _load() -> None: if _loaded["done"]: return _loaded["done"] = True - from . import projectfile + from . import projectfile, sequences register("project", projectfile.extract) + register("sequence", sequences.extract) diff --git a/backend/app/services/classify.py b/backend/app/services/classify.py index cade7d4..81549dc 100644 --- a/backend/app/services/classify.py +++ b/backend/app/services/classify.py @@ -11,11 +11,18 @@ "rwl": "image/x-leica-rwl", "pef": "image/x-pentax-pef", "srw": "image/x-samsung-srw", "x3f": "image/x-sigma-x3f", "3fr": "image/x-hasselblad-3fr", "iiq": "image/x-phaseone-iiq", "erf": "image/x-epson-erf", "kdc": "image/x-kodak-kdc", "dcr": "image/x-kodak-dcr", "mos": "image/x-leaf-mos", "mrw": "image/x-minolta-mrw", + "psd": "image/vnd.adobe.photoshop", "psb": "image/vnd.adobe.photoshop", "exr": "image/x-exr", "hdr": "image/vnd.radiance", + "jxl": "image/jxl", "svg": "image/svg+xml", "svgz": "image/svg+xml", "tga": "image/x-tga", "dpx": "image/x-dpx", + "jp2": "image/jp2", "j2k": "image/jp2", "ico": "image/vnd.microsoft.icon", } VIDEO_EXTS = { "mp4": "video/mp4", "mov": "video/quicktime", "m4v": "video/x-m4v", "webm": "video/webm", "mkv": "video/x-matroska", "avi": "video/x-msvideo", "mts": "video/mp2t", "3gp": "video/3gpp", + "mxf": "application/mxf", "mpeg": "video/mpeg", "mpg": "video/mpeg", "wmv": "video/x-ms-wmv", "flv": "video/x-flv", + "ogv": "video/ogg", "r3d": "video/x-red-r3d", "braw": "video/x-blackmagic-raw", } +CAMERA_RAW_VIDEO = {"r3d", "braw"} +SEQUENCE_EXTS = {"exr", "dpx", "png", "tif", "tiff"} AUDIO_EXTS = { "mp3": "audio/mpeg", "m4a": "audio/mp4", "aac": "audio/aac", "wav": "audio/wav", "aiff": "audio/aiff", "aif": "audio/aiff", "flac": "audio/flac", "ogg": "audio/ogg", "oga": "audio/ogg", "opus": "audio/ogg", @@ -59,6 +66,10 @@ def file_kind(name: str): return None +def is_camera_raw_video(name: str) -> bool: + return ext_of(name) in CAMERA_RAW_VIDEO + + def is_file_kind(kind) -> bool: return kind in FILE_KINDS diff --git a/backend/app/services/decode.py b/backend/app/services/decode.py index 5cfe3ca..136d6b4 100644 --- a/backend/app/services/decode.py +++ b/backend/app/services/decode.py @@ -5,7 +5,7 @@ from PIL import Image, ImageOps from .. import mediacodecs -from . import rawdev +from . import imagex, rawdev RAW_EXTS = { "dng", "cr2", "cr3", "crw", "nef", "nrw", "arw", "srf", "sr2", "raf", "orf", "rw2", "rwl", "pef", @@ -100,6 +100,10 @@ def open_image(src: Source, name: str, max_long: Optional[int] = None, develop: img = _raw_full(raw, max_long, raw_opts) except Exception: return None + elif ext_of(name) in imagex.EXTRA_EXTS: + img = imagex.open_extra(src, name, max_long) + if img is None: + return None else: try: img = Image.open(io.BytesIO(src) if isinstance(src, (bytes, bytearray)) else src) @@ -107,7 +111,9 @@ def open_image(src: Source, name: str, max_long: Optional[int] = None, develop: img.draft("RGB", (max_long * 2, max_long * 2)) img = ImageOps.exif_transpose(img) except Exception: - return None + img = imagex.ffmpeg_still(src, ext_of(name)) + if img is None: + return None if img.mode not in ("RGB", "RGBA"): img = img.convert("RGBA" if "A" in img.getbands() else "RGB") if max_long and max(img.size) > max_long: @@ -118,6 +124,8 @@ def open_image(src: Source, name: str, max_long: Optional[int] = None, develop: def image_size(path: str, name: str) -> Optional[Tuple[int, int]]: if is_raw(name): return raw_size(path) + if ext_of(name) in imagex.EXTRA_EXTS: + return imagex.extra_size(path, name) mediacodecs.register() try: with Image.open(path) as img: diff --git a/backend/app/services/gallerysvc.py b/backend/app/services/gallerysvc.py index fd2f155..8395b35 100644 --- a/backend/app/services/gallerysvc.py +++ b/backend/app/services/gallerysvc.py @@ -57,14 +57,25 @@ def _cut_timed(ff: str, row, src: str, tmp: str, strip: bool) -> bool: def file_download(row, src: str, keep_location: bool) -> Optional[str]: - return src if os.path.isfile(src) else None + if not os.path.isfile(src): + return None + if keep_location or row["kind"] != "sequence": + return src + from . import sequences + + folder = os.path.join(cache_dir(), "share") + os.makedirs(folder, exist_ok=True) + out = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_noloc.zip") + if not os.path.isfile(out): + tmp = f"{out}.part" + sequences.strip_location(src, tmp) + os.replace(tmp, out) + return out def download_path(share, media_id: int) -> Optional[str]: from . import libraryfs - from . import classify - row = q1("SELECT * FROM media WHERE id=?", (media_id,)) src = libraryfs.abs_path(row["rel_path"]) if classify.is_file_kind(row["kind"]): diff --git a/backend/app/services/imagex.py b/backend/app/services/imagex.py new file mode 100644 index 0000000..5be7416 --- /dev/null +++ b/backend/app/services/imagex.py @@ -0,0 +1,308 @@ +import io +import logging +import os +import re +import struct +import subprocess +import tempfile +from typing import Optional, Tuple, Union + +import numpy as np +from PIL import Image + +from ..dedup.visual import ffmpeg_path + +logger = logging.getLogger(__name__) + +Source = Union[str, bytes] +FLOAT_STILLS = {"exr", "hdr"} +FFMPEG_STILLS = {"exr", "hdr", "dpx", "jxl", "psb"} +VECTOR = {"svg", "svgz"} +EXTRA_EXTS = FFMPEG_STILLS | VECTOR +DECODE_TIMEOUT = 120 +SVG_DEFAULT = 1024 +SVG_MAX = 4096 +PSB_THUMB_IDS = (1036, 1033) +SVG_TAG = re.compile(rb"]*>", re.IGNORECASE | re.DOTALL) +SVG_ATTR = re.compile(rb'\b(width|height|viewBox)\s*=\s*["\']([^"\']*)["\']', re.IGNORECASE) + + +def ext_of(name: str) -> str: + return os.path.splitext(name)[1].lstrip(".").lower() + + +def _bytes(src: Source) -> bytes: + if isinstance(src, (bytes, bytearray)): + return bytes(src) + with open(src, "rb") as handle: + return handle.read() + + +def _spill(data: bytes, ext: str) -> str: + from ..config import cache_dir + + folder = os.path.join(cache_dir(), "tmp") + os.makedirs(folder, exist_ok=True) + fd, path = tempfile.mkstemp(dir=folder, suffix=f".{ext or 'bin'}") + with os.fdopen(fd, "wb") as handle: + handle.write(data) + return path + + +def _run_ffmpeg(output: list, src: Source, ext: str = "") -> Optional[bytes]: + binary = ffmpeg_path() + if not binary: + return None + spilled = _spill(bytes(src), ext) if isinstance(src, (bytes, bytearray)) else None + try: + cmd = [binary, "-hide_banner", "-loglevel", "error", "-i", spilled or src, *output] + done = subprocess.run(cmd, capture_output=True, timeout=DECODE_TIMEOUT) + except (OSError, subprocess.SubprocessError): + return None + finally: + if spilled: + try: + os.unlink(spilled) + except OSError: + pass + return done.stdout if done.returncode == 0 and done.stdout else None + + +def parse_pfm(data: bytes) -> Optional[np.ndarray]: + parts = data.split(b"\n", 3) + if len(parts) < 4 or parts[0] not in (b"PF", b"Pf"): + return None + try: + width, height = (int(v) for v in parts[1].split()) + scale = float(parts[2]) + except ValueError: + return None + channels = 3 if parts[0] == b"PF" else 1 + order = "f4" + count = width * height * channels + body = np.frombuffer(parts[3][: count * 4], dtype=order) + if body.size != count: + return None + return np.flipud(body.reshape(height, width, channels)) + + +def tonemap(linear: np.ndarray) -> Image.Image: + rgb = np.nan_to_num(np.clip(linear.astype(np.float32), 0, None)) + if rgb.shape[2] == 1: + rgb = np.repeat(rgb, 3, axis=2) + luminance = 0.2126 * rgb[..., 0] + 0.7152 * rgb[..., 1] + 0.0722 * rgb[..., 2] + key = float(np.exp(np.mean(np.log(luminance + 1e-6)))) + scaled = rgb * (0.18 / max(key, 1e-6)) + mapped = scaled / (1.0 + scaled) + encoded = np.where(mapped <= 0.0031308, mapped * 12.92, 1.055 * np.power(mapped, 1 / 2.4) - 0.055) + return Image.fromarray((np.clip(encoded, 0, 1) * 255 + 0.5).astype(np.uint8), "RGB") + + +def _float_still(src: Source, ext: str) -> Optional[Image.Image]: + data = _run_ffmpeg(["-frames:v", "1", "-f", "image2pipe", "-c:v", "pfm", "-pix_fmt", "gbrpf32le", "pipe:1"], src, ext) + pixels = parse_pfm(data) if data else None + return tonemap(pixels) if pixels is not None else None + + +def ffmpeg_still(src: Source, ext: str = "") -> Optional[Image.Image]: + data = _run_ffmpeg(["-frames:v", "1", "-f", "image2pipe", "-c:v", "png", "pipe:1"], src, ext) + if not data: + return None + try: + with Image.open(io.BytesIO(data)) as img: + img.load() + return img.convert("RGBA" if "A" in img.getbands() else "RGB") + except Exception: + return None + + +def psd_thumbnail(data: bytes) -> Optional[Image.Image]: + if len(data) < 30 or data[:4] != b"8BPS": + return None + pos = 26 + pos += 4 + struct.unpack_from(">I", data, pos)[0] + if pos + 4 > len(data): + return None + end = pos + 4 + struct.unpack_from(">I", data, pos)[0] + pos += 4 + while pos + 12 <= min(end, len(data)): + if data[pos:pos + 4] != b"8BIM": + return None + ident = struct.unpack_from(">H", data, pos + 4)[0] + name_len = data[pos + 6] + pos += 6 + 1 + name_len + ((1 + name_len) % 2) + size = struct.unpack_from(">I", data, pos)[0] + pos += 4 + if ident in PSB_THUMB_IDS and size > 28: + try: + with Image.open(io.BytesIO(data[pos + 28:pos + size])) as img: + img.load() + return img.convert("RGB") + except Exception: + return None + pos += size + (size % 2) + return None + + +def svg_size(data: bytes) -> Optional[Tuple[int, int]]: + head = data[:8192] + if head[:2] == b"\x1f\x8b": + import gzip + + try: + head = gzip.decompress(data)[:8192] + except OSError: + return None + tag = SVG_TAG.search(head) + if not tag: + return None + attrs = {key.decode().lower(): value.decode("utf-8", "replace") for key, value in SVG_ATTR.findall(tag.group(0))} + + def number(raw: str) -> Optional[float]: + match = re.match(r"\s*([0-9.]+)\s*(px)?\s*$", raw or "") + return float(match.group(1)) if match else None + + width, height = number(attrs.get("width", "")), number(attrs.get("height", "")) + if (not width or not height) and attrs.get("viewbox"): + bits = re.split(r"[\s,]+", attrs["viewbox"].strip()) + if len(bits) == 4: + try: + width, height = float(bits[2]), float(bits[3]) + except ValueError: + return None + if not width or not height: + return None + return int(round(width)), int(round(height)) + + +SVG_DTD = re.compile(rb" bool: + ref = value.strip() + return ref.startswith("#") or ref.lower().startswith("data:") + + +def _css_is_local(text: str) -> bool: + return not CSS_IMPORT.search(text) and all(_local_ref(found) for found in CSS_URL.findall(text)) + + +def _local_name(tag: str) -> str: + return tag.rsplit("}", 1)[-1].lower() if isinstance(tag, str) else "" + + +def _clean_element(node) -> None: + for child in list(node): + if _drop_child(child): + node.remove(child) + else: + _clean_element(child) + for key, value in list(node.attrib.items()): + name = _local_name(key) + if name == "href" and not _local_ref(value): + del node.attrib[key] + elif "url(" in value.lower() and not _css_is_local(value): + del node.attrib[key] + + +def _drop_child(child) -> bool: + name = _local_name(child.tag) + if name in ("script", "foreignobject"): + return True + if name == "style" and not _css_is_local("".join(child.itertext())): + return True + hrefs = [v for k, v in child.attrib.items() if _local_name(k) == "href"] + return any(not _local_ref(v) for v in hrefs) + + +def sanitise_svg(data: bytes) -> Optional[bytes]: + import xml.etree.ElementTree as ET + + if SVG_DTD.search(data): + return None + try: + root = ET.fromstring(data) + except ET.ParseError: + return None + if _local_name(root.tag) != "svg": + return None + _clean_element(root) + for key, value in list(root.attrib.items()): + if _local_name(key) == "href" and not _local_ref(value): + del root.attrib[key] + return ET.tostring(root) + + +def render_svg(data: bytes, max_long: Optional[int]) -> Optional[Image.Image]: + try: + import resvg_py + except ImportError: + return None + size = svg_size(data) or (SVG_DEFAULT, SVG_DEFAULT) + target = min(max_long or max(size), SVG_MAX) + scale = target / max(size) + width = max(1, int(round(size[0] * scale))) + with tempfile.TemporaryDirectory(prefix="dam-svg-") as empty: + try: + if data[:2] == b"\x1f\x8b": + import gzip + + data = gzip.decompress(data) + safe = sanitise_svg(data) + if safe is None: + return None + png = resvg_py.svg_to_bytes(svg_string=safe.decode("utf-8", "replace"), width=width, resources_dir=empty) + except (ValueError, OSError, UnicodeError) as exc: + logger.info("svg render failed: %s", exc) + return None + try: + with Image.open(io.BytesIO(bytes(png))) as img: + img.load() + return img.convert("RGBA") + except Exception: + return None + + +def open_extra(src: Source, name: str, max_long: Optional[int] = None) -> Optional[Image.Image]: + ext = ext_of(name) + if ext in VECTOR: + return render_svg(_bytes(src), max_long) + if ext in FLOAT_STILLS: + img = _float_still(src, ext) + elif ext == "psb": + data = _bytes(src) + img = ffmpeg_still(data, ext) or psd_thumbnail(data) + else: + img = ffmpeg_still(src, ext) + if img is not None and max_long and max(img.size) > max_long: + img.thumbnail((max_long, max_long), Image.Resampling.LANCZOS) + return img + + +def extra_size(path: str, name: str) -> Optional[Tuple[int, int]]: + ext = ext_of(name) + if ext in VECTOR: + try: + with open(path, "rb") as handle: + return svg_size(handle.read(65536)) + except OSError: + return None + if ext == "psb": + try: + with open(path, "rb") as handle: + head = handle.read(26) + if head[:4] == b"8BPS": + height, width = struct.unpack_from(">II", head, 14) + return width, height + except OSError: + return None + from . import mediainfo + + data = mediainfo.probe(path) + stream = (data or {}).get("streams", [{}]) + first = stream[0] if stream else {} + if first.get("width") and first.get("height"): + return int(first["width"]), int(first["height"]) + return None diff --git a/backend/app/services/libraryfs.py b/backend/app/services/libraryfs.py index 4773e1e..4828ab0 100644 --- a/backend/app/services/libraryfs.py +++ b/backend/app/services/libraryfs.py @@ -4,7 +4,7 @@ import threading import time from datetime import datetime -from typing import Any, Dict, List +from typing import Any, Dict, List, Optional, Tuple from ..config import originals_dir from ..db import ex, q1 @@ -24,22 +24,37 @@ def sha256_of(path: str) -> str: return digest.hexdigest() -def gather_media(root: str) -> List[str]: - found: List[str] = [] +def gather_items(root: str) -> List[Any]: + from . import sequences + + found: List[Any] = [] if os.path.isfile(root): kind, _ = classify.media_kind(os.path.basename(root)) return [root] if kind else [] for base, dirs, names in os.walk(root): dirs[:] = [d for d in dirs if not d.startswith(".")] - for name in names: - if name.startswith("."): - continue + visible = sorted(name for name in names if not name.startswith(".")) + groups, singles = sequences.group(base, visible) + found.extend(groups) + for name in singles: kind, _ = classify.media_kind(name) if kind: found.append(os.path.join(base, name)) return found +def gather_media(root: str) -> List[str]: + return [item for item in gather_items(root) if isinstance(item, str)] + + +def import_item(item: Any, move: bool = False, reference: bool = False) -> Dict[str, Any]: + from . import sequences + + if isinstance(item, sequences.FrameSequence): + return sequences.import_sequence(item, move=move) + return import_one(item, move=move, reference=reference) + + def _dest_for(created_ts: float, name: str) -> str: stamp = datetime.fromtimestamp(created_ts) folder = os.path.join(originals_dir(), f"{stamp.year:04d}", f"{stamp.month:02d}") @@ -53,9 +68,10 @@ def _dest_for(created_ts: float, name: str) -> str: return candidate -def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[str, Any]: +def import_one(path: str, move: bool = False, reference: bool = False, + as_kind: Optional[Tuple[str, str, str]] = None) -> Dict[str, Any]: name = os.path.basename(path) - kind, mime = classify.media_kind(name) + kind, mime = (as_kind[0], as_kind[1]) if as_kind else classify.media_kind(name) if not kind: return {"status": "skipped-kind"} size = os.path.getsize(path) @@ -72,6 +88,8 @@ def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[s width, height, exif_ts = mediainfo.image_meta(path) elif kind == "audio": duration, exif_ts = mediainfo.audio_meta(path) + elif classify.is_camera_raw_video(name): + pass else: width, height, duration, exif_ts = mediainfo.video_meta(path) if width is None and mediainfo.sound_only(path): @@ -101,10 +119,12 @@ def import_one(path: str, move: bool = False, reference: bool = False) -> Dict[s ) if reference: ex("UPDATE media SET referenced=1 WHERE id=?", (media_id,)) - if kind not in classify.VISUAL_KINDS: + if kind not in classify.VISUAL_KINDS or classify.is_camera_raw_video(name): ex("UPDATE media SET face_state=2, clip_state=2, ocr_text='' WHERE id=?", (media_id,)) + if classify.is_camera_raw_video(name): + ex("UPDATE media SET subkind='camera_raw' WHERE id=?", (media_id,)) if classify.is_file_kind(kind): - subkind = classify.subkind_of(name) + subkind = as_kind[2] if as_kind else classify.subkind_of(name) app = subkind if kind == "project" else None ex("UPDATE media SET subkind=?, app_id=?, preview_state=0 WHERE id=?", (subkind, app, media_id)) batch_id = getattr(_batch, "id", None) diff --git a/backend/app/services/outputsvc.py b/backend/app/services/outputsvc.py index 46fcaea..352b84c 100644 --- a/backend/app/services/outputsvc.py +++ b/backend/app/services/outputsvc.py @@ -114,6 +114,11 @@ def _copy_stripped(src: Any, target: str, row, opts: Dict[str, Any]) -> None: return if opts.get("metadata") == "none": raise ExportError(f"{row['name']}: an unmodified original keeps its metadata; export it as a rendered copy to leave the metadata out") + from . import classify + + if classify.is_file_kind(row["kind"]): + _copy_file_kind(src, target, row) + return if isinstance(src, (bytes, bytearray)): data = bytes(src) else: @@ -128,6 +133,18 @@ def _copy_stripped(src: Any, target: str, row, opts: Dict[str, Any]) -> None: raise ExportError(f"{row['name']}: location could not be removed from this original") +def _copy_file_kind(src: Any, target: str, row) -> None: + from . import sequences + + if row["kind"] == "sequence": + sequences.strip_location(src, target) + elif isinstance(src, (bytes, bytearray)): + with open(target, "wb") as fh: + fh.write(src) + else: + shutil.copy2(src, target) + + def export_one(row, dest: str, seq: int, opts: Dict[str, Any], taken: set) -> Optional[str]: from ..routers.render import source_of diff --git a/backend/app/services/packagesvc.py b/backend/app/services/packagesvc.py index 17db17c..4b4ee84 100644 --- a/backend/app/services/packagesvc.py +++ b/backend/app/services/packagesvc.py @@ -161,6 +161,15 @@ def _payload(row, include_location: bool, work: str) -> Dict[str, Any]: if strip_timed(row, src, target): return {"path": target, "name": row["name"], "converted": False} raise PackageError(f"{row['name']}: location could not be removed from this {row['kind']} item (ffmpeg is needed)") + if row["kind"] == "sequence": + from . import sequences + + sequences.strip_location(src, target) + return {"path": target, "name": row["name"], "converted": False} + from . import classify + + if classify.is_file_kind(row["kind"]): + return {"path": src, "name": row["name"], "converted": False} with open(src, "rb") as handle: clean = gpsscrub.scrub(handle.read()) with open(target, "wb") as handle: diff --git a/backend/app/services/query.py b/backend/app/services/query.py index 6cd065d..bb4fede 100644 --- a/backend/app/services/query.py +++ b/backend/app/services/query.py @@ -31,6 +31,7 @@ FLAGS = { "favorite": "m.favorite=1", "photo": "m.kind='image'", "video": "m.kind='video'", "audio": "m.kind='audio'", "project": "m.kind='project'", "has_preview": "m.preview_state=1", + "sequence": "m.kind='sequence'", "camera_raw_video": "m.subkind='camera_raw'", "cover_art": "m.has_cover=1", "lossless": "(m.audio_codec IN ('flac','alac','wavpack','ape','tta') OR m.audio_codec LIKE 'pcm%')", "screenshot": "m.is_screenshot=1", "screen_recording": "m.is_screen_rec=1", "raw": "m.is_raw=1", "live": "m.live_video_id IS NOT NULL", "panorama": "m.is_panorama=1", "selfie": "m.is_selfie=1", diff --git a/backend/app/services/sequences.py b/backend/app/services/sequences.py new file mode 100644 index 0000000..76d0478 --- /dev/null +++ b/backend/app/services/sequences.py @@ -0,0 +1,218 @@ +import io +import os +import re +import struct +import tempfile +import time +import zipfile +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Sequence, Tuple, Union + +from PIL import Image + +from . import classify, imagex +from .assetkinds import Extract + +FRAME_NAME = re.compile(r"^(?P.*?)(?P\d+)\.(?P[A-Za-z0-9]+)$") +MIN_FRAMES = {"exr": 2, "dpx": 2, "png": 10, "tif": 10, "tiff": 10} +DEFAULT_RATE = 24.0 +SEQUENCE_MIME = "application/zip" +EXR_MAGIC = b"\x76\x2f\x31\x01" +EXR_HEADER_CAP = 1 << 16 + + +@dataclass(frozen=True) +class FrameSequence: + folder: str + prefix: str + ext: str + pad: int + frames: Tuple[str, ...] + numbers: Tuple[int, ...] + + @property + def first(self) -> int: + return self.numbers[0] + + @property + def last(self) -> int: + return self.numbers[-1] + + def label(self) -> str: + stem = self.prefix.rstrip("._- ") or os.path.basename(self.folder.rstrip(os.sep)) or "frames" + return f"{stem}.[{self.first:0{self.pad}d}-{self.last:0{self.pad}d}].{self.ext}.zip" + + +def _accepts(ext: str, numbers: Sequence[int]) -> bool: + need = MIN_FRAMES.get(ext) + if need is None or len(numbers) < need: + return False + if ext in ("exr", "dpx"): + return True + return numbers[-1] - numbers[0] + 1 == len(numbers) + + +def group(folder: str, names: Sequence[str]) -> Tuple[List[FrameSequence], List[str]]: + buckets: Dict[Tuple[str, str, int], List[Tuple[int, str]]] = {} + for name in names: + match = FRAME_NAME.match(name) + ext = match.group("ext").lower() if match else "" + if not match or ext not in classify.SEQUENCE_EXTS: + continue + key = (match.group("prefix"), ext, len(match.group("num"))) + buckets.setdefault(key, []).append((int(match.group("num")), name)) + found: List[FrameSequence] = [] + used = set() + for (prefix, ext, pad), members in sorted(buckets.items()): + members = sorted(members) + numbers = tuple(n for n, _ in members) + if len(set(numbers)) != len(numbers) or not _accepts(ext, numbers): + continue + frames = tuple(os.path.join(folder, n) for _, n in members) + found.append(FrameSequence(folder, prefix, ext, pad, frames, numbers)) + used.update(n for _, n in members) + return found, [n for n in names if n not in used] + + +def pack(seq: FrameSequence, dest_dir: str) -> str: + target = os.path.join(dest_dir, seq.label()) + with zipfile.ZipFile(target, "w", compression=zipfile.ZIP_STORED, allowZip64=True) as archive: + for path in seq.frames: + stamp = time.localtime(max(os.path.getmtime(path), 315532800))[:6] + info = zipfile.ZipInfo(os.path.basename(path), date_time=stamp) + info.compress_type = zipfile.ZIP_STORED + with open(path, "rb") as src, archive.open(info, "w", force_zip64=True) as out: + while True: + block = src.read(1 << 20) + if not block: + break + out.write(block) + return target + + +def import_sequence(seq: FrameSequence, move: bool = False) -> Dict[str, Any]: + from . import libraryfs + + with tempfile.TemporaryDirectory(prefix="dam-seq-") as work: + packed = pack(seq, work) + result = libraryfs.import_one(packed, move=True, as_kind=("sequence", SEQUENCE_MIME, seq.ext)) + if move and result.get("status") == "imported": + for path in seq.frames: + try: + os.unlink(path) + except OSError: + pass + return result + + +def frame_names(archive: zipfile.ZipFile) -> List[Tuple[int, str]]: + out = [] + for info in archive.infolist(): + match = FRAME_NAME.match(os.path.basename(info.filename)) + if match and not info.is_dir(): + out.append((int(match.group("num")), info.filename)) + return sorted(out) + + +def _exr_attrs(data: bytes) -> Dict[str, Any]: + if data[:4] != EXR_MAGIC: + return {} + pos, out = 8, {} + while pos < min(len(data), EXR_HEADER_CAP): + end = data.find(b"\x00", pos) + if end <= pos: + break + name = data[pos:end].decode("latin-1") + type_end = data.find(b"\x00", end + 1) + if type_end < 0 or type_end + 5 > len(data): + break + kind = data[end + 1:type_end].decode("latin-1") + size = struct.unpack_from(" Dict[str, Any]: + magic = data[:4] + if magic not in (b"SDPX", b"XPDS") or len(data) < 1944: + return {} + order = ">" if magic == b"SDPX" else "<" + width, height = struct.unpack_from(f"{order}II", data, 772) + out: Dict[str, Any] = {"size": (width, height)} + for offset in (1724, 1940): + rate = struct.unpack_from(f"{order}f", data, offset)[0] + if 0 < rate < 1000: + out["rate"] = float(rate) + break + return out + + +def frame_facts(ext: str, data: bytes) -> Dict[str, Any]: + if ext == "exr": + attrs = _exr_attrs(data[:EXR_HEADER_CAP]) + box = attrs.get("dataWindow") or attrs.get("displayWindow") + facts: Dict[str, Any] = {} + if box: + facts["size"] = (box[2] - box[0] + 1, box[3] - box[1] + 1) + if attrs.get("framesPerSecond"): + facts["rate"] = float(attrs["framesPerSecond"]) + return facts + if ext == "dpx": + return _dpx_info(data) + try: + with Image.open(io.BytesIO(data)) as img: + return {"size": img.size} + except Exception: + return {} + + +def decode_frame(ext: str, data: bytes) -> Optional[Image.Image]: + if ext in imagex.EXTRA_EXTS: + return imagex.open_extra(data, f"frame.{ext}", 2048) + try: + with Image.open(io.BytesIO(data)) as img: + img.load() + return img.convert("RGB") + except Exception: + return imagex.ffmpeg_still(data, ext) + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + ext = (row.get("subkind") or "").lower() + with zipfile.ZipFile(path) as archive: + names = frame_names(archive) + if not names: + return Extract(meta={"error": "No numbered frames in this sequence"}) + numbers = [n for n, _ in names] + first_bytes = archive.read(names[0][1]) + middle_bytes = archive.read(names[len(names) // 2][1]) + facts = frame_facts(ext, first_bytes) + rate = facts.get("rate") or DEFAULT_RATE + size = facts.get("size") + missing = numbers[-1] - numbers[0] + 1 - len(numbers) + meta = {"format": ext.upper(), "first": numbers[0], "last": numbers[-1], "frames": len(numbers), "missing": missing, + "rate": round(rate, 3), "rate_from": "file" if facts.get("rate") else "default"} + preview = decode_frame(ext, middle_bytes) + if size is None and preview is not None: + size = preview.size + return Extract(meta=meta, pages=len(numbers), duration=len(numbers) / rate, preview=preview, + width=size[0] if size else None, height=size[1] if size else None) + + +def strip_location(src: Union[str, bytes], dest: str) -> None: + from . import gpsscrub + + source = io.BytesIO(src) if isinstance(src, (bytes, bytearray)) else src + with zipfile.ZipFile(source) as archive, zipfile.ZipFile(dest, "w", compression=zipfile.ZIP_STORED, allowZip64=True) as out: + for info in archive.infolist(): + data = archive.read(info) + clean = gpsscrub.scrub(data) if os.path.splitext(info.filename)[1].lower() in (".png", ".tif", ".tiff") else data + copy = zipfile.ZipInfo(info.filename, date_time=info.date_time) + copy.compress_type = zipfile.ZIP_STORED + out.writestr(copy, clean) diff --git a/backend/app/vaultcrypt.py b/backend/app/vaultcrypt.py index 0770497..aacad54 100644 --- a/backend/app/vaultcrypt.py +++ b/backend/app/vaultcrypt.py @@ -380,7 +380,7 @@ def _scrub(media_id: int) -> None: folder = os.path.join(cache_dir(), "thumbs") for path in glob.glob(os.path.join(glob.escape(folder), f"{media_id}_*")): _unlink(path) - for sub in ("render", "effects", "share", "listen"): + for sub in ("render", "effects", "share", "listen", "play"): for path in glob.glob(os.path.join(glob.escape(os.path.join(cache_dir(), sub)), f"{media_id}_*")): _unlink(path) faces = os.path.join(cache_dir(), "faces") @@ -481,7 +481,7 @@ def _reseal(item, home: str) -> None: def _drop_plain_audio(media_id: int, sealing: bool = False) -> None: thumbs_dir = os.path.join(cache_dir(), "thumbs") tags = [tag for tag in PLAIN_EXTRAS if not (sealing and tag == "preview")] - patterns = ((os.path.join(cache_dir(), "listen"), f"{media_id}_*"), + patterns = ((os.path.join(cache_dir(), "listen"), f"{media_id}_*"), (os.path.join(cache_dir(), "play"), f"{media_id}_*"), *((thumbs_dir, f"{media_id}_{tag}_*") for tag in tags), *((thumbs_dir, f"{media_id}_{tag}[0-9]*") for tag in ("page",))) for folder, name in patterns: @@ -617,7 +617,7 @@ def _scrub_vaulted() -> None: vaulted = {row["media_id"] for row in q("SELECT media_id FROM vault_items")} if not vaulted: return - for sub in ("thumbs", "listen"): + for sub in ("thumbs", "listen", "play"): folder = os.path.join(cache_dir(), sub) try: names = os.listdir(folder) diff --git a/backend/requirements.txt b/backend/requirements.txt index 5f288ca..c10f83f 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -10,3 +10,4 @@ opencv-python-headless>=4.10 cryptography==50.0.1 python-multipart pyzipper==0.4.0 +resvg_py==0.5.0 diff --git a/backend/requirements_macos.txt b/backend/requirements_macos.txt index 6745bb2..97e846b 100644 --- a/backend/requirements_macos.txt +++ b/backend/requirements_macos.txt @@ -13,3 +13,4 @@ pyobjc-framework-ImageCaptureCore pyobjc-framework-Quartz cryptography==50.0.1 pyzipper==0.4.0 +resvg_py==0.5.0 diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py new file mode 100644 index 0000000..d0659f6 --- /dev/null +++ b/backend/tests/test_formats_extra.py @@ -0,0 +1,234 @@ +import io +import json +import os +import struct +import subprocess +import zipfile + +import numpy as np +import pytest +from PIL import Image + +from tests.conftest import HEADERS, import_dir, wait_job +from tests.test_audio_import import needs_ffmpeg +from tests.test_audio_privacy import located_jpeg + + +def ffmpeg_image(path, codec_args, size="32x24", color="red"): + subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", f"color=c={color}:s={size}:d=1", + "-frames:v", "1", *codec_args, str(path)], check=True, capture_output=True) + return path + + +def svg_file(path, color="#00ff00"): + path.write_text(f'') + return path + + +def items(client, flt="all"): + return {i["name"]: i for i in client.get("/api/media", params={"filter": flt, "limit": 1000}).json()["items"]} + + +def centre(content): + with Image.open(io.BytesIO(content)) as img: + return img.convert("RGB").getpixel((img.width // 2, img.height // 2)) + + +def test_new_extensions_classify(): + from app.services import classify + + for ext in ("psd", "psb", "exr", "hdr", "jxl", "svg", "tga", "dpx", "jp2", "ico"): + assert classify.media_kind(f"a.{ext}")[0] == "image", ext + for ext in ("mxf", "mpeg", "mpg", "wmv", "flv", "ogv", "r3d", "braw"): + assert classify.media_kind(f"a.{ext}")[0] == "video", ext + + +def test_pil_formats_and_svg_import_with_thumbs(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + Image.new("RGB", (30, 20), (0, 0, 255)).save(src / "blue.tga") + Image.new("RGB", (32, 32), (0, 0, 255)).save(src / "blue.ico") + Image.new("RGB", (30, 20), (0, 0, 255)).save(src / "blue.jp2") + svg_file(src / "green.svg") + import_dir(client, src) + found = items(client, "photos") + assert set(found) == {"blue.tga", "blue.ico", "blue.jp2", "green.svg"} + assert (found["green.svg"]["width"], found["green.svg"]["height"]) == (80, 40) + for name, want in (("blue.tga", 2), ("green.svg", 1)): + res = client.get(f"/api/media/{found[name]['id']}/thumb", params={"s": 192}) + assert res.status_code == 200 + pixel = centre(res.content) + assert pixel[want] > 200 and max(p for i, p in enumerate(pixel) if i != want) < 60, (name, pixel) + + +def test_svg_original_is_served_inert(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + (src / "x.svg").write_text('') + import_dir(client, src) + media_id = items(client)["x.svg"]["id"] + res = client.get(f"/api/media/{media_id}/file") + assert "sandbox" in res.headers["content-security-policy"] and res.headers["x-content-type-options"] == "nosniff" + + +@needs_ffmpeg +def test_float_and_film_stills_decode_through_ffmpeg(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + ffmpeg_image(src / "plate.exr", ["-c:v", "exr", "-pix_fmt", "gbrpf32le"]) + ffmpeg_image(src / "plate.hdr", ["-c:v", "hdr", "-pix_fmt", "gbrpf32le"]) + ffmpeg_image(src / "plate.dpx", ["-c:v", "dpx", "-pix_fmt", "rgb48le"]) + import_dir(client, src) + found = items(client, "photos") + for name in ("plate.exr", "plate.hdr", "plate.dpx"): + assert (found[name]["width"], found[name]["height"]) == (32, 24), name + r, g, b = centre(client.get(f"/api/media/{found[name]['id']}/thumb", params={"s": 192}).content) + assert r > 150 and g < 90 and b < 90, (name, (r, g, b)) + + +def test_tonemap_and_pfm_parse(): + from app.services import imagex + + header = b"PF\n2 1\n-1.0\n" + body = np.array([[0.0, 0.0, 0.0, 4.0, 4.0, 4.0]], dtype=" 200 + + +def test_psb_falls_back_to_its_embedded_thumbnail(): + from app.services import imagex + + jpeg = io.BytesIO() + Image.new("RGB", (16, 8), (250, 0, 0)).save(jpeg, "JPEG") + payload = struct.pack(">IIIIIIHH", 1, 16, 8, 48, 1, 1, 24, 1) + jpeg.getvalue() + resource = b"8BIM" + struct.pack(">H", 1036) + b"\x00\x00" + struct.pack(">I", len(payload)) + payload + resource += b"\x00" * (len(payload) % 2) + header = b"8BPS" + struct.pack(">H", 2) + b"\x00" * 6 + struct.pack(">HIIHH", 3, 800, 1600, 8, 3) + data = header + struct.pack(">I", 0) + struct.pack(">I", len(resource)) + resource + thumb = imagex.psd_thumbnail(data) + assert thumb.size == (16, 8) and thumb.getpixel((8, 4))[0] > 200 + + +@needs_ffmpeg +def test_new_video_containers_and_camera_raw(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + for name, args in (("clip.mpg", ["-c:v", "mpeg2video"]), ("clip.flv", ["-c:v", "flv"]), ("clip.ogv", ["-c:v", "libtheora"])): + cmd = ["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", "testsrc=duration=1:size=64x48:rate=10", + *args, str(src / name)] + if subprocess.run(cmd, capture_output=True).returncode != 0: + os.unlink(src / name) if os.path.exists(src / name) else None + (src / "a001.r3d").write_bytes(b"RED2" + b"\x00" * 64) + import_dir(client, src) + found = items(client, "videos") + assert "clip.mpg" in found and found["clip.mpg"]["width"] == 64 + raw = found["a001.r3d"] + assert raw["subkind"] == "camera_raw" and raw["width"] is None + spec = {"rules": [{"field": "flag", "value": "camera_raw_video"}]} + assert [m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == ["a001.r3d"] + assert client.get(f"/api/media/{raw['id']}/thumb").status_code == 200 + assert client.get(f"/api/media/{raw['id']}/play").status_code == 415 + + +@needs_ffmpeg +def test_playable_copy_is_cached_and_purged(client, tmp_path): + from app.routers.assets import play_path + + src = tmp_path / "src" + os.makedirs(src) + subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", "testsrc=duration=1:size=64x48:rate=10", + "-c:v", "mpeg2video", str(src / "old.mpg")], check=True, capture_output=True) + import_dir(client, src) + media_id = items(client, "videos")["old.mpg"]["id"] + res = client.get(f"/api/media/{media_id}/play") + if res.status_code == 500: + pytest.skip("this ffmpeg has no VP8 encoder") + assert res.status_code == 200 and res.content[:4] == b"\x1a\x45\xdf\xa3" and os.path.isfile(play_path(media_id)) + assert client.post(f"/api/media/{media_id}/trash", headers=HEADERS).status_code == 200 + assert not os.path.exists(play_path(media_id)) + + +def png_frames(folder, count, start=1001, size=(24, 16), color=(10, 200, 10)): + os.makedirs(folder, exist_ok=True) + for n in range(start, start + count): + Image.new("RGB", size, color).save(folder / f"shot_{n:04d}.png") + + +def test_sequence_grouping_rules(): + from app.services import sequences + + names = [f"render.{n:04d}.exr" for n in (1, 2, 5)] + [f"IMG_{n}.png" for n in (1, 2, 3)] + ["notes.txt"] + groups, singles = sequences.group("/f", names) + assert len(groups) == 1 and groups[0].numbers == (1, 2, 5) and groups[0].label() == "render.[0001-0005].exr.zip" + assert sorted(singles) == ["IMG_1.png", "IMG_2.png", "IMG_3.png", "notes.txt"] + groups, _ = sequences.group("/f", [f"f{n:03d}.png" for n in range(1, 13)]) + assert len(groups) == 1 and groups[0].first == 1 and groups[0].last == 12 + groups, _ = sequences.group("/f", [f"f{n:03d}.png" for n in range(1, 13) if n != 6]) + assert groups == [] + + +@needs_ffmpeg +def test_exr_folder_imports_as_one_clip(client, tmp_path): + from app.services import assetwork + + folder = tmp_path / "src" / "plate" + os.makedirs(folder) + for n in range(1, 5): + ffmpeg_image(folder / f"plate.{n:04d}.exr", ["-c:v", "exr", "-pix_fmt", "gbrpf32le"], size="40x20") + counts = import_dir(client, tmp_path / "src") + assert counts["imported"] == 1 + assetwork.drain() + clip = items(client, "sequences")["plate.[0001-0004].exr.zip"] + assert clip["kind"] == "sequence" and clip["subkind"] == "exr" and clip["pages"] == 4 + assert (clip["width"], clip["height"]) == (40, 20) and abs(clip["duration"] - 4 / clip["asset"]["rate"]) < 1e-3 + assert clip["asset"]["first"] == 1 and clip["asset"]["last"] == 4 and clip["asset"]["rate_from"] in ("file", "default") + assert client.get("/api/summary").json()["sequences"] == 1 + r, g, b = centre(client.get(f"/api/media/{clip['id']}/thumb", params={"s": 192}).content) + assert r > 150 and g < 90 + + +def test_png_sequence_export_drops_frame_locations(client, tmp_path): + from app.services import assetwork, gpsscrub + + folder = tmp_path / "src" / "shots" + png_frames(folder, 10) + gps = located_jpeg(tmp_path / "loc.jpg") + with Image.open(gps) as located: + exif = located.getexif() + Image.new("RGB", (24, 16)).save(folder / "shot_1005.png", exif=exif) + import_dir(client, tmp_path / "src") + assetwork.drain() + clip = items(client, "sequences")["shot.[1001-1010].png.zip"] + dest = tmp_path / "out" + job = client.post("/api/export", json={"ids": [clip["id"]], "dest": str(dest), "options": {"location": False}}, headers=HEADERS).json()["job_id"] + assert wait_job(client, job)["phase"] == "done" + with zipfile.ZipFile(dest / clip["name"]) as archive: + assert archive.testzip() is None and len(archive.namelist()) == 10 + frame = archive.read("shot_1005.png") + probe = tmp_path / "frame.png" + probe.write_bytes(frame) + assert gpsscrub.has_gps(str(probe)) is not True + + +def test_svg_never_loads_local_files(client, tmp_path): + from app.services import imagex + + secret = tmp_path / "secret.png" + Image.new("RGB", (80, 40), (255, 0, 0)).save(secret) + blank = '' + refs = [ + f'', + f'', + f'', + f'', + f'', + ] + for ref in refs: + img = imagex.render_svg(f"{blank}{ref}".encode(), 80) + assert img is None or max(img.convert("RGBA").getpixel((40, 20))[:3]) < 30 or img.getpixel((40, 20))[3] == 0, ref + doctype = f']>{blank}&x;' + assert imagex.render_svg(doctype.encode(), 80) is None + kept = imagex.sanitise_svg(f'{blank}'.encode()) + assert b'href="#r"' in kept diff --git a/frontend/src/engine/assetkinds.ts b/frontend/src/engine/assetkinds.ts index b3bb720..cc3b7b2 100644 --- a/frontend/src/engine/assetkinds.ts +++ b/frontend/src/engine/assetkinds.ts @@ -78,12 +78,30 @@ export function projectFacts(facts: AssetFacts): FactRow[] { ]; } -const FACTS: Record FactRow[]> = { project: projectFacts }; +function num(facts: AssetFacts, key: string): number | null { + const value = facts[key]; + return typeof value === "number" && Number.isFinite(value) ? value : null; +} -export function registerFacts(kind: string, fn: (facts: AssetFacts) => FactRow[]): void { - FACTS[kind] = fn; +export function sequenceFacts(facts: AssetFacts): FactRow[] { + const first = num(facts, "first"); + const last = num(facts, "last"); + const frames = num(facts, "frames"); + const rate = num(facts, "rate"); + const missing = num(facts, "missing"); + return [ + ["Format", str(facts, "format")], + ["Frames", first !== null && last !== null && frames !== null ? `${first} to ${last} (${frames} frames)` : ""], + ["Missing frames", missing ? String(missing) : ""], + ["Frame rate", rate !== null ? `${rate} fps${facts.rate_from === "default" ? " (assumed; the frames name none)" : ""}` : ""], + ]; } +const FACTS: Readonly FactRow[]>> = { + project: projectFacts, + sequence: sequenceFacts, +}; + export function assetFacts(item: Pick): FactRow[] { const facts = item.asset ?? {}; const key = item.subkind && FACTS[`${item.kind}:${item.subkind}`] ? `${item.kind}:${item.subkind}` : item.kind; diff --git a/frontend/src/engine/store.ts b/frontend/src/engine/store.ts index de3ba75..a058b0b 100644 --- a/frontend/src/engine/store.ts +++ b/frontend/src/engine/store.ts @@ -215,6 +215,7 @@ const LEGACY_SPECS: Record = { videos: { rules: [{ field: "flag", value: "video" }] }, audio: { rules: [{ field: "flag", value: "audio" }] }, projects: { rules: [{ field: "flag", value: "project" }] }, + sequences: { rules: [{ field: "flag", value: "sequence" }] }, screenshots: { rules: [{ field: "flag", value: "screenshot" }] }, screenrecs: { rules: [{ field: "flag", value: "screen_recording" }] }, not_in_album: { rules: [{ field: "flag", value: "not_in_album" }] }, diff --git a/frontend/src/ui/components/library.ts b/frontend/src/ui/components/library.ts index f348014..ae20b8e 100644 --- a/frontend/src/ui/components/library.ts +++ b/frontend/src/ui/components/library.ts @@ -16,6 +16,7 @@ const FILTER_LABELS: Record = { videos: "Videos", audio: "Audio", projects: "Form Projects", + sequences: "Image Sequences", screenshots: "Screenshots", screenrecs: "Screen Recordings", not_in_album: "Not in an Album", @@ -72,9 +73,9 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo const filterBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Filter" }, iconEl("sliders")); const menu = h("div", { class: "menu pop-surface hidden" }); const menuAnchor = h("div", { class: "menu-anchor" }, filterBtn, menu); - const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "screenshots", "not_in_album"]; + const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "sequences", "screenshots", "not_in_album"]; const FILTER_ICONS: Partial> = { - all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", + all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", sequences: "frames", screenshots: "screenshot", not_in_album: "albumOff", }; for (const key of filterKeys) { @@ -151,6 +152,7 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo videos: state.summary.videos, audio: state.summary.audio, projects: state.summary.projects ?? 0, + sequences: state.summary.sequences ?? 0, screenshots: state.summary.screenshots, screenrecs: state.summary.screenrecs, recently_viewed: state.summary.recently_viewed, diff --git a/frontend/src/ui/components/organize.ts b/frontend/src/ui/components/organize.ts index c1fb368..cb2ed62 100644 --- a/frontend/src/ui/components/organize.ts +++ b/frontend/src/ui/components/organize.ts @@ -339,7 +339,7 @@ const RULE_FIELDS: Array<[string, string]> = [ ["app", "Form app"], ["format", "File format"], ["pages", "Pages or frames"], ]; const FLAG_VALUES: Array<[string, string]> = [ - ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["raw", "RAW"], ["live", "Live Photo"], + ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["sequence", "Image sequence"], ["camera_raw_video", "Camera raw video"], ["raw", "RAW"], ["live", "Live Photo"], ["panorama", "Panorama"], ["selfie", "Selfie"], ["portrait", "Portrait"], ["slomo", "Slo-mo"], ["burst", "Burst"], ["screenshot", "Screenshot"], ["screen_recording", "Screen Recording"], ["edited", "Edited"], ["rejected", "Rejected"], ["located", "Has location"], ["not_located", "No location"], ["not_in_album", "Not in an album"], diff --git a/frontend/src/ui/components/pages.ts b/frontend/src/ui/components/pages.ts index 84172d6..5aeec15 100644 --- a/frontend/src/ui/components/pages.ts +++ b/frontend/src/ui/components/pages.ts @@ -72,7 +72,7 @@ interface MediaType { } const TYPE_ICONS: Record = { - video: "video", audio: "audio", project: "project", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", + video: "video", audio: "audio", project: "project", sequence: "frames", camera_raw_video: "video", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", burst: "stack", raw: "file", screenshot: "screenshot", screen_recording: "stage", timelapse: "clock", cinematic: "video", spatial: "cube", long_exposure: "wave", animated: "play", }; diff --git a/frontend/src/ui/components/viewer.ts b/frontend/src/ui/components/viewer.ts index 06cdf1c..f7a2ff1 100644 --- a/frontend/src/ui/components/viewer.ts +++ b/frontend/src/ui/components/viewer.ts @@ -500,6 +500,11 @@ export function mountViewer(host: HTMLElement): void { stopAudio(); videoHolder.classList.remove("hidden"); const video = h("video", { src: fileUrl(id), controls: true, autoplay: true, playsinline: true }) as HTMLVideoElement; + video.addEventListener("error", () => { + if (video.src.endsWith("/play")) return; + video.src = `/api/media/${id}/play`; + void video.play().catch(() => undefined); + }, { once: true }); videoHolder.replaceChildren(video); viewerHooks.videoReady?.(video, id); } From bf4a2a9f6a279fc031ebcadae70aed6f13cf18cd Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:09:26 -0500 Subject: [PATCH 08/35] fix: file kinds leave the library without location only when it is ruled 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. --- backend/HASHOUT_LOG.md | 9 ++ backend/app/services/filestrip.py | 185 ++++++++++++++++++++++++++++ backend/app/services/gallerysvc.py | 13 +- backend/app/services/outputsvc.py | 13 +- backend/app/services/packagesvc.py | 13 +- backend/app/services/sequences.py | 34 ++--- backend/tests/test_form_projects.py | 4 +- backend/tests/test_formats_extra.py | 102 +++++++++++++++ 8 files changed, 327 insertions(+), 46 deletions(-) create mode 100644 backend/app/services/filestrip.py diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 087caad..6033575 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -23,6 +23,15 @@ Sharing, packages and export strip all metadata from audio (ffmpeg -map_metadata The listen copy and the waveform cache are plain files. When an item becomes protected (hidden, trashed or in a private album) the vault's settle step deletes both before anything else, with or without a vault set up; sealing and deleting scrub the listen folder with the other caches, and the start-up sweep of vaulted items covers it. A protected item's listen copy is streamed from ffmpeg and never written. +### services/filestrip.py · location leaves file kinds only when it is ruled out +- refers-to: filestrip (new) exr_header, _exr_part, wipe_exr, exr_located, wipe_dpx, raster_located, text_located, clean_member, strip_zip, strip_file, LocationRemains; sequences._exr_attrs, strip_location; outputsvc._copy_file_kind; packagesvc._payload; gallerysvc.file_download; tests/test_formats_extra.py (header bounds, EXR wipe on export, fail-closed cases) +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +The EXR header reader took each attribute's size as a signed int and trusted it, so a negative or huge size could leave the read position where it was and loop for ever. The size is now unsigned, a size that runs past the data ends the read as incomplete, and so does a position that does not move forward. A multipart file (flag 0x10 in the version field) has one header per part, each ended by a null byte and the list by one more; every part is read, and a list that does not end cleanly counts as unreadable. + +Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the library without its location (export, packages, shares) now goes through filestrip, which works on an allowlist and refuses whatever it cannot check. An archive (any zip, including sequences, zip-based projects, dotLottie and form.ext packages) is rebuilt member by member, nested archives in memory up to three levels: EXR members have their latitude, longitude and altitude attributes renamed in place to x of the same length and their values zeroed (so the offset table still points at the right bytes) and are read back to confirm; DPX members have their user-defined data block (from byte 2048, the length at byte 32) zeroed, the only place the format leaves for such data; raster members (JPEG, PNG, TIFF, WebP) pass through gpsscrub and must then read as having no GPS; text members (JSON, XML, SVG, captions, LUTs and the like) pass through gpsscrub; and every member is searched for a GPS or GPSDest latitude or longitude with a value, as an attribute or an element, any spacing or quote style, any case, in the bytes and in a UTF-16 reading of them. Any other member type, an unreadable header or a value still present raises LocationRemains, which export and packages report as a refusal and shares as a skipped item. A single non-archive file is scrubbed and refused when GPS reads present, an XMP GPS value is found, or the row has a location and the file is not a raster formDAM can verify. + ### services/imagex.py, sequences.py, routers/assets.py play · more still and video formats, image sequences - refers-to: imagex (new) EXTRA_EXTS, open_extra, extra_size, ffmpeg_still, parse_pfm, tonemap, psd_thumbnail, svg_size, sanitise_svg, render_svg, _spill; decode.open_image and image_size; classify IMAGE_EXTS, VIDEO_EXTS, CAMERA_RAW_VIDEO, SEQUENCE_EXTS, is_camera_raw_video; libraryfs.gather_items, import_item, import_one as_kind; sequences (new) FrameSequence, group, pack, import_sequence, extract, strip_location; importer start_import; outputsvc._copy_file_kind; packagesvc._payload; gallerysvc.file_download; routers/assets.py /media/{id}/play, play_path, play_command; mediaapi.inert_headers; guard._any_token /play and /page; vaultcrypt _scrub, _scrub_vaulted and _drop_plain_audio cover cache/play; query FLAGS sequence, camera_raw_video; mediaapi FILTERS sequences; summary sequences; tests/test_formats_extra.py - kind: feature diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py new file mode 100644 index 0000000..2c6cc72 --- /dev/null +++ b/backend/app/services/filestrip.py @@ -0,0 +1,185 @@ +import io +import os +import re +import struct +import zipfile +from typing import Any, List, Optional, Tuple, Union + +from . import gpsscrub + +EXR_MAGIC = b"\x76\x2f\x31\x01" +EXR_LOCATION = {"latitude", "longitude", "altitude"} +DPX_USER_START = 2048 +RASTER_MEMBERS = {".jpg", ".jpeg", ".png", ".tif", ".tiff", ".webp"} +TEXT_MEMBERS = {".json", ".xml", ".rels", ".txt", ".md", ".csv", ".tsv", ".srt", ".vtt", ".svg", ".html", ".htm", ".css", + ".cube", ".3dl", ".obj", ".mtl", ".gltf", ".usda", ".idml", ".plist", ".yaml", ".yml", ".toml", ".ini"} +ARCHIVE_MEMBERS = {".zip", ".lottie", ".formpkg"} +MAX_DEPTH = 3 +XMP_GPS_VALUE = re.compile(rb"GPS(?:Dest)?(?:Latitude|Longitude)\s*(?:=\s*[\"']\s*[^\"'\s]|>\s*[^<\s])", re.IGNORECASE) +Source = Union[str, bytes] + + +class LocationRemains(ValueError): + pass + + +def _exr_part(data: bytes, pos: int, attrs: list) -> Tuple[int, bool]: + while pos < len(data): + if data[pos] == 0: + return pos + 1, True + name_end = data.find(b"\x00", pos) + type_end = data.find(b"\x00", name_end + 1) if name_end > pos else -1 + if type_end < 0 or type_end + 5 > len(data): + return pos, False + size = struct.unpack_from(" len(data) or start + size <= pos: + return pos, False + attrs.append((data[pos:name_end].decode("latin-1"), data[name_end + 1:type_end].decode("latin-1"), start, size, pos)) + pos = start + size + return pos, False + + +def exr_header(data: bytes) -> Tuple[List[Tuple[str, str, int, int, int]], bool]: + if data[:4] != EXR_MAGIC or len(data) < 9: + return [], False + attrs: list = [] + pos, complete = _exr_part(data, 8, attrs) + if not complete or not data[5] & 0x10: + return attrs, complete + while pos < len(data): + if data[pos] == 0: + return attrs, True + pos, complete = _exr_part(data, pos, attrs) + if not complete: + return attrs, False + return attrs, False + + +def wipe_exr(data: bytes) -> bytes: + attrs, complete = exr_header(data) + if not complete: + raise LocationRemains("an EXR header could not be read to the end") + buf = bytearray(data) + for name, _kind, start, size, name_at in attrs: + if name.lower() in EXR_LOCATION: + buf[name_at:name_at + len(name)] = b"x" * len(name) + buf[start:start + size] = b"\x00" * size + return bytes(buf) + + +def exr_located(data: bytes) -> bool: + attrs, complete = exr_header(data) + return not complete or any(attr[0].lower() in EXR_LOCATION for attr in attrs) + + +def wipe_dpx(data: bytes) -> bytes: + magic = data[:4] + if magic not in (b"SDPX", b"XPDS") or len(data) < DPX_USER_START: + raise LocationRemains("a DPX header could not be read") + order = ">" if magic == b"SDPX" else "<" + image_at, = struct.unpack_from(f"{order}I", data, 4) + user_len, = struct.unpack_from(f"{order}I", data, 32) + end = min(len(data), image_at if image_at >= DPX_USER_START else len(data), DPX_USER_START + user_len) + if user_len and end <= DPX_USER_START: + raise LocationRemains("a DPX user data block could not be placed") + buf = bytearray(data) + if end > DPX_USER_START: + buf[DPX_USER_START:end] = b"\x00" * (end - DPX_USER_START) + return bytes(buf) + + +def raster_located(data: bytes) -> Optional[bool]: + try: + from PIL import Image + + with Image.open(io.BytesIO(data)) as img: + gps = img.getexif().get_ifd(gpsscrub.GPS_TAG) + if gps.get(2) or gps.get(4): + return True + except Exception: + return None + return bool(XMP_GPS_VALUE.search(data)) + + +def text_located(data: bytes) -> bool: + if XMP_GPS_VALUE.search(data): + return True + for codec in ("utf-16-le", "utf-16-be"): + wide = data[: len(data) - len(data) % 2].decode(codec, "ignore").encode("utf-8", "ignore") + if XMP_GPS_VALUE.search(wide): + return True + return False + + +def clean_member(name: str, data: bytes, depth: int = 0) -> bytes: + ext = os.path.splitext(name)[1].lower() + if ext in ARCHIVE_MEMBERS or data[:4] == b"PK\x03\x04": + if depth >= MAX_DEPTH: + raise LocationRemains(f"{name} nests archives too deeply to check") + out = io.BytesIO() + _strip_archive(io.BytesIO(data), out, depth + 1) + return out.getvalue() + if ext == ".exr": + clean = wipe_exr(data) + if exr_located(clean): + raise LocationRemains(f"{name} still carries a location") + return clean + if ext == ".dpx": + return wipe_dpx(data) + if ext in RASTER_MEMBERS: + clean = gpsscrub.scrub(data) + if raster_located(clean) is not False or text_located(clean): + raise LocationRemains(f"location could not be ruled out in {name}") + return clean + if ext in TEXT_MEMBERS: + clean = gpsscrub.scrub(data) + if text_located(clean): + raise LocationRemains(f"{name} still carries a location") + return clean + raise LocationRemains(f"{name} is a kind of file formDAM cannot check for a location") + + +def _strip_archive(source: Any, target: Any, depth: int) -> None: + with zipfile.ZipFile(source) as archive, zipfile.ZipFile(target, "w", allowZip64=True) as out: + for info in archive.infolist(): + data = b"" if info.is_dir() else clean_member(info.filename, archive.read(info), depth) + copy = zipfile.ZipInfo(info.filename, date_time=info.date_time) + copy.compress_type = info.compress_type + copy.external_attr = info.external_attr + out.writestr(copy, data) + + +def strip_zip(src: Source, dest: str) -> None: + source: Any = io.BytesIO(src) if isinstance(src, (bytes, bytearray)) else src + _strip_archive(source, dest, 0) + + +def _is_zip(src: Source) -> bool: + if isinstance(src, (bytes, bytearray)): + return bytes(src[:4]) == b"PK\x03\x04" + return zipfile.is_zipfile(src) + + +def strip_file(row, src: Source, dest: str) -> None: + try: + if row["kind"] == "sequence" or _is_zip(src): + strip_zip(src, dest) + return + if isinstance(src, (bytes, bytearray)): + data = bytes(src) + else: + with open(src, "rb") as handle: + data = handle.read() + with open(dest, "wb") as handle: + handle.write(gpsscrub.scrub(data)) + found = gpsscrub.has_gps(dest) + with open(dest, "rb") as handle: + written = handle.read() + raster = os.path.splitext(dest)[1].lower() in RASTER_MEMBERS + if found is True or text_located(written) or (row["lat"] is not None and (not raster or found is not False)): + raise LocationRemains("location could not be removed from this file") + except (LocationRemains, zipfile.BadZipFile, OSError): + if os.path.exists(dest): + os.remove(dest) + raise diff --git a/backend/app/services/gallerysvc.py b/backend/app/services/gallerysvc.py index 8395b35..762fb8e 100644 --- a/backend/app/services/gallerysvc.py +++ b/backend/app/services/gallerysvc.py @@ -57,18 +57,21 @@ def _cut_timed(ff: str, row, src: str, tmp: str, strip: bool) -> bool: def file_download(row, src: str, keep_location: bool) -> Optional[str]: + from . import filestrip + if not os.path.isfile(src): return None - if keep_location or row["kind"] != "sequence": + if keep_location: return src - from . import sequences - folder = os.path.join(cache_dir(), "share") os.makedirs(folder, exist_ok=True) - out = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_noloc.zip") + out = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_noloc{os.path.splitext(row['name'])[1].lower()}") if not os.path.isfile(out): tmp = f"{out}.part" - sequences.strip_location(src, tmp) + try: + filestrip.strip_file(row, src, tmp) + except (filestrip.LocationRemains, OSError, ValueError): + return None os.replace(tmp, out) return out diff --git a/backend/app/services/outputsvc.py b/backend/app/services/outputsvc.py index 352b84c..e225899 100644 --- a/backend/app/services/outputsvc.py +++ b/backend/app/services/outputsvc.py @@ -134,15 +134,12 @@ def _copy_stripped(src: Any, target: str, row, opts: Dict[str, Any]) -> None: def _copy_file_kind(src: Any, target: str, row) -> None: - from . import sequences + from . import filestrip - if row["kind"] == "sequence": - sequences.strip_location(src, target) - elif isinstance(src, (bytes, bytearray)): - with open(target, "wb") as fh: - fh.write(src) - else: - shutil.copy2(src, target) + try: + filestrip.strip_file(row, src, target) + except (filestrip.LocationRemains, OSError, ValueError) as exc: + raise ExportError(f"{row['name']}: location could not be removed ({exc})") from exc def export_one(row, dest: str, seq: int, opts: Dict[str, Any], taken: set) -> Optional[str]: diff --git a/backend/app/services/packagesvc.py b/backend/app/services/packagesvc.py index 4b4ee84..3cda388 100644 --- a/backend/app/services/packagesvc.py +++ b/backend/app/services/packagesvc.py @@ -161,15 +161,14 @@ def _payload(row, include_location: bool, work: str) -> Dict[str, Any]: if strip_timed(row, src, target): return {"path": target, "name": row["name"], "converted": False} raise PackageError(f"{row['name']}: location could not be removed from this {row['kind']} item (ffmpeg is needed)") - if row["kind"] == "sequence": - from . import sequences - - sequences.strip_location(src, target) - return {"path": target, "name": row["name"], "converted": False} - from . import classify + from . import classify, filestrip if classify.is_file_kind(row["kind"]): - return {"path": src, "name": row["name"], "converted": False} + try: + filestrip.strip_file(row, src, target) + except (filestrip.LocationRemains, OSError, ValueError) as exc: + raise PackageError(f"{row['name']}: location could not be removed ({exc})") from exc + return {"path": target, "name": row["name"], "converted": False} with open(src, "rb") as handle: clean = gpsscrub.scrub(handle.read()) with open(target, "wb") as handle: diff --git a/backend/app/services/sequences.py b/backend/app/services/sequences.py index 76d0478..7a6c46f 100644 --- a/backend/app/services/sequences.py +++ b/backend/app/services/sequences.py @@ -115,26 +115,17 @@ def frame_names(archive: zipfile.ZipFile) -> List[Tuple[int, str]]: def _exr_attrs(data: bytes) -> Dict[str, Any]: - if data[:4] != EXR_MAGIC: - return {} - pos, out = 8, {} - while pos < min(len(data), EXR_HEADER_CAP): - end = data.find(b"\x00", pos) - if end <= pos: - break - name = data[pos:end].decode("latin-1") - type_end = data.find(b"\x00", end + 1) - if type_end < 0 or type_end + 5 > len(data): - break - kind = data[end + 1:type_end].decode("latin-1") - size = struct.unpack_from(" Extract: def strip_location(src: Union[str, bytes], dest: str) -> None: - from . import gpsscrub - - source = io.BytesIO(src) if isinstance(src, (bytes, bytearray)) else src - with zipfile.ZipFile(source) as archive, zipfile.ZipFile(dest, "w", compression=zipfile.ZIP_STORED, allowZip64=True) as out: - for info in archive.infolist(): - data = archive.read(info) - clean = gpsscrub.scrub(data) if os.path.splitext(info.filename)[1].lower() in (".png", ".tif", ".tiff") else data - copy = zipfile.ZipInfo(info.filename, date_time=info.date_time) - copy.compress_type = zipfile.ZIP_STORED - out.writestr(copy, clean) + from . import filestrip + + filestrip.strip_zip(src, dest) diff --git a/backend/tests/test_form_projects.py b/backend/tests/test_form_projects.py index c0184bc..2d5bc72 100644 --- a/backend/tests/test_form_projects.py +++ b/backend/tests/test_form_projects.py @@ -207,4 +207,6 @@ def test_export_and_share_projects_as_originals(client, tmp_path): job = client.post("/api/export", json={"ids": [media_id], "dest": str(dest), "options": {"location": False}}, headers=HEADERS).json()["job_id"] assert wait_job(client, job)["phase"] == "done" assert zipfile.is_zipfile(dest / "kit.fcad") - assert gallerysvc.download_path({"include_location": 0}, media_id).endswith("kit.fcad") + shared = gallerysvc.download_path({"include_location": 0}, media_id) + assert shared.endswith(".fcad") and zipfile.is_zipfile(shared) + assert gallerysvc.download_path({"include_location": 1}, media_id).endswith("kit.fcad") diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index d0659f6..170fff1 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -232,3 +232,105 @@ def test_svg_never_loads_local_files(client, tmp_path): assert imagex.render_svg(doctype.encode(), 80) is None kept = imagex.sanitise_svg(f'{blank}'.encode()) assert b'href="#r"' in kept + + +def exr_with_location(path): + from app.services import filestrip + + data = path.read_bytes() + attr = b"latitude\x00float\x00" + struct.pack("'), + ("doc.xml", b" 0,7W"), + ("doc.xml", ''.encode("utf-16-le"))): + odd = tmp_path / "odd.fdoc" + with zipfile.ZipFile(odd, "w") as archive: + archive.writestr(member, body) + with pytest.raises(filestrip.LocationRemains): + filestrip.strip_file(row, str(odd), str(tmp_path / "odd-out.fdoc")) + inner = io.BytesIO() + with zipfile.ZipFile(inner, "w") as archive: + archive.writestr("photo.jpg", located) + nested = tmp_path / "nested.formpkg" + with zipfile.ZipFile(nested, "w") as archive: + archive.writestr("payload.zip", inner.getvalue()) + archive.writestr("readme.txt", "") + filestrip.strip_file(row, str(nested), str(tmp_path / "nested-out.formpkg")) + with zipfile.ZipFile(tmp_path / "nested-out.formpkg") as archive: + with zipfile.ZipFile(io.BytesIO(archive.read("payload.zip"))) as payload: + probe.write_bytes(payload.read("photo.jpg")) + assert gpsscrub.has_gps(str(probe)) is False + plain = tmp_path / "notes.srt" + plain.write_text("1\n00:00:01,000 --> 00:00:02,000\nhello\n") + with pytest.raises(filestrip.LocationRemains): + filestrip.strip_file({"kind": "resource", "lat": 10.0}, str(plain), str(tmp_path / "n.srt")) + filestrip.strip_file({"kind": "resource", "lat": None}, str(plain), str(tmp_path / "n.srt")) From 941f5c578498a5a2b137d989c154717cc42a4f44 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:14:23 -0500 Subject: [PATCH 09/35] fix: bound every archive read and check top-level files by allowlist 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. --- backend/HASHOUT_LOG.md | 9 +++ backend/app/services/filestrip.py | 111 ++++++++++++++++++++++------ backend/app/services/gallerysvc.py | 5 ++ backend/app/services/projectfile.py | 14 +++- backend/app/services/sequences.py | 12 ++- backend/app/services/zipsafe.py | 53 +++++++++++++ backend/tests/test_formats_extra.py | 79 +++++++++++++++++++- 7 files changed, 253 insertions(+), 30 deletions(-) create mode 100644 backend/app/services/zipsafe.py diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 6033575..2293eef 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -32,6 +32,15 @@ The EXR header reader took each attribute's size as a signed int and trusted it, Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the library without its location (export, packages, shares) now goes through filestrip, which works on an allowlist and refuses whatever it cannot check. An archive (any zip, including sequences, zip-based projects, dotLottie and form.ext packages) is rebuilt member by member, nested archives in memory up to three levels: EXR members have their latitude, longitude and altitude attributes renamed in place to x of the same length and their values zeroed (so the offset table still points at the right bytes) and are read back to confirm; DPX members have their user-defined data block (from byte 2048, the length at byte 32) zeroed, the only place the format leaves for such data; raster members (JPEG, PNG, TIFF, WebP) pass through gpsscrub and must then read as having no GPS; text members (JSON, XML, SVG, captions, LUTs and the like) pass through gpsscrub; and every member is searched for a GPS or GPSDest latitude or longitude with a value, as an attribute or an element, any spacing or quote style, any case, in the bytes and in a UTF-16 reading of them. Any other member type, an unreadable header or a value still present raises LocationRemains, which export and packages report as a refusal and shares as a skipped item. A single non-archive file is scrubbed and refused when GPS reads present, an XMP GPS value is found, or the row has a location and the file is not a raster formDAM can verify. +### services/filestrip.py, zipsafe.py · bounded archive reads, one allowlist for every file +- refers-to: zipsafe (new) Budget, read_member, members, ArchiveTooLarge, MEMBER_CAP, TOTAL_CAP, MAX_MEMBERS, MAX_DEPTH; filestrip clean_member (PDF, fonts, ASE, JSON sniff), pdf_located, _font_tables, _json_text, _strip_archive budget, strip_zip, strip_file; gallerysvc.file_download refusal marker; projectfile._member; sequences.extract; tests/test_formats_extra.py +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +Every archive formDAM opens for a preview, metadata or a location strip now reads through zipsafe: each member is read in 1 MiB chunks from archive.open(), checked against its declared file_size first and its real size as it grows, against a per-member cap (512 MiB), and against one running total for the whole operation, nested archives included (2 GiB, or four times the outer file when that is larger, so a stored sequence of large EXR frames still exports). A member count above 20 000 and nesting deeper than three levels are refused. Any limit reached during a strip raises LocationRemains, so the item is refused rather than handed over unchecked; for a preview it shows as unreadable. + +A file that is not an archive takes the same allowlist as a member: rasters must read back with no GPS (an unreadable raster counts as not verified), EXR and DPX are wiped and re-read, known text and anything that parses as UTF-8 JSON is scrubbed and searched (the search now also takes the JSON form "GPSLatitude": value), PDFs are searched raw and with every stream inflated (up to 256 MiB in all) and every embedded JPEG checked, fonts are searched in their name strings after a WOFF or WOFF2 is unpacked with fontTools, and ASE palettes in their UTF-16 names. Anything else is refused whatever the row's lat says. A share that was refused leaves {id}_{sha}_noloc.refused in cache/share, so the next request for it is refused at once; the marker carries the media id, so the vault's scrub and a changed file (another sha) clear it. + ### services/imagex.py, sequences.py, routers/assets.py play · more still and video formats, image sequences - refers-to: imagex (new) EXTRA_EXTS, open_extra, extra_size, ffmpeg_still, parse_pfm, tonemap, psd_thumbnail, svg_size, sanitise_svg, render_svg, _spill; decode.open_image and image_size; classify IMAGE_EXTS, VIDEO_EXTS, CAMERA_RAW_VIDEO, SEQUENCE_EXTS, is_camera_raw_video; libraryfs.gather_items, import_item, import_one as_kind; sequences (new) FrameSequence, group, pack, import_sequence, extract, strip_location; importer start_import; outputsvc._copy_file_kind; packagesvc._payload; gallerysvc.file_download; routers/assets.py /media/{id}/play, play_path, play_command; mediaapi.inert_headers; guard._any_token /play and /page; vaultcrypt _scrub, _scrub_vaulted and _drop_plain_audio cover cache/play; query FLAGS sequence, camera_raw_video; mediaapi FILTERS sequences; summary sequences; tests/test_formats_extra.py - kind: feature diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index 2c6cc72..e079336 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -5,7 +5,7 @@ import zipfile from typing import Any, List, Optional, Tuple, Union -from . import gpsscrub +from . import gpsscrub, zipsafe EXR_MAGIC = b"\x76\x2f\x31\x01" EXR_LOCATION = {"latitude", "longitude", "altitude"} @@ -14,8 +14,13 @@ TEXT_MEMBERS = {".json", ".xml", ".rels", ".txt", ".md", ".csv", ".tsv", ".srt", ".vtt", ".svg", ".html", ".htm", ".css", ".cube", ".3dl", ".obj", ".mtl", ".gltf", ".usda", ".idml", ".plist", ".yaml", ".yml", ".toml", ".ini"} ARCHIVE_MEMBERS = {".zip", ".lottie", ".formpkg"} -MAX_DEPTH = 3 -XMP_GPS_VALUE = re.compile(rb"GPS(?:Dest)?(?:Latitude|Longitude)\s*(?:=\s*[\"']\s*[^\"'\s]|>\s*[^<\s])", re.IGNORECASE) +FONT_MEMBERS = {".ttf", ".otf", ".woff", ".woff2"} +NAMED_BINARY = {".ase"} +PDF_STREAM = re.compile(rb"stream\r?\n(.*?)\r?\n?endstream", re.DOTALL) +PDF_STREAM_CAP = 256 * 1024 * 1024 +MAX_DEPTH = zipsafe.MAX_DEPTH +XMP_GPS_VALUE = re.compile(rb"GPS(?:Dest)?(?:Latitude|Longitude)[\"']?\s*(?:=\s*[\"']\s*[^\"'\s]|>\s*[^<\s]|:\s*[\"']?\s*[^\"'\s,}\]])", + re.IGNORECASE) Source = Union[str, bytes] @@ -112,13 +117,13 @@ def text_located(data: bytes) -> bool: return False -def clean_member(name: str, data: bytes, depth: int = 0) -> bytes: +def clean_member(name: str, data: bytes, depth: int = 0, budget: Optional[zipsafe.Budget] = None) -> bytes: ext = os.path.splitext(name)[1].lower() if ext in ARCHIVE_MEMBERS or data[:4] == b"PK\x03\x04": if depth >= MAX_DEPTH: raise LocationRemains(f"{name} nests archives too deeply to check") out = io.BytesIO() - _strip_archive(io.BytesIO(data), out, depth + 1) + _strip_archive(io.BytesIO(data), out, depth + 1, budget or zipsafe.Budget()) return out.getvalue() if ext == ".exr": clean = wipe_exr(data) @@ -132,27 +137,94 @@ def clean_member(name: str, data: bytes, depth: int = 0) -> bytes: if raster_located(clean) is not False or text_located(clean): raise LocationRemains(f"location could not be ruled out in {name}") return clean - if ext in TEXT_MEMBERS: + if ext in TEXT_MEMBERS or _json_text(data): clean = gpsscrub.scrub(data) if text_located(clean): raise LocationRemains(f"{name} still carries a location") return clean + if ext == ".pdf" or data[:5] == b"%PDF-": + if pdf_located(data): + raise LocationRemains(f"location could not be ruled out in {name}") + return data + if ext in FONT_MEMBERS: + if text_located(_font_tables(data)): + raise LocationRemains(f"{name} still carries a location") + return data + if ext in NAMED_BINARY: + if text_located(data): + raise LocationRemains(f"{name} still carries a location") + return data raise LocationRemains(f"{name} is a kind of file formDAM cannot check for a location") -def _strip_archive(source: Any, target: Any, depth: int) -> None: - with zipfile.ZipFile(source) as archive, zipfile.ZipFile(target, "w", allowZip64=True) as out: - for info in archive.infolist(): - data = b"" if info.is_dir() else clean_member(info.filename, archive.read(info), depth) - copy = zipfile.ZipInfo(info.filename, date_time=info.date_time) - copy.compress_type = info.compress_type - copy.external_attr = info.external_attr - out.writestr(copy, data) +def _json_text(data: bytes) -> bool: + head = data[:64].lstrip() + if not head[:1] in (b"{", b"["): + return False + try: + data.decode("utf-8") + except UnicodeDecodeError: + return False + return True + + +def _font_tables(data: bytes) -> bytes: + if data[:4] not in (b"wOFF", b"wOF2"): + return data + try: + from fontTools.ttLib import TTFont + + font = TTFont(io.BytesIO(data)) + font.flavor = None + out = io.BytesIO() + font.save(out) + return out.getvalue() + except Exception as exc: + raise LocationRemains("a font's tables could not be read") from exc + + +def pdf_located(data: bytes) -> bool: + import zlib + + if text_located(data): + return True + budget = PDF_STREAM_CAP + for match in PDF_STREAM.finditer(data): + body = match.group(1) + if body[:2] == b"\xff\xd8" and raster_located(body) is not False: + return True + try: + inflater = zlib.decompressobj() + plain = inflater.decompress(body, budget) + except zlib.error: + continue + budget -= len(plain) + if budget <= 0: + return True + if text_located(plain) or (plain[:2] == b"\xff\xd8" and raster_located(plain) is not False): + return True + return False + + +def _strip_archive(source: Any, target: Any, depth: int, budget: zipsafe.Budget) -> None: + try: + with zipfile.ZipFile(source) as archive, zipfile.ZipFile(target, "w", allowZip64=True) as out: + for info in zipsafe.members(archive, budget): + budget.count() + raw = b"" if info.is_dir() else zipsafe.read_member(archive, info, budget) + data = b"" if info.is_dir() else clean_member(info.filename, raw, depth, budget) + copy = zipfile.ZipInfo(info.filename, date_time=info.date_time) + copy.compress_type = info.compress_type + copy.external_attr = info.external_attr + out.writestr(copy, data) + except zipsafe.ArchiveTooLarge as exc: + raise LocationRemains(str(exc)) from exc def strip_zip(src: Source, dest: str) -> None: source: Any = io.BytesIO(src) if isinstance(src, (bytes, bytearray)) else src - _strip_archive(source, dest, 0) + outer = len(src) if isinstance(src, (bytes, bytearray)) else os.path.getsize(src) + _strip_archive(source, dest, 0, zipsafe.Budget(total_cap=max(zipsafe.TOTAL_CAP, outer * 4))) def _is_zip(src: Source) -> bool: @@ -171,14 +243,9 @@ def strip_file(row, src: Source, dest: str) -> None: else: with open(src, "rb") as handle: data = handle.read() + clean = clean_member(row["name"] if "name" in row.keys() else os.path.basename(dest), data) with open(dest, "wb") as handle: - handle.write(gpsscrub.scrub(data)) - found = gpsscrub.has_gps(dest) - with open(dest, "rb") as handle: - written = handle.read() - raster = os.path.splitext(dest)[1].lower() in RASTER_MEMBERS - if found is True or text_located(written) or (row["lat"] is not None and (not raster or found is not False)): - raise LocationRemains("location could not be removed from this file") + handle.write(clean) except (LocationRemains, zipfile.BadZipFile, OSError): if os.path.exists(dest): os.remove(dest) diff --git a/backend/app/services/gallerysvc.py b/backend/app/services/gallerysvc.py index 762fb8e..7f4b82d 100644 --- a/backend/app/services/gallerysvc.py +++ b/backend/app/services/gallerysvc.py @@ -66,11 +66,16 @@ def file_download(row, src: str, keep_location: bool) -> Optional[str]: folder = os.path.join(cache_dir(), "share") os.makedirs(folder, exist_ok=True) out = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_noloc{os.path.splitext(row['name'])[1].lower()}") + refused = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_noloc.refused") + if os.path.isfile(refused): + return None if not os.path.isfile(out): tmp = f"{out}.part" try: filestrip.strip_file(row, src, tmp) except (filestrip.LocationRemains, OSError, ValueError): + with open(refused, "w", encoding="utf-8"): + pass return None os.replace(tmp, out) return out diff --git a/backend/app/services/projectfile.py b/backend/app/services/projectfile.py index 63cf9c8..4cf23d9 100644 --- a/backend/app/services/projectfile.py +++ b/backend/app/services/projectfile.py @@ -57,11 +57,17 @@ def _data_url(value: Any) -> Optional[bytes]: def _member(archive: zipfile.ZipFile, names: Tuple[str, ...], cap: int) -> Optional[bytes]: - lower = {info.filename.lower(): info for info in archive.infolist()} + from . import zipsafe + + budget = zipsafe.Budget(total_cap=cap, member_cap=cap) + lower = {info.filename.lower(): info for info in zipsafe.members(archive, zipsafe.Budget())} for name in names: info = lower.get(name) - if info is not None and info.file_size <= cap: - return archive.read(info) + if info is not None: + try: + return zipsafe.read_member(archive, info, budget) + except zipsafe.ArchiveTooLarge: + return None return None @@ -71,7 +77,7 @@ def read_convention(path: str) -> Tuple[Dict[str, Any], Optional[Image.Image]]: with zipfile.ZipFile(path) as archive: raw = _member(archive, MANIFEST_NAMES, MAX_MANIFEST) preview = _image(_member(archive, PREVIEW_NAMES, MAX_PREVIEW)) - except (zipfile.BadZipFile, OSError, KeyError): + except (zipfile.BadZipFile, OSError, KeyError, ValueError): return {}, None try: manifest = json.loads(raw) if raw else {} diff --git a/backend/app/services/sequences.py b/backend/app/services/sequences.py index 7a6c46f..33e36db 100644 --- a/backend/app/services/sequences.py +++ b/backend/app/services/sequences.py @@ -176,13 +176,21 @@ def decode_frame(ext: str, data: bytes) -> Optional[Image.Image]: def extract(path: str, row: Dict[str, Any]) -> Extract: ext = (row.get("subkind") or "").lower() + from . import zipsafe + + budget = zipsafe.Budget(total_cap=zipsafe.MEMBER_CAP * 2) with zipfile.ZipFile(path) as archive: + if len(archive.infolist()) > zipsafe.MAX_MEMBERS * 5: + return Extract(meta={"error": "This sequence holds too many files"}) names = frame_names(archive) if not names: return Extract(meta={"error": "No numbered frames in this sequence"}) numbers = [n for n, _ in names] - first_bytes = archive.read(names[0][1]) - middle_bytes = archive.read(names[len(names) // 2][1]) + try: + first_bytes = zipsafe.read_member(archive, archive.getinfo(names[0][1]), budget) + middle_bytes = zipsafe.read_member(archive, archive.getinfo(names[len(names) // 2][1]), budget) + except zipsafe.ArchiveTooLarge as exc: + return Extract(meta={"error": str(exc)}) facts = frame_facts(ext, first_bytes) rate = facts.get("rate") or DEFAULT_RATE size = facts.get("size") diff --git a/backend/app/services/zipsafe.py b/backend/app/services/zipsafe.py new file mode 100644 index 0000000..bc7dd7b --- /dev/null +++ b/backend/app/services/zipsafe.py @@ -0,0 +1,53 @@ +import zipfile +from dataclasses import dataclass, field + +CHUNK = 1 << 20 +MEMBER_CAP = 512 * 1024 * 1024 +TOTAL_CAP = 2 * 1024 * 1024 * 1024 +MAX_MEMBERS = 20000 +MAX_DEPTH = 3 + + +class ArchiveTooLarge(ValueError): + pass + + +@dataclass +class Budget: + total_cap: int = TOTAL_CAP + member_cap: int = MEMBER_CAP + max_members: int = MAX_MEMBERS + used: int = 0 + members: int = 0 + seen: dict = field(default_factory=dict) + + def count(self) -> None: + self.members += 1 + if self.members > self.max_members: + raise ArchiveTooLarge("the archive holds too many files to check") + + +def read_member(archive: zipfile.ZipFile, info: zipfile.ZipInfo, budget: Budget) -> bytes: + cap = min(budget.member_cap, budget.total_cap - budget.used) + if info.file_size > cap: + raise ArchiveTooLarge(f"{info.filename} is too large to read") + parts = [] + size = 0 + with archive.open(info) as handle: + while True: + block = handle.read(CHUNK) + if not block: + break + size += len(block) + if size > cap: + raise ArchiveTooLarge(f"{info.filename} expands past the size limit") + parts.append(block) + budget.used += size + return b"".join(parts) + + +def members(archive: zipfile.ZipFile, budget: Budget) -> list: + infos = archive.infolist() + if len(infos) + budget.members > budget.max_members: + raise ArchiveTooLarge("the archive holds too many files to check") + return infos diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index 170fff1..51b77d8 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -331,6 +331,81 @@ def test_file_kinds_fail_closed_on_location(tmp_path): assert gpsscrub.has_gps(str(probe)) is False plain = tmp_path / "notes.srt" plain.write_text("1\n00:00:01,000 --> 00:00:02,000\nhello\n") + filestrip.strip_file({"kind": "resource", "lat": 10.0, "name": "notes.srt"}, str(plain), str(tmp_path / "n.srt")) + blob = tmp_path / "scene.bin" + blob.write_bytes(b"\x00\x01binary") + for lat in (None, 1.0): + with pytest.raises(filestrip.LocationRemains): + filestrip.strip_file({"kind": "model", "lat": lat, "name": "scene.bin"}, str(blob), str(tmp_path / "s.bin")) + assert not os.path.exists(tmp_path / "s.bin") + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("shot.png", b"\x89PNG\r\n\x1a\n broken") + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("x.json", b'{"exif:GPSLatitude": "1"} ') + assert filestrip.clean_member("p.fdec", b'{"manifest": {"title": "x"}}').startswith(b"{") + + +def pdf_bytes(xmp: bytes) -> bytes: + import zlib + + packed = zlib.compress(xmp) + return (b"%PDF-1.7\n1 0 obj << /Type /Metadata /Filter /FlateDecode /Length " + str(len(packed)).encode() + + b" >>\nstream\n" + packed + b"\nendstream\nendobj\ntrailer << >>\n%%EOF\n") + + +def test_pdf_metadata_streams_are_inflated_and_checked(tmp_path): + from app.services import filestrip + + clean = pdf_bytes(b'') + assert filestrip.clean_member("plan.pdf", clean) == clean + located = pdf_bytes(b'') + assert b"GPSLatitude" not in located + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("plan.pdf", located) + with pytest.raises(filestrip.LocationRemains): + filestrip.strip_file({"kind": "document", "lat": None, "name": "plan.pdf"}, located, str(tmp_path / "p.pdf")) + + +def test_share_refusal_is_remembered(client, tmp_path, monkeypatch): + from app.services import filestrip, gallerysvc + + src = tmp_path / "src" + os.makedirs(src) + (src / "odd.fcad").write_bytes(b"\x00binary project") + import_dir(client, src) + media_id = items(client)["odd.fcad"]["id"] + assert gallerysvc.download_path({"include_location": 0}, media_id) is None + calls = [] + monkeypatch.setattr(filestrip, "strip_file", lambda *a: calls.append(a)) + assert gallerysvc.download_path({"include_location": 0}, media_id) is None and calls == [] + + +def test_archive_checks_are_bounded(tmp_path): + import pytest + + from app.services import filestrip, zipsafe + + big = io.BytesIO() + with zipfile.ZipFile(big, "w", compression=zipfile.ZIP_DEFLATED) as archive: + archive.writestr("notes.txt", "a" * 50000) + with pytest.raises(filestrip.LocationRemains): + filestrip._strip_archive(io.BytesIO(big.getvalue()), io.BytesIO(), 0, zipsafe.Budget(member_cap=1000)) + with pytest.raises(filestrip.LocationRemains): + filestrip._strip_archive(io.BytesIO(big.getvalue()), io.BytesIO(), 0, zipsafe.Budget(total_cap=1000)) + many = io.BytesIO() + with zipfile.ZipFile(many, "w") as archive: + for n in range(5): + archive.writestr(f"n{n}.txt", "x") + with pytest.raises(filestrip.LocationRemains): + filestrip._strip_archive(io.BytesIO(many.getvalue()), io.BytesIO(), 0, zipsafe.Budget(max_members=3)) + layer = b"plain" + name = "deep.txt" + for depth in range(zipsafe.MAX_DEPTH + 2): + wrap = io.BytesIO() + with zipfile.ZipFile(wrap, "w") as archive: + archive.writestr(name, layer) + layer, name = wrap.getvalue(), f"level{depth}.zip" + deep = tmp_path / "deep.formpkg" + deep.write_bytes(layer) with pytest.raises(filestrip.LocationRemains): - filestrip.strip_file({"kind": "resource", "lat": 10.0}, str(plain), str(tmp_path / "n.srt")) - filestrip.strip_file({"kind": "resource", "lat": None}, str(plain), str(tmp_path / "n.srt")) + filestrip.strip_file({"kind": "project", "lat": None}, str(deep), str(tmp_path / "deep-out.formpkg")) From 81beeef0d3ea25dabe5bb8c31feb255baea40531 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:16:46 -0500 Subject: [PATCH 10/35] fix: refuse files with a stored location and PDF streams that cannot 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. --- backend/app/services/filestrip.py | 53 +++++++++++++++++++++++------ backend/tests/test_formats_extra.py | 16 ++++++++- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index e079336..5eae2ed 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -183,24 +183,50 @@ def _font_tables(data: bytes) -> bytes: raise LocationRemains("a font's tables could not be read") from exc -def pdf_located(data: bytes) -> bool: +PDF_FILTER = re.compile(rb"/Filter\s*(\[[^\]]*\]|/[A-Za-z0-9]+)") +PDF_ENCRYPT = re.compile(rb"/Encrypt\s") + + +def _pdf_filters(head: bytes) -> List[bytes]: + start = head.rfind(b" obj") + found = PDF_FILTER.search(head[start if start >= 0 else 0:]) + if not found: + return [] + return re.findall(rb"/([A-Za-z0-9]+)", found.group(1)) + + +def _inflate(body: bytes, budget: int) -> bytes: import zlib + inflater = zlib.decompressobj() + try: + plain = inflater.decompress(body, budget + 1) + except zlib.error as exc: + raise LocationRemains("a PDF stream could not be decoded") from exc + if len(plain) > budget or inflater.unconsumed_tail: + raise LocationRemains("a PDF stream expands past the size limit") + if not inflater.eof: + raise LocationRemains("a PDF stream ends early") + return plain + + +def pdf_located(data: bytes) -> bool: + if PDF_ENCRYPT.search(data): + raise LocationRemains("an encrypted PDF cannot be checked for a location") if text_located(data): return True budget = PDF_STREAM_CAP for match in PDF_STREAM.finditer(data): body = match.group(1) - if body[:2] == b"\xff\xd8" and raster_located(body) is not False: - return True - try: - inflater = zlib.decompressobj() - plain = inflater.decompress(body, budget) - except zlib.error: + filters = _pdf_filters(data[max(0, match.start() - 4096):match.start()]) + if filters == [b"DCTDecode"]: + if raster_located(body) is not False: + return True continue + if filters not in ([], [b"FlateDecode"], [b"Fl"]): + raise LocationRemains("a PDF stream uses an encoding formDAM cannot check") + plain = _inflate(body, budget) if filters else body budget -= len(plain) - if budget <= 0: - return True if text_located(plain) or (plain[:2] == b"\xff\xd8" and raster_located(plain) is not False): return True return False @@ -243,9 +269,16 @@ def strip_file(row, src: Source, dest: str) -> None: else: with open(src, "rb") as handle: data = handle.read() - clean = clean_member(row["name"] if "name" in row.keys() else os.path.basename(dest), data) + name = row["name"] if "name" in row.keys() else os.path.basename(dest) + clean = clean_member(name, data) with open(dest, "wb") as handle: handle.write(clean) + found = gpsscrub.has_gps(dest) + raster = os.path.splitext(name)[1].lower() in RASTER_MEMBERS + if found is True: + raise LocationRemains("location could not be removed from this file") + if row["lat"] is not None and not (raster and found is False and raster_located(clean) is False): + raise LocationRemains("this item has a location and the file cannot be shown to be free of it") except (LocationRemains, zipfile.BadZipFile, OSError): if os.path.exists(dest): os.remove(dest) diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index 51b77d8..899c465 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -331,7 +331,13 @@ def test_file_kinds_fail_closed_on_location(tmp_path): assert gpsscrub.has_gps(str(probe)) is False plain = tmp_path / "notes.srt" plain.write_text("1\n00:00:01,000 --> 00:00:02,000\nhello\n") - filestrip.strip_file({"kind": "resource", "lat": 10.0, "name": "notes.srt"}, str(plain), str(tmp_path / "n.srt")) + with pytest.raises(filestrip.LocationRemains): + filestrip.strip_file({"kind": "resource", "lat": 10.0, "name": "notes.srt"}, str(plain), str(tmp_path / "n.srt")) + assert not os.path.exists(tmp_path / "n.srt") + filestrip.strip_file({"kind": "resource", "lat": None, "name": "notes.srt"}, str(plain), str(tmp_path / "n.srt")) + clean_jpg = tmp_path / "clean.jpg" + Image.new("RGB", (8, 8)).save(clean_jpg) + filestrip.strip_file({"kind": "resource", "lat": 5.0, "name": "clean.jpg"}, str(clean_jpg), str(tmp_path / "c.jpg")) blob = tmp_path / "scene.bin" blob.write_bytes(b"\x00\x01binary") for lat in (None, 1.0): @@ -364,6 +370,14 @@ def test_pdf_metadata_streams_are_inflated_and_checked(tmp_path): filestrip.clean_member("plan.pdf", located) with pytest.raises(filestrip.LocationRemains): filestrip.strip_file({"kind": "document", "lat": None, "name": "plan.pdf"}, located, str(tmp_path / "p.pdf")) + plain = b"%PDF-1.4\n1 0 obj << /Length 5 >>\nstream\nhello\nendstream\nendobj\n%%EOF\n" + assert filestrip.clean_member("a.pdf", plain) == plain + for bad in (plain.replace(b"/Length 5", b"/Filter /LZWDecode /Length 5"), + plain.replace(b"/Length 5", b"/Filter /FlateDecode /Length 5"), + plain.replace(b"/Length 5", b"/Filter [/ASCII85Decode /FlateDecode] /Length 5"), + plain.replace(b"%%EOF", b"trailer << /Encrypt 9 0 R >>\n%%EOF")): + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", bad) def test_share_refusal_is_remembered(client, tmp_path, monkeypatch): From c46ec8015dfd3ae9ec573403e28ffcfa2853e5f4 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:16:54 -0500 Subject: [PATCH 11/35] feat: fonts, colour LUTs, captions, palettes and Lottie as design resources 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. --- LICENSES.md | 3 + README.md | 2 +- backend/HASHOUT_LOG.md | 19 +- backend/app/routers/assets.py | 51 ++++- backend/app/routers/browse.py | 2 +- backend/app/routers/importer.py | 2 +- backend/app/routers/mediaapi.py | 1 + backend/app/routers/system.py | 1 + backend/app/services/assetkinds.py | 7 +- backend/app/services/captionres.py | 74 ++++++++ backend/app/services/classify.py | 11 ++ backend/app/services/fontres.py | 70 +++++++ backend/app/services/libraryfs.py | 14 +- backend/app/services/lottieres.py | 148 +++++++++++++++ backend/app/services/lutres.py | 127 +++++++++++++ backend/app/services/paletteres.py | 86 +++++++++ backend/app/services/query.py | 3 + backend/requirements.txt | 2 + backend/requirements_macos.txt | 2 + backend/tests/test_design_resources.py | 216 ++++++++++++++++++++++ frontend/HASHOUT_LOG.md | 7 + frontend/package-lock.json | 9 + frontend/package.json | 3 + frontend/src/engine/assetkinds.ts | 76 ++++++++ frontend/src/engine/store.ts | 1 + frontend/src/main.ts | 2 + frontend/src/styles/assets.css | 16 ++ frontend/src/ui/components/assetbodies.ts | 62 +++++++ frontend/src/ui/components/library.ts | 6 +- frontend/src/ui/components/organize.ts | 3 +- frontend/src/ui/components/pages.ts | 2 +- frontend/src/ui/components/sidebar.ts | 1 + frontend/tests/assets.test.ts | 21 ++- 33 files changed, 1037 insertions(+), 13 deletions(-) create mode 100644 backend/app/services/captionres.py create mode 100644 backend/app/services/fontres.py create mode 100644 backend/app/services/lottieres.py create mode 100644 backend/app/services/lutres.py create mode 100644 backend/app/services/paletteres.py create mode 100644 backend/tests/test_design_resources.py create mode 100644 frontend/src/ui/components/assetbodies.ts diff --git a/LICENSES.md b/LICENSES.md index 53e6888..25268e2 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -46,6 +46,8 @@ Adobe, Bridge, Lightroom and Photoshop are either registered trademarks or trade | YuNet model | MIT | bundled via --add-data | | SFace model | Apache-2.0 | bundled via --add-data | | resvg_py 0.5.0 | MIT (binding); resvg and its crates MIT OR Apache-2.0, with Zlib, BSD-2-Clause, BSD-3-Clause, Unlicense OR MIT, Apache-2.0 WITH LLVM-exception and Unicode-3.0 parts, read from the wheel's CycloneDX SBOM 2026-11-29 | SVG and SVGZ thumbnails and renders (services/imagex.py). One compiled library in the wheel, no system dependency; references resolve inside an empty folder | +| fonttools 4.69.1 | MIT | font names, glyph counts, outlines and variable axes for the font resource facts (services/fontres.py), and WOFF and WOFF2 unpacking before a font is checked for location (services/filestrip.py) | +| brotli 1.2.1 | MIT | WOFF2 decompression under fontTools | | pyzipper 0.4.0 | MIT | AES-256 (WinZip AE-2) zip writing and reading for encrypted share packages, services/packagesvc.py | | pycryptodomex (pyzipper dependency) | BSD-2-Clause and public domain | AES and HMAC under pyzipper | | LaMa inpainting (opencv/inpainting_lama, inpainting_lama_2025jan.onnx, revision aee6d22) | Apache-2.0 | Clean Up object removal in services/cleanup.py; fetched by the installers & build script, sha256-pinned, into backend/models; bundled via --add-data like the other models. Without it Clean Up falls back to OpenCV Telea | @@ -55,6 +57,7 @@ Adobe, Bridge, Lightroom and Photoshop are either registered trademarks or trade | Wikidata landmarks, artworks and dishes (backend/app/data/lookup_world.json.gz, built by setup/gen_lookup_data.py via the QLever Wikidata endpoint) | CC0-1.0 | Look Up names, coordinates and artist credits; no attribution required | | YOLOX-s (opencv/object_detection_yolox, object_detection_yolox_2022nov.onnx, revision 78c368f) | Apache-2.0 | Clean Up distraction suggestions (COCO classes) in services/cleanmodels.py; sha256-pinned like LaMa | | Form app extensions and identifiers (backend/app/data/form_apps.json) | written for formDAM (Apache-2.0, as the repository) | app ids, names, bundle identifiers and project file extensions, which are facts about the family's apps; no code or text is copied from the FormPortal catalogue it agrees with. App icons are not copied: the engine draws a monogram tile instead | +| lottie-web 5.12.2 (build/player/lottie_light) | MIT | plays Lottie animations in the viewer, loaded only when one is opened; the light build has no expression support, so animation files cannot run script, and the engine replaces every non-embedded image reference before the window sees the data | | formDAM icon artwork | user-provided | src-tauri/icons/icon.png, used verbatim | | rapidocr-onnxruntime 1.2.3 (macOS) | Apache-2.0 | text-in-image search (services/ocrsvc.py); the wheel carries its PP-OCR detection, classification and recognition ONNX models (PaddleOCR, Apache-2.0). Installed only by requirements_macos.txt, so the Linux and Windows engines search text with tesseract on PATH | | Other Python packages frozen into the engine | MIT: annotated-doc, annotated-types, anyio, fastapi, h11, pydantic, pydantic-core, typing-inspection; MIT-0: cffi; BSD-3-Clause: click, idna, pycparser, protobuf, starlette; BSD: uvicorn; Apache-2.0: flatbuffers; Apache-2.0 OR BSD-2-Clause: packaging; PSF-2.0: typing-extensions; exifread: its own permissive notice (Copyright 2002-2007 Gene Cash) | read from the installed metadata of backend/requirements.txt, 2026-10-23 | diff --git a/README.md b/README.md index daa8d27..031b9bc 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@

Formats

- Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP + Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app), fonts (OTF, TTF, WOFF, WOFF2) with a specimen, colour LUTs (.cube, .3dl) as a before and after, captions (SRT, VTT), ASE palettes and Lottie animations (JSON and .lottie) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 2293eef..e5c844a 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -32,6 +32,23 @@ The EXR header reader took each attribute's size as a signed int and trusted it, Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the library without its location (export, packages, shares) now goes through filestrip, which works on an allowlist and refuses whatever it cannot check. An archive (any zip, including sequences, zip-based projects, dotLottie and form.ext packages) is rebuilt member by member, nested archives in memory up to three levels: EXR members have their latitude, longitude and altitude attributes renamed in place to x of the same length and their values zeroed (so the offset table still points at the right bytes) and are read back to confirm; DPX members have their user-defined data block (from byte 2048, the length at byte 32) zeroed, the only place the format leaves for such data; raster members (JPEG, PNG, TIFF, WebP) pass through gpsscrub and must then read as having no GPS; text members (JSON, XML, SVG, captions, LUTs and the like) pass through gpsscrub; and every member is searched for a GPS or GPSDest latitude or longitude with a value, as an attribute or an element, any spacing or quote style, any case, in the bytes and in a UTF-16 reading of them. Any other member type, an unreadable header or a value still present raises LocationRemains, which export and packages report as a refusal and shares as a skipped item. A single non-archive file is scrubbed and refused when GPS reads present, an XMP GPS value is found, or the row has a location and the file is not a raster formDAM can verify. +### services/fontres.py, lutres.py, captionres.py, paletteres.py, lottieres.py · design resources +- refers-to: fontres (new) extract, specimen, _names; lutres (new) parse_cube, parse_3dl, apply, sample_image, before_after; captionres (new) parse, seconds, extract; paletteres (new) parse_ase, to_rgb, extract; lottieres (new) looks_lottie, sniff, load_bytes, load_path, _inline_images, sanitise, facts, extract; classify RESOURCE_EXTS, LOTTIE_JSON, file_kind; libraryfs._lottie_json, gather_items, import_one; importer upload check; assetkinds _load; routers/assets.py /media/{id}/lottie, /media/{id}/cues, _original_bytes; query FLAGS resource, font, lut, caption, palette, lottie; mediaapi FILTERS resources; summary resources; browse MEDIA_TYPES; requirements fonttools, brotli; tests/test_design_resources.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +Design resources are one kind, resource, with the subkind naming what they are, so the Design Resources filter shows them together and the font, lut, caption, palette and lottie flags pick each out for smart albums. + +Fonts (OTF, TTF, WOFF, WOFF2) open with Pillow's FreeType for the specimen (family and style, the alphabet, a pangram and the digits on a page) and with fontTools for the facts (names 1, 2, 4, 5, 9 and 13, glyph count, outline type, variable axes, WOFF flavour). The family and style become the title and are searchable. In the window the specimen is live: the original is loaded as a FontFace and drawn at four sizes with text the person types. + +LUTs: .cube (3D, or 1D, with DOMAIN_MIN and DOMAIN_MAX, red fastest) and .3dl (an optional first row of input values, then integer rows with blue fastest, bit depth taken from the largest value) are read into a normalised table and applied with trilinear interpolation (1D by per-channel interpolation) to a test image drawn by the engine: a hue sweep at rising brightness, a grey ramp and four skin, foliage and sky patches. The preview is that image before and after, side by side. Tables larger than 129 per side are refused. + +Captions: SubRip and WebVTT cues (header, NOTE, STYLE and REGION blocks skipped, inline tags removed) give the cue count, running time, words and language (the VTT header or a language code in the name, as in talk.en.srt). The cue text goes into the full-text column, so the Text field and the search find spoken words; the cue list is kept beside the preview and served by /media/{id}/cues for the viewer. + +Palettes: ASE colour blocks in RGB, CMYK (naive conversion), LAB (D65) and Gray become hex swatches with their names; groups are counted. Up to 256 swatches travel in the item's facts so the viewer shows names and values; the preview is the swatch grid. + +Lottie: a .lottie (dotLottie) zip, or a .json whose top level has v, fr, ip, op, w, h and layers. A .json is opened only after its first 4 KiB look like one, so folders of settings files are not imported. The facts are canvas size, rate, frames, duration, layers and assets. The grid shows a drawn card, since rendering a frame would need a Lottie renderer in the engine; the viewer plays the animation with lottie-web's light build. The window never gets the file as it is: /media/{id}/lottie returns the animation with every image asset that is not a data: URI emptied, so nothing is fetched from the network or the disk, and the images inside a .lottie are inlined as data URIs, each read and encoded once, with a 64 MiB total and at most 2000 assets (past either, no animation is shown). + ### services/filestrip.py, zipsafe.py · bounded archive reads, one allowlist for every file - refers-to: zipsafe (new) Budget, read_member, members, ArchiveTooLarge, MEMBER_CAP, TOTAL_CAP, MAX_MEMBERS, MAX_DEPTH; filestrip clean_member (PDF, fonts, ASE, JSON sniff), pdf_located, _font_tables, _json_text, _strip_archive budget, strip_zip, strip_file; gallerysvc.file_download refusal marker; projectfile._member; sequences.extract; tests/test_formats_extra.py - kind: fix @@ -39,7 +56,7 @@ Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the Every archive formDAM opens for a preview, metadata or a location strip now reads through zipsafe: each member is read in 1 MiB chunks from archive.open(), checked against its declared file_size first and its real size as it grows, against a per-member cap (512 MiB), and against one running total for the whole operation, nested archives included (2 GiB, or four times the outer file when that is larger, so a stored sequence of large EXR frames still exports). A member count above 20 000 and nesting deeper than three levels are refused. Any limit reached during a strip raises LocationRemains, so the item is refused rather than handed over unchecked; for a preview it shows as unreadable. -A file that is not an archive takes the same allowlist as a member: rasters must read back with no GPS (an unreadable raster counts as not verified), EXR and DPX are wiped and re-read, known text and anything that parses as UTF-8 JSON is scrubbed and searched (the search now also takes the JSON form "GPSLatitude": value), PDFs are searched raw and with every stream inflated (up to 256 MiB in all) and every embedded JPEG checked, fonts are searched in their name strings after a WOFF or WOFF2 is unpacked with fontTools, and ASE palettes in their UTF-16 names. Anything else is refused whatever the row's lat says. A share that was refused leaves {id}_{sha}_noloc.refused in cache/share, so the next request for it is refused at once; the marker carries the media id, so the vault's scrub and a changed file (another sha) clear it. +A file that is not an archive takes the same allowlist as a member: rasters must read back with no GPS (an unreadable raster counts as not verified), EXR and DPX are wiped and re-read, known text and anything that parses as UTF-8 JSON is scrubbed and searched (the search now also takes the JSON form "GPSLatitude": value), PDFs are searched raw and with every stream inflated (up to 256 MiB in all) and every embedded JPEG checked, fonts are searched in their name strings after a WOFF or WOFF2 is unpacked with fontTools, and ASE palettes in their UTF-16 names. Anything else is refused whatever the row's lat says. On top of the verifiers, the written file must read as having no GPS, and when the row holds a location the file must be a raster that reads back clean both through has_gps and through Pillow; a text, PDF or font file with a stored location is refused, since its content can only be searched, not shown to be free of it. In a PDF, an /Encrypt entry, a stream whose filters are anything but none, FlateDecode, or a lone DCTDecode (checked as a JPEG), and a FlateDecode stream that does not inflate completely within the budget all refuse the file; formDAM carries no PDF parser that could decode the other filters (pypdf is not a dependency here). A share that was refused leaves {id}_{sha}_noloc.refused in cache/share, so the next request for it is refused at once; the marker carries the media id, so the vault's scrub and a changed file (another sha) clear it. ### services/imagex.py, sequences.py, routers/assets.py play · more still and video formats, image sequences - refers-to: imagex (new) EXTRA_EXTS, open_extra, extra_size, ffmpeg_still, parse_pfm, tonemap, psd_thumbnail, svg_size, sanitise_svg, render_svg, _spill; decode.open_image and image_size; classify IMAGE_EXTS, VIDEO_EXTS, CAMERA_RAW_VIDEO, SEQUENCE_EXTS, is_camera_raw_video; libraryfs.gather_items, import_item, import_one as_kind; sequences (new) FrameSequence, group, pack, import_sequence, extract, strip_location; importer start_import; outputsvc._copy_file_kind; packagesvc._payload; gallerysvc.file_download; routers/assets.py /media/{id}/play, play_path, play_command; mediaapi.inert_headers; guard._any_token /play and /page; vaultcrypt _scrub, _scrub_vaulted and _drop_plain_audio cover cache/play; query FLAGS sequence, camera_raw_video; mediaapi FILTERS sequences; summary sequences; tests/test_formats_extra.py diff --git a/backend/app/routers/assets.py b/backend/app/routers/assets.py index 395a000..be23dda 100644 --- a/backend/app/routers/assets.py +++ b/backend/app/routers/assets.py @@ -3,6 +3,7 @@ import subprocess from fastapi import APIRouter, HTTPException, Request +from fastapi.responses import JSONResponse from ..config import cache_dir from ..db import q1 @@ -10,7 +11,7 @@ from ..services import assetstore, assetwork, classify, formapps, libraryfs from .files import _path from .guard import ensure_visible -from .revalidate import must_not_store, revalidated_file +from .revalidate import NO_STORE, REVALIDATE, must_not_store, revalidated_file router = APIRouter() @@ -93,3 +94,51 @@ def media_play(media_id: int, request: Request): finally: assetstore.discard(tmp) return revalidated_file(request, out, "video/webm") + + +def _resource_row(media_id: int, request: Request, subkind: str): + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + ensure_visible(row, request) + if row["kind"] != "resource" or row["subkind"] != subkind: + raise HTTPException(415, detail=f"This item is not a {subkind} resource") + return row + + +def _original_bytes(row) -> bytes: + from .. import vaultcrypt + + sealed = vaultcrypt.opener(row) + if sealed is not None: + return sealed.read_all() + path = libraryfs.abs_path(row["rel_path"]) + data = assetstore.read_capped(path) + if data is None: + raise HTTPException(404, detail="Original file missing on disk or too large to read here") + return data + + +def _json_response(body, guarded: bool) -> JSONResponse: + return JSONResponse(body, headers={"Cache-Control": NO_STORE if guarded else REVALIDATE}) + + +@router.get("/media/{media_id}/lottie") +def media_lottie(media_id: int, request: Request): + from ..services import lottieres + + row = _resource_row(media_id, request, "lottie") + data, _ = lottieres.load_bytes(_original_bytes(row)) + if data is None: + raise HTTPException(422, detail="No Lottie animation in this file") + return _json_response(lottieres.sanitise(data), must_not_store(row)) + + +@router.get("/media/{media_id}/cues") +def media_cues(media_id: int, request: Request): + from ..services import captionres + + row = _resource_row(media_id, request, "caption") + guarded = must_not_store(row) + cues = None if guarded else assetstore.load_json(media_id, "cues") + if cues is None: + cues, _ = captionres.parse(_original_bytes(row)[: captionres.MAX_BYTES].decode("utf-8", "replace")) + return _json_response({"cues": cues}, guarded) diff --git a/backend/app/routers/browse.py b/backend/app/routers/browse.py index b3f3544..c8b59f7 100644 --- a/backend/app/routers/browse.py +++ b/backend/app/routers/browse.py @@ -11,7 +11,7 @@ router = APIRouter() MEDIA_TYPES = [ - ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("sequence", "Image sequences"), ("camera_raw_video", "Camera raw video"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), + ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("sequence", "Image sequences"), ("camera_raw_video", "Camera raw video"), ("font", "Fonts"), ("lut", "Colour LUTs"), ("caption", "Captions"), ("palette", "Palettes"), ("lottie", "Lottie animations"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), ("panorama", "Panoramas"), ("timelapse", "Time-lapse"), ("slomo", "Slo-mo"), ("cinematic", "Cinematic"), ("burst", "Bursts"), ("spatial", "Spatial"), ("long_exposure", "Long Exposure"), ("animated", "Animated"), ("raw", "RAW"), ("screenshot", "Screenshots"), ("screen_recording", "Screen Recordings"), diff --git a/backend/app/routers/importer.py b/backend/app/routers/importer.py index b046174..0cfc232 100644 --- a/backend/app/routers/importer.py +++ b/backend/app/routers/importer.py @@ -84,7 +84,7 @@ def import_upload(files: List[UploadFile] = File(...)): with tempfile.TemporaryDirectory(prefix="dam-drop-") as tmp: for upload in files: name = os.path.basename(upload.filename or "dropped") - if os.path.splitext(name)[1].lower() not in UPLOAD_EXTS and classify.media_kind(name)[0] is None: + if os.path.splitext(name)[1].lower() not in UPLOAD_EXTS | {".json"} and classify.media_kind(name)[0] is None: counts["skipped"] += 1 continue local = os.path.join(tmp, name) diff --git a/backend/app/routers/mediaapi.py b/backend/app/routers/mediaapi.py index ea6daf3..ba33d8d 100644 --- a/backend/app/routers/mediaapi.py +++ b/backend/app/routers/mediaapi.py @@ -23,6 +23,7 @@ "audio": ("AND kind='audio'", "created_ts DESC, id DESC"), "projects": ("AND kind='project'", "created_ts DESC, id DESC"), "sequences": ("AND kind='sequence'", "created_ts DESC, id DESC"), + "resources": ("AND kind='resource'", "created_ts DESC, id DESC"), "screenshots": ("AND is_screenshot=1", "created_ts DESC, id DESC"), "screenrecs": ("AND is_screen_rec=1", "created_ts DESC, id DESC"), "not_in_album": ("AND id NOT IN (SELECT media_id FROM album_items)", "created_ts DESC, id DESC"), diff --git a/backend/app/routers/system.py b/backend/app/routers/system.py index b90d643..8f409d7 100644 --- a/backend/app/routers/system.py +++ b/backend/app/routers/system.py @@ -107,6 +107,7 @@ def count(sql: str) -> int: "audio": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='audio'"), "projects": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='project'"), "sequences": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='sequence'"), + "resources": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='resource'"), "screenshots": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screenshot=1"), "screenrecs": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screen_rec=1"), "favorites": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND favorite=1"), diff --git a/backend/app/services/assetkinds.py b/backend/app/services/assetkinds.py index 72e2a84..c66fbfd 100644 --- a/backend/app/services/assetkinds.py +++ b/backend/app/services/assetkinds.py @@ -38,7 +38,12 @@ def _load() -> None: if _loaded["done"]: return _loaded["done"] = True - from . import projectfile, sequences + from . import captionres, fontres, lottieres, lutres, paletteres, projectfile, sequences register("project", projectfile.extract) register("sequence", sequences.extract) + register("resource:font", fontres.extract) + register("resource:lut", lutres.extract) + register("resource:caption", captionres.extract) + register("resource:palette", paletteres.extract) + register("resource:lottie", lottieres.extract) diff --git a/backend/app/services/captionres.py b/backend/app/services/captionres.py new file mode 100644 index 0000000..55630c9 --- /dev/null +++ b/backend/app/services/captionres.py @@ -0,0 +1,74 @@ +import os +import re +from typing import Any, Dict, List, Optional, Tuple + +from . import cards +from .assetkinds import Extract + +STAMP = re.compile(r"(?:(\d+):)?(\d{1,2}):(\d{2})[.,](\d{1,3})") +ARROW = re.compile(r"^\s*(\S+)\s+-->\s+(\S+)") +TAG = re.compile(r"<[^>]+>|\{\\[^}]*\}") +LANG_IN_NAME = re.compile(r"\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.(?:srt|vtt)$", re.IGNORECASE) +MAX_CUES = 5000 +MAX_BYTES = 16 * 1024 * 1024 + + +def seconds(stamp: str) -> Optional[float]: + match = STAMP.fullmatch(stamp.strip()) + if not match: + return None + hours, minutes, secs, millis = match.groups() + return int(hours or 0) * 3600 + int(minutes) * 60 + int(secs) + int(millis.ljust(3, "0")) / 1000 + + +def parse(text: str) -> Tuple[List[Dict[str, Any]], Dict[str, Any]]: + body = text.lstrip("").replace("\r\n", "\n").replace("\r", "\n") + header: Dict[str, Any] = {} + blocks = re.split(r"\n\s*\n", body) + if blocks and blocks[0].startswith("WEBVTT"): + for line in blocks[0].splitlines()[1:]: + if ":" in line: + key, value = line.split(":", 1) + header[key.strip().lower()] = value.strip() + blocks = blocks[1:] + header["format"] = "WebVTT" + else: + header["format"] = "SubRip" + cues: List[Dict[str, Any]] = [] + for block in blocks: + lines = [ln for ln in block.split("\n") if ln.strip()] + timing = next((i for i, ln in enumerate(lines) if "-->" in ln), None) + if timing is None or lines[0].startswith(("NOTE", "STYLE", "REGION")): + continue + match = ARROW.match(lines[timing]) + start, end = (seconds(match.group(1)), seconds(match.group(2))) if match else (None, None) + if start is None or end is None: + continue + cue_text = TAG.sub("", "\n".join(lines[timing + 1:])).strip() + cues.append({"start": round(start, 3), "end": round(end, 3), "text": cue_text}) + if len(cues) >= MAX_CUES: + break + return cues, header + + +def clock(value: float) -> str: + minutes, secs = divmod(int(value), 60) + hours, minutes = divmod(minutes, 60) + return f"{hours}:{minutes:02d}:{secs:02d}" if hours else f"{minutes}:{secs:02d}" + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + with open(path, "rb") as handle: + raw = handle.read(MAX_BYTES) + cues, header = parse(raw.decode("utf-8", "replace")) + if not cues: + return Extract(meta={"error": "No timed cues in this file", "format": header.get("format")}) + name = row.get("name") or os.path.basename(path) + found = LANG_IN_NAME.search(name) + language = header.get("language") or (found.group(1) if found else None) + meta = {"format": header["format"], "cues": len(cues), "duration": cues[-1]["end"], "language": language, + "words": sum(len(c["text"].split()) for c in cues)} + lines = "\n".join(f"{clock(c['start'])} {c['text']}" for c in cues[:24]) + return Extract(meta=meta, text=" ".join(c["text"] for c in cues), duration=cues[-1]["end"], + pages=len(cues), preview=cards.text_page(lines, f"{header['format']} · {len(cues)} cues"), + extras={"cues": cues}) diff --git a/backend/app/services/classify.py b/backend/app/services/classify.py index 81549dc..3db6220 100644 --- a/backend/app/services/classify.py +++ b/backend/app/services/classify.py @@ -22,6 +22,12 @@ "ogv": "video/ogg", "r3d": "video/x-red-r3d", "braw": "video/x-blackmagic-raw", } CAMERA_RAW_VIDEO = {"r3d", "braw"} +RESOURCE_EXTS = { + "otf": ("font", "font/otf"), "ttf": ("font", "font/ttf"), "woff": ("font", "font/woff"), "woff2": ("font", "font/woff2"), + "cube": ("lut", "text/plain"), "3dl": ("lut", "text/plain"), "srt": ("caption", "application/x-subrip"), + "vtt": ("caption", "text/vtt"), "ase": ("palette", "application/octet-stream"), "lottie": ("lottie", "application/zip"), +} +LOTTIE_JSON = ("resource", "application/json", "lottie") SEQUENCE_EXTS = {"exr", "dpx", "png", "tif", "tiff"} AUDIO_EXTS = { "mp3": "audio/mpeg", "m4a": "audio/mp4", "aac": "audio/aac", "wav": "audio/wav", "aiff": "audio/aiff", @@ -60,6 +66,11 @@ def media_kind(name: str): def file_kind(name: str): from . import formapps + ext = ext_of(name) + if ext in RESOURCE_EXTS: + subkind, mime = RESOURCE_EXTS[ext] + return "resource", mime, subkind + app = formapps.app_for_name(name) if app is not None: return "project", PROJECT_MIME, app["id"] diff --git a/backend/app/services/fontres.py b/backend/app/services/fontres.py new file mode 100644 index 0000000..fda65ca --- /dev/null +++ b/backend/app/services/fontres.py @@ -0,0 +1,70 @@ +import logging +from typing import Any, Dict, Optional + +from PIL import Image, ImageDraw, ImageFont + +from . import cards +from .assetkinds import Extract + +logger = logging.getLogger(__name__) + +SAMPLE_LINES = ("Aa Bb Cc Dd Ee Ff Gg Hh", "The quick brown fox jumps over the lazy dog", "0123456789 .,;:!? &@#") +NAME_IDS = {"family": 1, "style": 2, "full_name": 4, "version": 5, "designer": 9, "licence": 13} +FLAVOURS = {"woff": "WOFF", "woff2": "WOFF2"} + + +def _names(path: str) -> Dict[str, Any]: + try: + from fontTools.ttLib import TTFont + + font = TTFont(path, lazy=True, fontNumber=0) + except Exception as exc: + logger.info("font tables unreadable: %s", exc) + return {} + out: Dict[str, Any] = {} + try: + names = font["name"] + for key, ident in NAME_IDS.items(): + record = names.getDebugName(ident) + if record: + out[key] = record.strip()[:300] + out["glyphs"] = int(font["maxp"].numGlyphs) + out["outlines"] = "PostScript (CFF)" if "CFF " in font or "CFF2" in font else "TrueType" + if "fvar" in font: + out["axes"] = [axis.axisTag for axis in font["fvar"].axes] + out["format"] = FLAVOURS.get(font.flavor or "", "OpenType" if "CFF " in font else "TrueType") + except Exception as exc: + logger.info("font tables incomplete: %s", exc) + finally: + font.close() + return out + + +def specimen(path: str, title: str, size: int = 1024) -> Optional[Image.Image]: + width, height = size, int(size * 0.62) + canvas = Image.new("RGB", (width, height), cards.PAGE_BG) + draw = ImageDraw.Draw(canvas) + margin = int(width * 0.05) + try: + y = margin + for line, scale in ((title, 0.075), (SAMPLE_LINES[0], 0.06), (SAMPLE_LINES[1], 0.04), (SAMPLE_LINES[2], 0.04)): + face = ImageFont.truetype(path, max(8, int(width * scale))) + draw.text((margin, y), line, font=face, fill=cards.PAGE_INK) + y += int(width * scale * 1.5) + except (OSError, ValueError) as exc: + logger.info("font specimen failed: %s", exc) + return None + return canvas + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + meta = _names(path) + try: + family, style = ImageFont.truetype(path, 24).getname() + meta.setdefault("family", family) + meta.setdefault("style", style) + except (OSError, ValueError): + meta.setdefault("error", "This font could not be opened") + title = " ".join(part for part in (meta.get("family"), meta.get("style")) if part) or row.get("name", "") + return Extract(meta=meta, title=title or None, text=" ".join(str(meta.get(k, "")) for k in ("family", "style", "designer")), + preview=specimen(path, title)) diff --git a/backend/app/services/libraryfs.py b/backend/app/services/libraryfs.py index 4828ab0..ff4f11c 100644 --- a/backend/app/services/libraryfs.py +++ b/backend/app/services/libraryfs.py @@ -30,7 +30,7 @@ def gather_items(root: str) -> List[Any]: found: List[Any] = [] if os.path.isfile(root): kind, _ = classify.media_kind(os.path.basename(root)) - return [root] if kind else [] + return [root] if kind or _lottie_json(root) else [] for base, dirs, names in os.walk(root): dirs[:] = [d for d in dirs if not d.startswith(".")] visible = sorted(name for name in names if not name.startswith(".")) @@ -38,11 +38,19 @@ def gather_items(root: str) -> List[Any]: found.extend(groups) for name in singles: kind, _ = classify.media_kind(name) - if kind: + if kind or _lottie_json(os.path.join(base, name)): found.append(os.path.join(base, name)) return found +def _lottie_json(path: str) -> bool: + if not path.lower().endswith(".json"): + return False + from . import lottieres + + return lottieres.sniff(path) + + def gather_media(root: str) -> List[str]: return [item for item in gather_items(root) if isinstance(item, str)] @@ -71,6 +79,8 @@ def _dest_for(created_ts: float, name: str) -> str: def import_one(path: str, move: bool = False, reference: bool = False, as_kind: Optional[Tuple[str, str, str]] = None) -> Dict[str, Any]: name = os.path.basename(path) + if as_kind is None and _lottie_json(path): + as_kind = classify.LOTTIE_JSON kind, mime = (as_kind[0], as_kind[1]) if as_kind else classify.media_kind(name) if not kind: return {"status": "skipped-kind"} diff --git a/backend/app/services/lottieres.py b/backend/app/services/lottieres.py new file mode 100644 index 0000000..fe72240 --- /dev/null +++ b/backend/app/services/lottieres.py @@ -0,0 +1,148 @@ +import json +import zipfile +from typing import Any, Dict, Optional, Tuple + +from . import cards +from .assetkinds import Extract + +MAX_JSON = 64 * 1024 * 1024 +MAX_INLINE = 64 * 1024 * 1024 +MAX_ASSETS = 2000 +LOTTIE_KEYS = ("v", "fr", "ip", "op", "w", "h", "layers") + + +def looks_lottie(data: Any) -> bool: + return isinstance(data, dict) and all(key in data for key in LOTTIE_KEYS) and isinstance(data.get("layers"), list) + + +def sniff(path: str) -> bool: + try: + with open(path, "rb") as handle: + head = handle.read(4096) + except OSError: + return False + if not head.lstrip().startswith(b"{") or b'"layers"' not in head and b'"fr"' not in head: + return False + return load_path(path)[0] is not None + + +def _from_zip(source: Any) -> Tuple[Optional[Dict[str, Any]], Dict[str, Any]]: + from . import zipsafe + + budget = zipsafe.Budget(total_cap=MAX_JSON * 2 + MAX_INLINE, member_cap=MAX_JSON) + with zipfile.ZipFile(source) as archive: + infos = [i for i in zipsafe.members(archive, budget) if i.filename.lower().endswith(".json")] + manifest: Dict[str, Any] = {} + named = next((i for i in infos if i.filename.lower() == "manifest.json"), None) + try: + if named is not None: + try: + manifest = json.loads(zipsafe.read_member(archive, named, budget)) + except ValueError: + manifest = {} + for info in infos: + if info.filename.lower().startswith("animations/"): + try: + data = json.loads(zipsafe.read_member(archive, info, budget)) + except zipsafe.ArchiveTooLarge: + raise + except ValueError: + continue + if looks_lottie(data): + inlined = _inline_images(archive, data, budget) + return inlined, manifest if isinstance(manifest, dict) else {} + except zipsafe.ArchiveTooLarge: + return None, {} + return None, {} + + +def _inline_images(archive: zipfile.ZipFile, data: Dict[str, Any], budget: Any) -> Optional[Dict[str, Any]]: + import base64 + import posixpath + + from . import zipsafe + + names = {i.filename: i for i in archive.infolist()} + raw_assets = data.get("assets") or [] + if len(raw_assets) > MAX_ASSETS: + return None + encoded: Dict[str, str] = {} + inlined = 0 + assets = [] + for asset in raw_assets: + if isinstance(asset, dict) and asset.get("p") and not str(asset["p"]).startswith("data:"): + member = posixpath.normpath(posixpath.join(str(asset.get("u") or "images/").lstrip("/"), str(asset["p"]))) + info = names.get(member) or names.get(f"images/{posixpath.basename(str(asset['p']))}") + if info is not None: + if info.filename not in encoded: + if inlined + info.file_size > MAX_INLINE: + return None + try: + body = zipsafe.read_member(archive, info, budget) + except zipsafe.ArchiveTooLarge: + return None + inlined += len(body) + if inlined > MAX_INLINE: + return None + kind = "png" if info.filename.lower().endswith(".png") else "jpeg" + encoded[info.filename] = f"data:image/{kind};base64,{base64.b64encode(body).decode('ascii')}" + asset = {**asset, "u": "", "p": encoded[info.filename], "e": 1} + assets.append(asset) + return {**data, "assets": assets} + + +def load_bytes(raw: bytes) -> Tuple[Optional[Dict[str, Any]], Dict[str, Any]]: + import io + + if raw[:2] == b"PK": + try: + return _from_zip(io.BytesIO(raw)) + except zipfile.BadZipFile: + return None, {} + try: + data = json.loads(raw[:MAX_JSON]) + except ValueError: + return None, {} + return (data, {}) if looks_lottie(data) else (None, {}) + + +def load_path(path: str) -> Tuple[Optional[Dict[str, Any]], Dict[str, Any]]: + try: + with open(path, "rb") as handle: + return load_bytes(handle.read(MAX_JSON + 1)) + except OSError: + return None, {} + + +def sanitise(data: Dict[str, Any]) -> Dict[str, Any]: + assets = [] + for asset in data.get("assets") or []: + if not isinstance(asset, dict): + continue + if "p" in asset and not str(asset.get("p", "")).startswith("data:"): + assets.append({k: v for k, v in asset.items() if k not in ("p", "u")} | {"p": "", "u": "", "e": 1}) + else: + assets.append({k: v for k, v in asset.items() if k != "u"} | ({"u": ""} if "p" in asset else {})) + return {**data, "assets": assets} + + +def facts(data: Dict[str, Any]) -> Dict[str, Any]: + rate = float(data.get("fr") or 0) + frames = max(0.0, float(data.get("op") or 0) - float(data.get("ip") or 0)) + return {"version": str(data.get("v", ""))[:20], "width": int(data.get("w") or 0), "height": int(data.get("h") or 0), + "rate": round(rate, 3), "frames": int(frames), "duration": round(frames / rate, 3) if rate else None, + "layers": len(data.get("layers") or []), "assets": len(data.get("assets") or []), + "name": str(data.get("nm") or "")[:200]} + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + data, manifest = load_path(path) + if data is None: + return Extract(meta={"error": "No Lottie animation in this file"}) + meta = {**facts(data), "container": "dotLottie" if path.lower().endswith(".lottie") else "JSON"} + if manifest.get("generator"): + meta["generator"] = str(manifest["generator"])[:100] + lines = [f"{meta['width']} x {meta['height']}", f"{meta['frames']} frames at {meta['rate']} fps"] + return Extract(meta=meta, title=meta["name"] or None, width=meta["width"] or None, height=meta["height"] or None, + duration=meta["duration"], pages=meta["frames"], + preview=cards.kind_card("Lottie", [meta["name"] or row.get("name", ""), *lines], "lottie")) diff --git a/backend/app/services/lutres.py b/backend/app/services/lutres.py new file mode 100644 index 0000000..147714a --- /dev/null +++ b/backend/app/services/lutres.py @@ -0,0 +1,127 @@ +from typing import Any, Dict, List, Optional, Tuple + +import numpy as np +from PIL import Image, ImageDraw + +from . import cards +from .assetkinds import Extract + +MAX_SIZE = 129 +TEST_W, TEST_H = 512, 288 + + +class LutError(ValueError): + pass + + +def parse_cube(text: str) -> Tuple[np.ndarray, Dict[str, Any]]: + size, dims, title = 0, 3, "" + lo, hi = np.zeros(3), np.ones(3) + rows: List[List[float]] = [] + for raw in text.splitlines(): + line = raw.split("#", 1)[0].strip() + if not line: + continue + head = line.split()[0].upper() + if head == "TITLE": + title = line[5:].strip().strip('"') + elif head in ("LUT_3D_SIZE", "LUT_1D_SIZE"): + size, dims = int(line.split()[1]), 3 if head == "LUT_3D_SIZE" else 1 + elif head == "DOMAIN_MIN": + lo = np.array([float(v) for v in line.split()[1:4]]) + elif head == "DOMAIN_MAX": + hi = np.array([float(v) for v in line.split()[1:4]]) + elif head[0].isdigit() or head[0] in "-.": + rows.append([float(v) for v in line.split()[:3]]) + if not size or size > (MAX_SIZE if dims == 3 else 65536): + raise LutError("No LUT size in this file") + want = size ** 3 if dims == 3 else size + if len(rows) != want: + raise LutError(f"Expected {want} entries, found {len(rows)}") + table = np.array(rows, dtype=np.float32) + table = (table - lo) / np.where(hi - lo == 0, 1, hi - lo) + if dims == 3: + table = table.reshape(size, size, size, 3) + return table, {"title": title, "type": f"{dims}D", "size": size, "format": "Cube"} + + +def parse_3dl(text: str) -> Tuple[np.ndarray, Dict[str, Any]]: + lines = [ln.split("#", 1)[0].split() for ln in text.splitlines()] + lines = [ln for ln in lines if ln and all(p.lstrip("-").isdigit() for p in ln)] + if lines and len(lines[0]) != 3: + lines = lines[1:] + size = round(len(lines) ** (1 / 3)) + if size < 2 or size ** 3 != len(lines) or size > MAX_SIZE: + raise LutError("This 3DL file does not hold a cube of entries") + data = np.array([[int(v) for v in ln[:3]] for ln in lines], dtype=np.float32) + top = float(data.max()) or 1.0 + depth = next((bits for bits in (8, 10, 12, 14, 16) if top <= 2 ** bits - 1), 16) + table = (data / (2 ** depth - 1)).reshape(size, size, size, 3).transpose(2, 1, 0, 3) + return table, {"type": "3D", "size": size, "format": f"3DL ({depth}-bit)"} + + +def apply(table: np.ndarray, rgb: np.ndarray) -> np.ndarray: + values = np.clip(rgb.astype(np.float32), 0, 1) + if table.ndim == 2: + idx = values * (len(table) - 1) + out = np.empty_like(values) + for c in range(3): + out[..., c] = np.interp(idx[..., c], np.arange(len(table)), table[:, c]) + return np.clip(out, 0, 1) + size = table.shape[0] + scaled = values * (size - 1) + base = np.clip(np.floor(scaled).astype(int), 0, size - 2) + frac = scaled - base + r0, g0, b0 = base[..., 0], base[..., 1], base[..., 2] + fr, fg, fb = (frac[..., i:i + 1] for i in range(3)) + out = np.zeros_like(values) + for dr in (0, 1): + for dg in (0, 1): + for db in (0, 1): + weight = (fr if dr else 1 - fr) * (fg if dg else 1 - fg) * (fb if db else 1 - fb) + out += weight * table[b0 + db, g0 + dg, r0 + dr] + return np.clip(out, 0, 1) + + +def sample_image() -> np.ndarray: + x = np.linspace(0, 1, TEST_W, dtype=np.float32) + hue = np.stack([np.clip(np.abs(x * 6 - 3) - 1, 0, 1), np.clip(2 - np.abs(x * 6 - 2), 0, 1), + np.clip(2 - np.abs(x * 6 - 4), 0, 1)], axis=-1) + rows = [] + for y in range(TEST_H): + band = y / TEST_H + if band < 0.4: + rows.append(hue * (0.35 + band * 1.6)) + elif band < 0.7: + rows.append(np.repeat(x[:, None], 3, axis=1)) + else: + patches = np.array([[0.87, 0.67, 0.55], [0.55, 0.38, 0.28], [0.35, 0.55, 0.25], [0.25, 0.4, 0.65]], dtype=np.float32) + rows.append(patches[np.minimum((x * 4).astype(int), 3)]) + return np.stack(rows) + + +def before_after(table: np.ndarray) -> Image.Image: + before = sample_image() + after = apply(table, before) + pair = np.concatenate([before, np.ones((TEST_H, 8, 3), dtype=np.float32) * 0.1, after], axis=1) + img = Image.fromarray((pair * 255 + 0.5).astype(np.uint8), "RGB") + draw = ImageDraw.Draw(img) + face = cards.font(16) + draw.text((10, TEST_H - 26), "Before", font=face, fill=(255, 255, 255)) + draw.text((TEST_W + 18, TEST_H - 26), "After", font=face, fill=(255, 255, 255)) + return img + + +def load(path: str) -> Tuple[np.ndarray, Dict[str, Any]]: + with open(path, "r", encoding="utf-8", errors="replace") as handle: + text = handle.read(64 * 1024 * 1024) + return parse_3dl(text) if path.lower().endswith(".3dl") else parse_cube(text) + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + try: + table, meta = load(path) + except (LutError, ValueError, OSError) as exc: + return Extract(meta={"error": str(exc) or "This LUT could not be read"}) + preview: Optional[Image.Image] = before_after(table) + return Extract(meta=meta, title=meta.get("title") or None, preview=preview) diff --git a/backend/app/services/paletteres.py b/backend/app/services/paletteres.py new file mode 100644 index 0000000..8e598c3 --- /dev/null +++ b/backend/app/services/paletteres.py @@ -0,0 +1,86 @@ +import struct +from typing import Any, Dict, List, Tuple + +from . import cards +from .assetkinds import Extract + +MAX_COLOURS = 4096 +SHOWN = 256 + + +class PaletteError(ValueError): + pass + + +def _lab_to_rgb(l: float, a: float, b: float) -> Tuple[int, int, int]: + y = (l + 16) / 116 + x, z = y + a / 500, y - b / 200 + + def inv(t: float) -> float: + return t ** 3 if t ** 3 > 0.008856 else (t - 16 / 116) / 7.787 + + X, Y, Z = 0.95047 * inv(x), inv(y), 1.08883 * inv(z) + lin = (3.2406 * X - 1.5372 * Y - 0.4986 * Z, -0.9689 * X + 1.8758 * Y + 0.0415 * Z, 0.0557 * X - 0.2040 * Y + 1.0570 * Z) + + def enc(c: float) -> int: + c = max(0.0, min(1.0, c)) + v = 12.92 * c if c <= 0.0031308 else 1.055 * c ** (1 / 2.4) - 0.055 + return int(round(v * 255)) + + return enc(lin[0]), enc(lin[1]), enc(lin[2]) + + +def to_rgb(model: str, values: List[float]) -> Tuple[int, int, int]: + if model == "RGB": + return tuple(int(round(max(0.0, min(1.0, v)) * 255)) for v in values[:3]) # type: ignore[return-value] + if model == "CMYK": + c, m, y, k = values[:4] + return tuple(int(round(255 * (1 - min(1.0, v)) * (1 - min(1.0, k)))) for v in (c, m, y)) # type: ignore[return-value] + if model == "LAB": + return _lab_to_rgb(values[0] * 100, values[1], values[2]) + grey = int(round(max(0.0, min(1.0, values[0])) * 255)) + return grey, grey, grey + + +def parse_ase(data: bytes) -> Tuple[List[Dict[str, Any]], int]: + if data[:4] != b"ASEF" or len(data) < 12: + raise PaletteError("Not an ASE palette") + count = struct.unpack_from(">I", data, 8)[0] + pos, colours, groups = 12, [], 0 + for _ in range(min(count, MAX_COLOURS * 2)): + if pos + 6 > len(data): + break + kind, length = struct.unpack_from(">HI", data, pos) + body = data[pos + 6:pos + 6 + length] + pos += 6 + length + if kind == 0xC001: + groups += 1 + if kind != 0x0001 or len(body) < 2: + continue + chars = struct.unpack_from(">H", body, 0)[0] + name = body[2:2 + chars * 2].decode("utf-16-be", "replace").rstrip("\x00") + at = 2 + chars * 2 + model = body[at:at + 4].decode("ascii", "replace").strip().upper() + width = {"RGB": 3, "CMYK": 4, "LAB": 3, "GRAY": 1}.get(model) + if width is None or len(body) < at + 4 + width * 4: + continue + values = list(struct.unpack_from(f">{width}f", body, at + 4)) + rgb = to_rgb(model, values) + colours.append({"name": name[:80], "model": model, "hex": "#%02x%02x%02x" % rgb}) + if len(colours) >= MAX_COLOURS: + break + return colours, groups + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + with open(path, "rb") as handle: + data = handle.read(32 * 1024 * 1024) + try: + colours, groups = parse_ase(data) + except PaletteError as exc: + return Extract(meta={"error": str(exc)}) + rgb = [tuple(int(c["hex"][i:i + 2], 16) for i in (1, 3, 5)) for c in colours] + meta = {"format": "ASE", "colours": len(colours), "groups": groups, + "models": sorted({c["model"] for c in colours}), "swatches": colours[:SHOWN]} + return Extract(meta=meta, pages=len(colours), text=" ".join(c["name"] for c in colours if c["name"]), + preview=cards.swatches(rgb) if rgb else None) diff --git a/backend/app/services/query.py b/backend/app/services/query.py index bb4fede..ac18877 100644 --- a/backend/app/services/query.py +++ b/backend/app/services/query.py @@ -32,6 +32,9 @@ "favorite": "m.favorite=1", "photo": "m.kind='image'", "video": "m.kind='video'", "audio": "m.kind='audio'", "project": "m.kind='project'", "has_preview": "m.preview_state=1", "sequence": "m.kind='sequence'", "camera_raw_video": "m.subkind='camera_raw'", + "resource": "m.kind='resource'", "font": "(m.kind='resource' AND m.subkind='font')", + "lut": "(m.kind='resource' AND m.subkind='lut')", "caption": "(m.kind='resource' AND m.subkind='caption')", + "palette": "(m.kind='resource' AND m.subkind='palette')", "lottie": "(m.kind='resource' AND m.subkind='lottie')", "cover_art": "m.has_cover=1", "lossless": "(m.audio_codec IN ('flac','alac','wavpack','ape','tta') OR m.audio_codec LIKE 'pcm%')", "screenshot": "m.is_screenshot=1", "screen_recording": "m.is_screen_rec=1", "raw": "m.is_raw=1", "live": "m.live_video_id IS NOT NULL", "panorama": "m.is_panorama=1", "selfie": "m.is_selfie=1", diff --git a/backend/requirements.txt b/backend/requirements.txt index c10f83f..1c003c1 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -11,3 +11,5 @@ cryptography==50.0.1 python-multipart pyzipper==0.4.0 resvg_py==0.5.0 +fonttools==4.69.1 +brotli==1.2.1 diff --git a/backend/requirements_macos.txt b/backend/requirements_macos.txt index 97e846b..ef482ef 100644 --- a/backend/requirements_macos.txt +++ b/backend/requirements_macos.txt @@ -14,3 +14,5 @@ pyobjc-framework-Quartz cryptography==50.0.1 pyzipper==0.4.0 resvg_py==0.5.0 +fonttools==4.69.1 +brotli==1.2.1 diff --git a/backend/tests/test_design_resources.py b/backend/tests/test_design_resources.py new file mode 100644 index 0000000..2d70063 --- /dev/null +++ b/backend/tests/test_design_resources.py @@ -0,0 +1,216 @@ +import io +import json +import os +import struct +import zipfile + +import numpy as np +import pytest +from PIL import Image + +from tests.conftest import HEADERS, import_dir + + +def make_font(path, family="Test Sans", style="Bold", flavor=None): + from fontTools.fontBuilder import FontBuilder + from fontTools.pens.ttGlyphPen import TTGlyphPen + from fontTools.ttLib import TTFont + + def box(): + pen = TTGlyphPen(None) + pen.moveTo((100, 0)) + pen.lineTo((100, 700)) + pen.lineTo((500, 700)) + pen.lineTo((500, 0)) + pen.closePath() + return pen.glyph() + + names = [".notdef", "A", "a", "space"] + fb = FontBuilder(1000, isTTF=True) + fb.setupGlyphOrder(names) + fb.setupCharacterMap({65: "A", 97: "a", 32: "space"}) + fb.setupGlyf({n: box() for n in names}) + fb.setupHorizontalMetrics({n: (600, 100) for n in names}) + fb.setupHorizontalHeader(ascent=800, descent=-200) + fb.setupNameTable({"familyName": family, "styleName": style, "designer": "A Tester"}) + fb.setupOS2() + fb.setupPost() + fb.save(str(path)) + if flavor: + font = TTFont(str(path)) + font.flavor = flavor + font.save(str(path)) + return path + + +def cube_text(size=2, invert=False): + rows = [f"LUT_3D_SIZE {size}", 'TITLE "Flip"'] + for b in range(size): + for g in range(size): + for r in range(size): + vals = [r / (size - 1), g / (size - 1), b / (size - 1)] + rows.append(" ".join(f"{1 - v if invert else v:.4f}" for v in vals)) + return "\n".join(rows) + "\n" + + +def ase_bytes(colours): + blocks = b"" + for name, model, values in colours: + encoded = (name + "\x00").encode("utf-16-be") + body = struct.pack(">H", len(name) + 1) + encoded + model.encode() + struct.pack(f">{len(values)}f", *values) + struct.pack(">H", 2) + blocks += struct.pack(">HI", 1, len(body)) + body + return b"ASEF" + struct.pack(">HHI", 1, 0, len(colours)) + blocks + + +def lottie_doc(**extra): + return {"v": "5.7.4", "fr": 30, "ip": 0, "op": 60, "w": 320, "h": 180, "nm": "Bounce", "layers": [{"ty": 4}], **extra} + + +def resources(client): + return {i["name"]: i for i in client.get("/api/media", params={"filter": "resources", "limit": 1000}).json()["items"]} + + +def imported(client, tmp_path, files): + from app.services import assetwork + + src = tmp_path / "src" + os.makedirs(src, exist_ok=True) + for name, writer in files.items(): + writer(src / name) + import_dir(client, src) + assetwork.drain() + return resources(client) + + +def test_fonts_in_every_flavour(client, tmp_path): + found = imported(client, tmp_path, {"a.ttf": make_font, "b.woff": lambda p: make_font(p, flavor="woff"), + "c.woff2": lambda p: make_font(p, family="Wide", flavor="woff2"), + "d.otf": lambda p: make_font(p, family="Other")}) + assert set(found) == {"a.ttf", "b.woff", "c.woff2", "d.otf"} + a = found["a.ttf"] + assert a["subkind"] == "font" and a["asset"]["family"] == "Test Sans" and a["asset"]["style"] == "Bold" + assert a["asset"]["glyphs"] == 4 and a["asset"]["designer"] == "A Tester" and a["title"] == "Test Sans Bold" + assert found["c.woff2"]["asset"]["format"] == "WOFF2" and found["c.woff2"]["preview_state"] == 1 + spec = {"rules": [{"field": "flag", "value": "font"}, {"field": "title", "op": "contains", "value": "Wide"}]} + assert [m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == ["c.woff2"] + assert client.get("/api/summary").json()["resources"] == 4 + + +def test_lut_parsing_and_before_after(client, tmp_path): + from app.services import lutres + + table, meta = lutres.parse_cube(cube_text(3, invert=True)) + out = lutres.apply(table, np.array([[[0.2, 0.5, 0.9]]], dtype=np.float32)) + assert np.allclose(out[0, 0], [0.8, 0.5, 0.1], atol=1e-3) and meta["size"] == 3 + lines = ["0 1023"] + [f"{1023 - r * 1023} {g * 1023} {b * 1023}" for r in range(2) for g in range(2) for b in range(2)] + table3, meta3 = lutres.parse_3dl("\n".join(lines)) + out3 = lutres.apply(table3, np.array([[[0.0, 0.0, 0.0]]], dtype=np.float32)) + assert np.allclose(out3[0, 0], [1.0, 0.0, 0.0], atol=1e-3) and meta3["format"] == "3DL (10-bit)" + found = imported(client, tmp_path, {"flip.cube": lambda p: p.write_text(cube_text(2, invert=True)), + "bad.cube": lambda p: p.write_text("LUT_3D_SIZE 4\n0 0 0\n")}) + flip = found["flip.cube"] + assert flip["asset"]["type"] == "3D" and flip["title"] == "Flip" and flip["preview_state"] == 1 + thumb = client.get(f"/api/media/{flip['id']}/thumb", params={"s": 768}).content + with Image.open(io.BytesIO(thumb)) as img: + left = img.convert("RGB").getpixel((img.width // 8, int(img.height * 0.55))) + right = img.convert("RGB").getpixel((img.width // 2 + img.width // 8, int(img.height * 0.55))) + assert left[0] < 100 and right[0] > 150 + assert "Expected" in found["bad.cube"]["asset"]["error"] and found["bad.cube"]["preview_state"] == 2 + + +def test_captions_are_searchable_with_cues(client, tmp_path): + srt = "1\n00:00:01,000 --> 00:00:02,500\nHello harbour\n\n2\n00:01:03,000 --> 00:01:05,000\nGulls at dawn\n" + vtt = "WEBVTT\nLanguage: fr\n\nNOTE skip me\n\nintro\n00:00.500 --> 00:02.000 align:start\nBonjour\n" + found = imported(client, tmp_path, {"talk.en.srt": lambda p: p.write_text(srt), "clip.vtt": lambda p: p.write_text(vtt)}) + talk, clip = found["talk.en.srt"], found["clip.vtt"] + assert talk["asset"]["cues"] == 2 and talk["asset"]["language"] == "en" and talk["duration"] == 65.0 + assert clip["asset"]["format"] == "WebVTT" and clip["asset"]["language"] == "fr" and clip["asset"]["cues"] == 1 + spec = {"rules": [{"field": "text", "op": "contains", "value": "gulls"}]} + assert [m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] == ["talk.en.srt"] + cues = client.get(f"/api/media/{talk['id']}/cues").json()["cues"] + assert cues[0] == {"start": 1.0, "end": 2.5, "text": "Hello harbour"} + + +def test_palette_swatches(client, tmp_path): + colours = [("Signal", "RGB ", [1.0, 0.0, 0.0]), ("Ink", "CMYK", [0.0, 0.0, 0.0, 1.0]), ("Paper", "Gray", [1.0]), + ("Mid", "LAB ", [0.5, 0.0, 0.0])] + found = imported(client, tmp_path, {"brand.ase": lambda p: p.write_bytes(ase_bytes(colours))}) + pal = found["brand.ase"] + hexes = [s["hex"] for s in pal["asset"]["swatches"]] + assert hexes[:3] == ["#ff0000", "#000000", "#ffffff"] and pal["asset"]["colours"] == 4 + grey = int(hexes[3][1:3], 16) + assert 110 < grey < 125 and hexes[3][1:3] == hexes[3][3:5] + + +def test_lottie_json_dotlottie_and_plain_json(client, tmp_path): + def dotlottie(path): + png = io.BytesIO() + Image.new("RGB", (4, 4), (0, 255, 0)).save(png, "PNG") + doc = lottie_doc(assets=[{"id": "img", "w": 4, "h": 4, "u": "/images/", "p": "a.png"}]) + with zipfile.ZipFile(path, "w") as archive: + archive.writestr("manifest.json", json.dumps({"generator": "test", "animations": [{"id": "x"}]})) + archive.writestr("animations/x.json", json.dumps(doc)) + archive.writestr("images/a.png", png.getvalue()) + + found = imported(client, tmp_path, { + "bounce.json": lambda p: p.write_text(json.dumps(lottie_doc(assets=[{"id": "r", "u": "https://example.invalid/", "p": "x.png"}]))), + "settings.json": lambda p: p.write_text(json.dumps({"layers": "no", "theme": "dark"})), + "pack.lottie": dotlottie, + }) + assert set(found) == {"bounce.json", "pack.lottie"} + bounce = found["bounce.json"] + assert bounce["subkind"] == "lottie" and bounce["asset"]["frames"] == 60 and bounce["duration"] == 2.0 + served = client.get(f"/api/media/{bounce['id']}/lottie").json() + assert served["assets"][0]["u"] == "" and served["assets"][0]["p"] == "" + pack = client.get(f"/api/media/{found['pack.lottie']['id']}/lottie").json() + assert pack["assets"][0]["p"].startswith("data:image/png;base64,") + assert found["pack.lottie"]["asset"]["container"] == "dotLottie" + + +def test_resources_take_ratings_albums_and_the_vault(client, tmp_path): + from app.services import assetstore + + found = imported(client, tmp_path, {"a.ttf": make_font}) + media_id = found["a.ttf"]["id"] + assert client.patch(f"/api/media/{media_id}/meta", json={"rating": 3}, headers=HEADERS).status_code == 200 + album = client.post("/api/albums", json={"name": "Type"}, headers=HEADERS).json()["id"] + assert client.post(f"/api/albums/{album}/items", json={"media_ids": [media_id]}, headers=HEADERS).json()["added"] == 1 + assert os.path.isfile(assetstore.preview_path(media_id)) + token = client.post("/api/vault/setup", json={"passkey": "vaultkey9"}, headers=HEADERS).json()["token"] + assert client.post(f"/api/media/{media_id}/hide", headers=HEADERS).status_code == 200 + assert not os.path.exists(assetstore.preview_path(media_id)) + res = client.get(f"/api/media/{media_id}/thumb", headers={**HEADERS, "x-dam-vault": token}) + assert res.status_code == 200 and res.headers["cache-control"] == "no-store" + + +def test_lottie_inlining_is_capped(monkeypatch): + from app.services import lottieres + + png = io.BytesIO() + Image.new("RGB", (4, 4)).save(png, "PNG") + + def pack(doc): + out = io.BytesIO() + with zipfile.ZipFile(out, "w") as archive: + archive.writestr("animations/x.json", json.dumps(doc)) + archive.writestr("images/a.png", png.getvalue()) + return out.getvalue() + + shared = [{"id": f"i{n}", "u": "/images/", "p": "a.png"} for n in range(3)] + data, _ = lottieres.load_bytes(pack(lottie_doc(assets=shared))) + assert len({a["p"] for a in data["assets"]}) == 1 and data["assets"][0]["p"].startswith("data:") + many = [{"id": f"i{n}"} for n in range(lottieres.MAX_ASSETS + 1)] + assert lottieres.load_bytes(pack(lottie_doc(assets=many)))[0] is None + monkeypatch.setattr(lottieres, "MAX_INLINE", 10) + assert lottieres.load_bytes(pack(lottie_doc(assets=shared)))[0] is None + + +def test_font_names_are_checked_after_decompression(tmp_path): + from app.services import filestrip + + font = make_font(tmp_path / "f.woff2", family="Plain", flavor="woff2").read_bytes() + assert filestrip.clean_member("f.woff2", font) == font + tagged = make_font(tmp_path / "g.woff2", family='x exif:GPSLatitude="1,2N"', flavor="woff2").read_bytes() + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("g.woff2", tagged) + diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 342abd9..75a857a 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### ui/components/assetbodies.ts · resource bodies in the viewer +- refers-to: assetbodies.ts (new) fontBody, paletteBody, captionBody, lottieBody, registerAssetBodies; assetkinds.ts fontFacts, lutFacts, captionFacts, paletteFacts, lottieFacts, sequenceFacts, clockLabel, swatchesOf; main.ts registerAssetBodies; library.ts, sidebar.ts, store.ts, organize.ts, pages.ts Design Resources; viewer.ts playable-copy fallback for video; package.json lottie-web 5.12.2; styles/assets.css +- kind: feat +- logged: after v1.32.4 · 2026-11-29 + +A font opens as a live specimen at 48, 32, 20 and 14 px with an editable line; a palette as a grid of named swatches; captions as the cue list with times; a Lottie animation plays in an SVG renderer. lottie-web is imported only when an animation is opened, from its light build, which has no expression evaluator. A video the window cannot play switches once to the engine's /play copy. + ### engine/assetkinds.ts, ui/components/assetview.ts · file kinds in the window, Form projects first - refers-to: assetkinds.ts (new) FILE_KINDS, isFileKind, kindIcon, kindLabel, countLine, appName, openLabel, projectFacts, assetFacts; assetview.ts (new) createAssetView, assetBody; viewer.ts showAsset; types.ts MediaKind, AssetFacts, the asset fields, summary and filter names; grid.ts kind marks; infopanel.ts asset facts; sidebar.ts Form Projects; library.ts, store.ts, organize.ts (rules app, format, pages), pages.ts; importer.ts drop filter; icons-extra.ts project, cube, swatch, frames, launch; styles/assets.css; tests/assets.test.ts - kind: feat diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ddbe459..8cb3b13 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -7,6 +7,9 @@ "": { "name": "formdam-frontend", "version": "1.32.4", + "dependencies": { + "lottie-web": "5.12.2" + }, "devDependencies": { "jsdom": "^29.1.1", "typescript": "^5.6.3", @@ -1155,6 +1158,12 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/lottie-web": { + "version": "5.12.2", + "resolved": "https://registry.npmjs.org/lottie-web/-/lottie-web-5.12.2.tgz", + "integrity": "sha512-uvhvYPC8kGPjXT3MyKMrL3JitEAmDMp30lVkuq/590Mw9ok6pWcFCwXJveo0t5uqYw1UREQHofD+jVpdjBv8wg==", + "license": "MIT" + }, "node_modules/lru-cache": { "version": "11.5.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", diff --git a/frontend/package.json b/frontend/package.json index 7e43601..e8c9913 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,5 +14,8 @@ "vite": "^8.1.5", "vitest": "^4.1.11", "jsdom": "^29.1.1" + }, + "dependencies": { + "lottie-web": "5.12.2" } } diff --git a/frontend/src/engine/assetkinds.ts b/frontend/src/engine/assetkinds.ts index cc3b7b2..6920141 100644 --- a/frontend/src/engine/assetkinds.ts +++ b/frontend/src/engine/assetkinds.ts @@ -97,9 +97,85 @@ export function sequenceFacts(facts: AssetFacts): FactRow[] { ]; } +export function clockLabel(seconds: number | null): string { + if (seconds === null || seconds < 0) return ""; + const whole = Math.floor(seconds); + const h = Math.floor(whole / 3600); + const m = Math.floor((whole % 3600) / 60); + const s = whole % 60; + return h ? `${h}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}` : `${m}:${String(s).padStart(2, "0")}`; +} + +function list(facts: AssetFacts, key: string): string { + const value = facts[key]; + return Array.isArray(value) ? value.filter((v) => typeof v === "string").join(", ") : ""; +} + +export function fontFacts(facts: AssetFacts): FactRow[] { + const glyphs = num(facts, "glyphs"); + return [ + ["Family", str(facts, "family")], ["Style", str(facts, "style")], ["Format", str(facts, "format")], + ["Outlines", str(facts, "outlines")], ["Glyphs", glyphs !== null ? String(glyphs) : ""], + ["Variable axes", list(facts, "axes")], ["Version", str(facts, "version")], ["Designer", str(facts, "designer")], + ["Licence", str(facts, "licence")], + ]; +} + +export function lutFacts(facts: AssetFacts): FactRow[] { + const size = num(facts, "size"); + return [ + ["Title", str(facts, "title")], ["Format", str(facts, "format")], + ["Grid", size !== null ? (facts.type === "3D" ? `${size} x ${size} x ${size}` : `${size} entries (1D)`) : ""], + ]; +} + +export function captionFacts(facts: AssetFacts): FactRow[] { + const cues = num(facts, "cues"); + const words = num(facts, "words"); + return [ + ["Format", str(facts, "format")], ["Cues", cues !== null ? String(cues) : ""], ["Runs", clockLabel(num(facts, "duration"))], + ["Language", str(facts, "language")], ["Words", words !== null ? String(words) : ""], + ]; +} + +export function paletteFacts(facts: AssetFacts): FactRow[] { + const colours = num(facts, "colours"); + const groups = num(facts, "groups"); + return [ + ["Format", str(facts, "format")], ["Colours", colours !== null ? String(colours) : ""], + ["Groups", groups ? String(groups) : ""], ["Colour models", list(facts, "models")], + ]; +} + +export function lottieFacts(facts: AssetFacts): FactRow[] { + const w = num(facts, "width"); + const h = num(facts, "height"); + const frames = num(facts, "frames"); + const rate = num(facts, "rate"); + return [ + ["Name", str(facts, "name")], ["Container", str(facts, "container")], ["Canvas", w && h ? `${w} x ${h}` : ""], + ["Frames", frames !== null && rate ? `${frames} at ${rate} fps (${clockLabel(num(facts, "duration"))})` : ""], + ["Layers", num(facts, "layers") !== null ? String(num(facts, "layers")) : ""], ["Version", str(facts, "version")], + ]; +} + +export interface Swatch { name: string; hex: string; model: string } + +export function swatchesOf(facts: AssetFacts): Swatch[] { + const raw = facts.swatches; + if (!Array.isArray(raw)) return []; + return raw.filter((s): s is Swatch => !!s && typeof s === "object" && typeof (s as Swatch).hex === "string" + && /^#[0-9a-f]{6}$/i.test((s as Swatch).hex)); +} + const FACTS: Readonly FactRow[]>> = { project: projectFacts, sequence: sequenceFacts, + "resource:font": fontFacts, + "resource:lut": lutFacts, + "resource:caption": captionFacts, + "resource:palette": paletteFacts, + "resource:lottie": lottieFacts, }; export function assetFacts(item: Pick): FactRow[] { diff --git a/frontend/src/engine/store.ts b/frontend/src/engine/store.ts index a058b0b..91987fa 100644 --- a/frontend/src/engine/store.ts +++ b/frontend/src/engine/store.ts @@ -216,6 +216,7 @@ const LEGACY_SPECS: Record = { audio: { rules: [{ field: "flag", value: "audio" }] }, projects: { rules: [{ field: "flag", value: "project" }] }, sequences: { rules: [{ field: "flag", value: "sequence" }] }, + resources: { rules: [{ field: "flag", value: "resource" }] }, screenshots: { rules: [{ field: "flag", value: "screenshot" }] }, screenrecs: { rules: [{ field: "flag", value: "screen_recording" }] }, not_in_album: { rules: [{ field: "flag", value: "not_in_album" }] }, diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 7e876d2..40420b3 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -5,6 +5,7 @@ import { mountPlacesPage, mountTripsPage, registerPlaces } from "./ui/components import { mountPetsPage, mountSubjectsPage, registerDiscover } from "./ui/components/discover.js"; import { registerFind } from "./ui/components/find.js"; import { registerEditor } from "./ui/components/editor.js"; +import { registerAssetBodies } from "./ui/components/assetbodies.js"; import { registerOutputs } from "./ui/components/outputs.js"; import { mountMemoriesPage, mountMemoryPage, registerCurate } from "./ui/components/curate.js"; import { mountSharedPage, registerSharing } from "./ui/components/sharing.js"; @@ -129,6 +130,7 @@ registerPlaces(); registerDiscover(); registerFind(); registerEditor(); +registerAssetBodies(); registerOutputs(); registerCurate(); registerSharing(); diff --git a/frontend/src/styles/assets.css b/frontend/src/styles/assets.css index b626f4d..60b7b79 100644 --- a/frontend/src/styles/assets.css +++ b/frontend/src/styles/assets.css @@ -16,3 +16,19 @@ @media (max-width: 560px) { .asset-facts { grid-template-columns: 1fr; } } +.asset-input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--glass-border, transparent); background: var(--glass-bg-2); color: var(--text); font: inherit; } +.asset-font { display: flex; flex-direction: column; gap: var(--space-2); overflow: hidden; } +.font-line { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; } +.asset-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-2); max-height: 50vh; overflow: auto; } +.swatch { display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 0; } +.swatch-chip { height: 56px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25); } +.swatch-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.swatch-hex { color: var(--text-faint); font-variant-numeric: tabular-nums; } +.asset-cues { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; font-size: 13px; } +.cue { display: grid; grid-template-columns: 9em 1fr; gap: var(--space-2); } +.cue-at { color: var(--text-faint); font-variant-numeric: tabular-nums; } +.cue-text { color: var(--text); white-space: pre-wrap; } +.asset-lottie { width: 100%; height: 56vh; border-radius: 10px; background: var(--glass-bg-2); } +@media (max-width: 560px) { + .cue { grid-template-columns: 1fr; } +} diff --git a/frontend/src/ui/components/assetbodies.ts b/frontend/src/ui/components/assetbodies.ts new file mode 100644 index 0000000..6085c76 --- /dev/null +++ b/frontend/src/ui/components/assetbodies.ts @@ -0,0 +1,62 @@ +import { api, fileUrl, thumbUrl } from "../../engine/api.js"; +import { clockLabel, swatchesOf } from "../../engine/assetkinds.js"; +import type { Media } from "../../engine/types.js"; +import { h } from "../dom.js"; +import { assetBody } from "./assetview.js"; + +const SAMPLE = "The quick brown fox jumps over the lazy dog"; + +function fontBody(item: Media, signal: AbortSignal): HTMLElement { + const family = `dam-font-${item.id}`; + const input = h("input", { class: "asset-input", type: "text", value: SAMPLE, "aria-label": "Sample text" }) as HTMLInputElement; + const sizes = [48, 32, 20, 14]; + const lines = sizes.map((px) => h("div", { class: "font-line", style: `font-family: "${family}"; font-size: ${px}px` }, SAMPLE)); + const box = h("div", { class: "asset-font" }, input, ...lines); + input.addEventListener("input", () => lines.forEach((line) => { line.textContent = input.value || SAMPLE; }), { signal }); + const face = new FontFace(family, `url(${fileUrl(item.id)})`); + face.load().then((loaded) => { + if (!signal.aborted) document.fonts.add(loaded); + }).catch(() => box.replaceChildren(h("img", { class: "asset-preview", alt: item.name, src: thumbUrl(item.id, 768) }))); + signal.addEventListener("abort", () => document.fonts.delete(face)); + return box; +} + +function paletteBody(item: Media): HTMLElement { + const cells = swatchesOf(item.asset ?? {}).map((s) => + h("div", { class: "swatch", title: `${s.name} ${s.hex}` }, + h("span", { class: "swatch-chip", style: `background: ${s.hex}` }), + h("span", { class: "swatch-name" }, s.name || s.hex), + h("span", { class: "swatch-hex" }, s.hex.toUpperCase()))); + return h("div", { class: "asset-swatches" }, ...cells); +} + +function captionBody(item: Media, signal: AbortSignal): HTMLElement { + const listBox = h("div", { class: "asset-cues" }, h("div", { class: "asset-sub" }, "Loading cues...")); + void api<{ cues: Array<{ start: number; end: number; text: string }> }>(`/media/${item.id}/cues`).then((body) => { + if (signal.aborted) return; + listBox.replaceChildren(...body.cues.slice(0, 2000).map((cue) => + h("div", { class: "cue" }, h("span", { class: "cue-at" }, `${clockLabel(cue.start)} to ${clockLabel(cue.end)}`), + h("span", { class: "cue-text" }, cue.text)))); + }).catch(() => listBox.replaceChildren(h("div", { class: "asset-sub" }, "The cues could not be read"))); + return listBox; +} + +function lottieBody(item: Media, signal: AbortSignal): HTMLElement { + const stage = h("div", { class: "asset-lottie" }); + void Promise.all([ + import("lottie-web/build/player/lottie_light"), + api>(`/media/${item.id}/lottie`), + ]).then(([mod, data]) => { + if (signal.aborted) return; + const anim = mod.default.loadAnimation({ container: stage, renderer: "svg", loop: true, autoplay: true, animationData: data }); + signal.addEventListener("abort", () => anim.destroy()); + }).catch(() => stage.replaceChildren(h("img", { class: "asset-preview", alt: item.name, src: thumbUrl(item.id, 768) }))); + return stage; +} + +export function registerAssetBodies(): void { + assetBody("resource:font", fontBody); + assetBody("resource:palette", paletteBody); + assetBody("resource:caption", captionBody); + assetBody("resource:lottie", lottieBody); +} diff --git a/frontend/src/ui/components/library.ts b/frontend/src/ui/components/library.ts index ae20b8e..022be06 100644 --- a/frontend/src/ui/components/library.ts +++ b/frontend/src/ui/components/library.ts @@ -17,6 +17,7 @@ const FILTER_LABELS: Record = { audio: "Audio", projects: "Form Projects", sequences: "Image Sequences", + resources: "Design Resources", screenshots: "Screenshots", screenrecs: "Screen Recordings", not_in_album: "Not in an Album", @@ -73,9 +74,9 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo const filterBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Filter" }, iconEl("sliders")); const menu = h("div", { class: "menu pop-surface hidden" }); const menuAnchor = h("div", { class: "menu-anchor" }, filterBtn, menu); - const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "sequences", "screenshots", "not_in_album"]; + const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "sequences", "resources", "screenshots", "not_in_album"]; const FILTER_ICONS: Partial> = { - all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", sequences: "frames", + all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", sequences: "frames", resources: "swatch", screenshots: "screenshot", not_in_album: "albumOff", }; for (const key of filterKeys) { @@ -153,6 +154,7 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo audio: state.summary.audio, projects: state.summary.projects ?? 0, sequences: state.summary.sequences ?? 0, + resources: state.summary.resources ?? 0, screenshots: state.summary.screenshots, screenrecs: state.summary.screenrecs, recently_viewed: state.summary.recently_viewed, diff --git a/frontend/src/ui/components/organize.ts b/frontend/src/ui/components/organize.ts index cb2ed62..cd14360 100644 --- a/frontend/src/ui/components/organize.ts +++ b/frontend/src/ui/components/organize.ts @@ -339,7 +339,8 @@ const RULE_FIELDS: Array<[string, string]> = [ ["app", "Form app"], ["format", "File format"], ["pages", "Pages or frames"], ]; const FLAG_VALUES: Array<[string, string]> = [ - ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["sequence", "Image sequence"], ["camera_raw_video", "Camera raw video"], ["raw", "RAW"], ["live", "Live Photo"], + ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["sequence", "Image sequence"], ["camera_raw_video", "Camera raw video"], ["resource", "Design resource"], ["font", "Font"], ["lut", "Colour LUT"], + ["caption", "Captions"], ["palette", "Palette"], ["lottie", "Lottie animation"], ["raw", "RAW"], ["live", "Live Photo"], ["panorama", "Panorama"], ["selfie", "Selfie"], ["portrait", "Portrait"], ["slomo", "Slo-mo"], ["burst", "Burst"], ["screenshot", "Screenshot"], ["screen_recording", "Screen Recording"], ["edited", "Edited"], ["rejected", "Rejected"], ["located", "Has location"], ["not_located", "No location"], ["not_in_album", "Not in an album"], diff --git a/frontend/src/ui/components/pages.ts b/frontend/src/ui/components/pages.ts index 5aeec15..675cd28 100644 --- a/frontend/src/ui/components/pages.ts +++ b/frontend/src/ui/components/pages.ts @@ -72,7 +72,7 @@ interface MediaType { } const TYPE_ICONS: Record = { - video: "video", audio: "audio", project: "project", sequence: "frames", camera_raw_video: "video", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", + video: "video", audio: "audio", project: "project", sequence: "frames", camera_raw_video: "video", font: "swatch", lut: "swatch", caption: "swatch", palette: "swatch", lottie: "swatch", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", burst: "stack", raw: "file", screenshot: "screenshot", screen_recording: "stage", timelapse: "clock", cinematic: "video", spatial: "cube", long_exposure: "wave", animated: "play", }; diff --git a/frontend/src/ui/components/sidebar.ts b/frontend/src/ui/components/sidebar.ts index b0330d2..4ef2820 100644 --- a/frontend/src/ui/components/sidebar.ts +++ b/frontend/src/ui/components/sidebar.ts @@ -21,6 +21,7 @@ const PINNED: RowSpec[] = [ { label: "Videos", icon: "video", hash: "#/f/videos" }, { label: "Audio", icon: "audio", hash: "#/f/audio" }, { label: "Form Projects", icon: "project", hash: "#/f/projects" }, + { label: "Design Resources", icon: "swatch", hash: "#/f/resources" }, { label: "Screenshots", icon: "screenshot", hash: "#/f/screenshots" }, { label: "People", icon: "people", hash: "#/people" }, { label: "Memories", icon: "memory", hash: "#/memories" }, diff --git a/frontend/tests/assets.test.ts b/frontend/tests/assets.test.ts index e990934..0d4ffaa 100644 --- a/frontend/tests/assets.test.ts +++ b/frontend/tests/assets.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { assetFacts, countLine, isFileKind, kindIcon, kindLabel, openLabel } from "../src/engine/assetkinds"; +import { assetFacts, clockLabel, countLine, isFileKind, kindIcon, kindLabel, openLabel, swatchesOf } from "../src/engine/assetkinds"; describe("Form project files", () => { it("names the app to open in, only for projects", () => { @@ -27,3 +27,22 @@ describe("Form project files", () => { expect(kindLabel("project")).toBe("Form project"); }); }); + +describe("design resources and sequences", () => { + it("shows the facts each resource carries", () => { + const font = assetFacts({ kind: "resource", subkind: "font", pages: null, asset: { family: "Test Sans", style: "Bold", glyphs: 4, axes: ["wght"] } }); + expect(font).toEqual([["Family", "Test Sans"], ["Style", "Bold"], ["Glyphs", "4"], ["Variable axes", "wght"]]); + const lut = assetFacts({ kind: "resource", subkind: "lut", pages: null, asset: { type: "3D", size: 33, format: "Cube" } }); + expect(lut).toContainEqual(["Grid", "33 x 33 x 33"]); + const cap = assetFacts({ kind: "resource", subkind: "caption", pages: 2, asset: { cues: 2, duration: 3725, format: "SubRip" } }); + expect(cap).toContainEqual(["Runs", "1:02:05"]); + const seq = assetFacts({ kind: "sequence", subkind: "exr", pages: 4, asset: { first: 1, last: 4, frames: 4, rate: 24, rate_from: "default" } }); + expect(seq).toContainEqual(["Frame rate", "24 fps (assumed; the frames name none)"]); + }); + + it("keeps only well-formed swatches", () => { + expect(swatchesOf({ swatches: [{ name: "Red", hex: "#ff0000", model: "RGB" }, { name: "Bad", hex: "red", model: "RGB" }, 3] })) + .toEqual([{ name: "Red", hex: "#ff0000", model: "RGB" }]); + expect(clockLabel(65)).toBe("1:05"); + }); +}); From 4a7cb62c270f792512897ba20c07714e6a11569b Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:21:25 -0500 Subject: [PATCH 12/35] fix: refuse location-stripped PDFs instead of scanning them 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. --- backend/app/services/filestrip.py | 55 +---------------------------- backend/tests/test_formats_extra.py | 31 ++++++++-------- 2 files changed, 16 insertions(+), 70 deletions(-) diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index 5eae2ed..863a5b4 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -16,8 +16,6 @@ ARCHIVE_MEMBERS = {".zip", ".lottie", ".formpkg"} FONT_MEMBERS = {".ttf", ".otf", ".woff", ".woff2"} NAMED_BINARY = {".ase"} -PDF_STREAM = re.compile(rb"stream\r?\n(.*?)\r?\n?endstream", re.DOTALL) -PDF_STREAM_CAP = 256 * 1024 * 1024 MAX_DEPTH = zipsafe.MAX_DEPTH XMP_GPS_VALUE = re.compile(rb"GPS(?:Dest)?(?:Latitude|Longitude)[\"']?\s*(?:=\s*[\"']\s*[^\"'\s]|>\s*[^<\s]|:\s*[\"']?\s*[^\"'\s,}\]])", re.IGNORECASE) @@ -143,9 +141,7 @@ def clean_member(name: str, data: bytes, depth: int = 0, budget: Optional[zipsaf raise LocationRemains(f"{name} still carries a location") return clean if ext == ".pdf" or data[:5] == b"%PDF-": - if pdf_located(data): - raise LocationRemains(f"location could not be ruled out in {name}") - return data + raise LocationRemains(f"{name}: formDAM cannot remove location data from a PDF, so it leaves only with its location kept") if ext in FONT_MEMBERS: if text_located(_font_tables(data)): raise LocationRemains(f"{name} still carries a location") @@ -183,55 +179,6 @@ def _font_tables(data: bytes) -> bytes: raise LocationRemains("a font's tables could not be read") from exc -PDF_FILTER = re.compile(rb"/Filter\s*(\[[^\]]*\]|/[A-Za-z0-9]+)") -PDF_ENCRYPT = re.compile(rb"/Encrypt\s") - - -def _pdf_filters(head: bytes) -> List[bytes]: - start = head.rfind(b" obj") - found = PDF_FILTER.search(head[start if start >= 0 else 0:]) - if not found: - return [] - return re.findall(rb"/([A-Za-z0-9]+)", found.group(1)) - - -def _inflate(body: bytes, budget: int) -> bytes: - import zlib - - inflater = zlib.decompressobj() - try: - plain = inflater.decompress(body, budget + 1) - except zlib.error as exc: - raise LocationRemains("a PDF stream could not be decoded") from exc - if len(plain) > budget or inflater.unconsumed_tail: - raise LocationRemains("a PDF stream expands past the size limit") - if not inflater.eof: - raise LocationRemains("a PDF stream ends early") - return plain - - -def pdf_located(data: bytes) -> bool: - if PDF_ENCRYPT.search(data): - raise LocationRemains("an encrypted PDF cannot be checked for a location") - if text_located(data): - return True - budget = PDF_STREAM_CAP - for match in PDF_STREAM.finditer(data): - body = match.group(1) - filters = _pdf_filters(data[max(0, match.start() - 4096):match.start()]) - if filters == [b"DCTDecode"]: - if raster_located(body) is not False: - return True - continue - if filters not in ([], [b"FlateDecode"], [b"Fl"]): - raise LocationRemains("a PDF stream uses an encoding formDAM cannot check") - plain = _inflate(body, budget) if filters else body - budget -= len(plain) - if text_located(plain) or (plain[:2] == b"\xff\xd8" and raster_located(plain) is not False): - return True - return False - - def _strip_archive(source: Any, target: Any, depth: int, budget: zipsafe.Budget) -> None: try: with zipfile.ZipFile(source) as archive, zipfile.ZipFile(target, "w", allowZip64=True) as out: diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index 899c465..d1162ce 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -359,26 +359,25 @@ def pdf_bytes(xmp: bytes) -> bytes: + b" >>\nstream\n" + packed + b"\nendstream\nendobj\ntrailer << >>\n%%EOF\n") -def test_pdf_metadata_streams_are_inflated_and_checked(tmp_path): +def test_pdfs_never_leave_with_location_stripped(tmp_path): from app.services import filestrip - clean = pdf_bytes(b'') - assert filestrip.clean_member("plan.pdf", clean) == clean - located = pdf_bytes(b'') - assert b"GPSLatitude" not in located - with pytest.raises(filestrip.LocationRemains): - filestrip.clean_member("plan.pdf", located) - with pytest.raises(filestrip.LocationRemains): - filestrip.strip_file({"kind": "document", "lat": None, "name": "plan.pdf"}, located, str(tmp_path / "p.pdf")) plain = b"%PDF-1.4\n1 0 obj << /Length 5 >>\nstream\nhello\nendstream\nendobj\n%%EOF\n" - assert filestrip.clean_member("a.pdf", plain) == plain - for bad in (plain.replace(b"/Length 5", b"/Filter /LZWDecode /Length 5"), - plain.replace(b"/Length 5", b"/Filter /FlateDecode /Length 5"), - plain.replace(b"/Length 5", b"/Filter [/ASCII85Decode /FlateDecode] /Length 5"), - plain.replace(b"%%EOF", b"trailer << /Encrypt 9 0 R >>\n%%EOF")): + variants = ( + plain, + plain.replace(b"/Length 5", b"/Filter /Flate#44ecode /Length 5"), + plain.replace(b"/Length 5", b"/Filter 2 0 R /Length 5"), + plain.replace(b"%%EOF", b"trailer<>\n%%EOF"), + pdf_bytes(b""), + ) + for data in variants: with pytest.raises(filestrip.LocationRemains): - filestrip.clean_member("a.pdf", bad) - + filestrip.clean_member("a.pdf", data) + with pytest.raises(filestrip.LocationRemains): + filestrip.strip_file({"kind": "document", "lat": None, "name": "a.pdf"}, data, str(tmp_path / "a.pdf")) + assert not os.path.exists(tmp_path / "a.pdf") + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("inside.bin", plain) def test_share_refusal_is_remembered(client, tmp_path, monkeypatch): from app.services import filestrip, gallerysvc From f847e9d80a1370da8aebfa79414c4f0001a60772 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:26:47 -0500 Subject: [PATCH 13/35] feat: documents with page images, facts and full-text search 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. --- LICENSES.md | 1 + README.md | 2 +- backend/HASHOUT_LOG.md | 15 +- backend/app/db.py | 2 + backend/app/routers/assets.py | 38 ++- backend/app/routers/browse.py | 2 +- backend/app/routers/mediaapi.py | 1 + backend/app/routers/system.py | 1 + backend/app/services/assetkinds.py | 3 +- backend/app/services/classify.py | 9 + backend/app/services/docres.py | 337 ++++++++++++++++++++++ backend/app/services/query.py | 2 +- backend/requirements.txt | 1 + backend/requirements_macos.txt | 1 + backend/tests/test_documents.py | 162 +++++++++++ backend/tests/test_idevice.py | 2 +- frontend/src/engine/assetkinds.ts | 15 + frontend/src/engine/store.ts | 1 + frontend/src/styles/assets.css | 5 + frontend/src/ui/components/assetbodies.ts | 29 ++ frontend/src/ui/components/library.ts | 6 +- frontend/src/ui/components/organize.ts | 2 +- frontend/src/ui/components/pages.ts | 2 +- frontend/src/ui/components/sidebar.ts | 1 + frontend/tests/assets.test.ts | 7 + 25 files changed, 634 insertions(+), 13 deletions(-) create mode 100644 backend/app/services/docres.py create mode 100644 backend/tests/test_documents.py diff --git a/LICENSES.md b/LICENSES.md index 25268e2..ac724f2 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -48,6 +48,7 @@ Adobe, Bridge, Lightroom and Photoshop are either registered trademarks or trade | resvg_py 0.5.0 | MIT (binding); resvg and its crates MIT OR Apache-2.0, with Zlib, BSD-2-Clause, BSD-3-Clause, Unlicense OR MIT, Apache-2.0 WITH LLVM-exception and Unicode-3.0 parts, read from the wheel's CycloneDX SBOM 2026-11-29 | SVG and SVGZ thumbnails and renders (services/imagex.py). One compiled library in the wheel, no system dependency; references resolve inside an empty folder | | fonttools 4.69.1 | MIT | font names, glyph counts, outlines and variable axes for the font resource facts (services/fontres.py), and WOFF and WOFF2 unpacking before a font is checked for location (services/filestrip.py) | | brotli 1.2.1 | MIT | WOFF2 decompression under fontTools | +| pypdfium2 5.15.2 | Apache-2.0 OR BSD-3-Clause (bindings); the bundled PDFium build BSD-3-Clause with its third-party parts (FreeType, libjpeg-turbo, OpenJPEG, Little CMS, zlib, ICU, Abseil and the like) under permissive licences listed in the wheel's LICENSES folder | PDF page count, text for search, first-page thumbnail and page images (services/docres.py). One shared library in the wheel, used under a process-wide lock because PDFium is not thread-safe | | pyzipper 0.4.0 | MIT | AES-256 (WinZip AE-2) zip writing and reading for encrypted share packages, services/packagesvc.py | | pycryptodomex (pyzipper dependency) | BSD-2-Clause and public domain | AES and HMAC under pyzipper | | LaMa inpainting (opencv/inpainting_lama, inpainting_lama_2025jan.onnx, revision aee6d22) | Apache-2.0 | Clean Up object removal in services/cleanup.py; fetched by the installers & build script, sha256-pinned, into backend/models; bundled via --add-data like the other models. Without it Clean Up falls back to OpenCV Telea | diff --git a/README.md b/README.md index 031b9bc..62b7f33 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@

Formats

- Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app), fonts (OTF, TTF, WOFF, WOFF2) with a specimen, colour LUTs (.cube, .3dl) as a before and after, captions (SRT, VTT), ASE palettes and Lottie animations (JSON and .lottie) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP + Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app), fonts (OTF, TTF, WOFF, WOFF2) with a specimen, colour LUTs (.cube, .3dl) as a before and after, captions (SRT, VTT), ASE palettes and Lottie animations (JSON and .lottie), documents (PDF with page images, DOCX, PPTX, XLSX, CSV, Markdown, TXT, RTF, IDML) with full-text search · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index e5c844a..264b0e1 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -32,6 +32,17 @@ The EXR header reader took each attribute's size as a signed int and trusted it, Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the library without its location (export, packages, shares) now goes through filestrip, which works on an allowlist and refuses whatever it cannot check. An archive (any zip, including sequences, zip-based projects, dotLottie and form.ext packages) is rebuilt member by member, nested archives in memory up to three levels: EXR members have their latitude, longitude and altitude attributes renamed in place to x of the same length and their values zeroed (so the offset table still points at the right bytes) and are read back to confirm; DPX members have their user-defined data block (from byte 2048, the length at byte 32) zeroed, the only place the format leaves for such data; raster members (JPEG, PNG, TIFF, WebP) pass through gpsscrub and must then read as having no GPS; text members (JSON, XML, SVG, captions, LUTs and the like) pass through gpsscrub; and every member is searched for a GPS or GPSDest latitude or longitude with a value, as an attribute or an element, any spacing or quote style, any case, in the bytes and in a UTF-16 reading of them. Any other member type, an unreadable header or a value still present raises LocationRemains, which export and packages report as a refusal and shares as a skipped item. A single non-archive file is scrubbed and refused when GPS reads present, an XMP GPS value is found, or the row has a location and the file is not a raster formDAM can verify. +### services/docres.py · documents +- refers-to: docres (new) pdf, render_page, page_count, docx, pptx, xlsx, delimited, plain, rtf, rtf_text, idml, table_image, _Zip, _props, _thumbnail, extract; classify DOCUMENT_EXTS; assetkinds _load; routers/assets.py /media/{id}/page/{index}; db.media_dict ocr_text cut; query FLAGS document; mediaapi FILTERS documents; summary documents; browse MEDIA_TYPES; requirements pypdfium2; tests/test_documents.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +PDF, DOCX, PPTX, XLSX, CSV and TSV, Markdown, TXT, RTF and IDML are kind document with the extension as subkind. Their text goes into the full-text column formDAM already searches for text in photos (the Text field and the text scope), capped at 200 000 characters and the first 300 pages; list and detail responses carry only its first 2000 characters, so a folder of long documents does not swell every grid page. + +PDF is read with pypdfium2 (Apache-2.0 or BSD-3-Clause, PDFium BSD-3-Clause): page count, the info dictionary's title, author, subject, creator and producer, the text layer page by page, and the first page drawn at 1024 px for the preview. The viewer pages through /media/{id}/page/{n} at 768 or 1536 px, cached in the thumbs folder as {id}_page{n}_{size}_v1.webp so the vault's scrub and the settle step's purge remove them; a protected PDF's pages are drawn from the sealed bytes in memory and sent no-store. PDFium is not thread-safe, so every call holds one lock. A PDF that needs a password imports with a note and a drawn card. + +The Office formats are zips read through zipsafe with regular expressions rather than an XML parser, so no entity is ever expanded: w:t and a:t runs joined per paragraph, docProps/core.xml for title and author and docProps/app.xml for pages, words and slides, the shared strings and first sheet of a workbook (drawn as an 18 by 7 grid), and the docProps thumbnail when the writing app saved one. IDML gives its Stories' Content runs and counts Page elements in its Spreads. CSV is sniffed for its delimiter and drawn as the same grid. Markdown and text are drawn as a page, Markdown's first heading becoming the title. RTF is reduced to text by dropping destination groups (font, colour and style tables, info, pictures, any \\* group), decoding \\'hh as cp1252 and \\uN, and turning \\par and \\line into breaks. Converting DOCX, PPTX or XLSX pages to images would need an office suite, which formDAM does not carry; their preview is the saved thumbnail or a drawn page of their text. + ### services/fontres.py, lutres.py, captionres.py, paletteres.py, lottieres.py · design resources - refers-to: fontres (new) extract, specimen, _names; lutres (new) parse_cube, parse_3dl, apply, sample_image, before_after; captionres (new) parse, seconds, extract; paletteres (new) parse_ase, to_rgb, extract; lottieres (new) looks_lottie, sniff, load_bytes, load_path, _inline_images, sanitise, facts, extract; classify RESOURCE_EXTS, LOTTIE_JSON, file_kind; libraryfs._lottie_json, gather_items, import_one; importer upload check; assetkinds _load; routers/assets.py /media/{id}/lottie, /media/{id}/cues, _original_bytes; query FLAGS resource, font, lut, caption, palette, lottie; mediaapi FILTERS resources; summary resources; browse MEDIA_TYPES; requirements fonttools, brotli; tests/test_design_resources.py - kind: feature @@ -50,13 +61,13 @@ Palettes: ASE colour blocks in RGB, CMYK (naive conversion), LAB (D65) and Gray Lottie: a .lottie (dotLottie) zip, or a .json whose top level has v, fr, ip, op, w, h and layers. A .json is opened only after its first 4 KiB look like one, so folders of settings files are not imported. The facts are canvas size, rate, frames, duration, layers and assets. The grid shows a drawn card, since rendering a frame would need a Lottie renderer in the engine; the viewer plays the animation with lottie-web's light build. The window never gets the file as it is: /media/{id}/lottie returns the animation with every image asset that is not a data: URI emptied, so nothing is fetched from the network or the disk, and the images inside a .lottie are inlined as data URIs, each read and encoded once, with a 64 MiB total and at most 2000 assets (past either, no animation is shown). ### services/filestrip.py, zipsafe.py · bounded archive reads, one allowlist for every file -- refers-to: zipsafe (new) Budget, read_member, members, ArchiveTooLarge, MEMBER_CAP, TOTAL_CAP, MAX_MEMBERS, MAX_DEPTH; filestrip clean_member (PDF, fonts, ASE, JSON sniff), pdf_located, _font_tables, _json_text, _strip_archive budget, strip_zip, strip_file; gallerysvc.file_download refusal marker; projectfile._member; sequences.extract; tests/test_formats_extra.py +- refers-to: zipsafe (new) Budget, read_member, members, ArchiveTooLarge, MEMBER_CAP, TOTAL_CAP, MAX_MEMBERS, MAX_DEPTH; filestrip clean_member (PDF refused, fonts, ASE, JSON sniff), _font_tables, _json_text, _strip_archive budget, strip_zip, strip_file; gallerysvc.file_download refusal marker; projectfile._member; sequences.extract; tests/test_formats_extra.py - kind: fix - logged: after v1.32.4 · 2026-11-29 Every archive formDAM opens for a preview, metadata or a location strip now reads through zipsafe: each member is read in 1 MiB chunks from archive.open(), checked against its declared file_size first and its real size as it grows, against a per-member cap (512 MiB), and against one running total for the whole operation, nested archives included (2 GiB, or four times the outer file when that is larger, so a stored sequence of large EXR frames still exports). A member count above 20 000 and nesting deeper than three levels are refused. Any limit reached during a strip raises LocationRemains, so the item is refused rather than handed over unchecked; for a preview it shows as unreadable. -A file that is not an archive takes the same allowlist as a member: rasters must read back with no GPS (an unreadable raster counts as not verified), EXR and DPX are wiped and re-read, known text and anything that parses as UTF-8 JSON is scrubbed and searched (the search now also takes the JSON form "GPSLatitude": value), PDFs are searched raw and with every stream inflated (up to 256 MiB in all) and every embedded JPEG checked, fonts are searched in their name strings after a WOFF or WOFF2 is unpacked with fontTools, and ASE palettes in their UTF-16 names. Anything else is refused whatever the row's lat says. On top of the verifiers, the written file must read as having no GPS, and when the row holds a location the file must be a raster that reads back clean both through has_gps and through Pillow; a text, PDF or font file with a stored location is refused, since its content can only be searched, not shown to be free of it. In a PDF, an /Encrypt entry, a stream whose filters are anything but none, FlateDecode, or a lone DCTDecode (checked as a JPEG), and a FlateDecode stream that does not inflate completely within the budget all refuse the file; formDAM carries no PDF parser that could decode the other filters (pypdf is not a dependency here). A share that was refused leaves {id}_{sha}_noloc.refused in cache/share, so the next request for it is refused at once; the marker carries the media id, so the vault's scrub and a changed file (another sha) clear it. +A file that is not an archive takes the same allowlist as a member: rasters must read back with no GPS (an unreadable raster counts as not verified), EXR and DPX are wiped and re-read, known text and anything that parses as UTF-8 JSON is scrubbed and searched (the search now also takes the JSON form "GPSLatitude": value), fonts are searched in their name strings after a WOFF or WOFF2 is unpacked with fontTools, and ASE palettes in their UTF-16 names. Anything else is refused whatever the row's lat says. On top of the verifiers, the written file must read as having no GPS, and when the row holds a location the file must be a raster that reads back clean both through has_gps and through Pillow; a text, PDF or font file with a stored location is refused, since its content can only be searched, not shown to be free of it. PDFs never leave with their location stripped: searching their bytes and inflated streams kept missing cases (filter names written with #xx escapes, filters given as indirect references, other encryption dictionaries), and writing a clean copy needs a PDF writer (pypdf, BSD-3-Clause, would do it) that this branch does not add. So an export, package or share of a PDF without location is refused with a plain message; with location kept it leaves unchanged. Whether to add pypdf for a real metadata-free copy is an owner decision. A share that was refused leaves {id}_{sha}_noloc.refused in cache/share, so the next request for it is refused at once; the marker carries the media id, so the vault's scrub and a changed file (another sha) clear it. ### services/imagex.py, sequences.py, routers/assets.py play · more still and video formats, image sequences - refers-to: imagex (new) EXTRA_EXTS, open_extra, extra_size, ffmpeg_still, parse_pfm, tonemap, psd_thumbnail, svg_size, sanitise_svg, render_svg, _spill; decode.open_image and image_size; classify IMAGE_EXTS, VIDEO_EXTS, CAMERA_RAW_VIDEO, SEQUENCE_EXTS, is_camera_raw_video; libraryfs.gather_items, import_item, import_one as_kind; sequences (new) FrameSequence, group, pack, import_sequence, extract, strip_location; importer start_import; outputsvc._copy_file_kind; packagesvc._payload; gallerysvc.file_download; routers/assets.py /media/{id}/play, play_path, play_command; mediaapi.inert_headers; guard._any_token /play and /page; vaultcrypt _scrub, _scrub_vaulted and _drop_plain_audio cover cache/play; query FLAGS sequence, camera_raw_video; mediaapi FILTERS sequences; summary sequences; tests/test_formats_extra.py diff --git a/backend/app/db.py b/backend/app/db.py index 0d986d4..31ced4d 100644 --- a/backend/app/db.py +++ b/backend/app/db.py @@ -374,6 +374,8 @@ def media_dict(row: sqlite3.Row) -> Dict[str, Any]: d["hidden"] = bool(d.get("hidden")) for heavy in ("exif_json", "iptc_json", "lookup_json"): d.pop(heavy, None) + if d.get("kind") in ("project", "document", "model", "resource", "sequence") and d.get("ocr_text"): + d["ocr_text"] = d["ocr_text"][:2000] raw = d.pop("asset_json", None) try: d["asset"] = json.loads(raw) if raw else {} diff --git a/backend/app/routers/assets.py b/backend/app/routers/assets.py index be23dda..8826a8c 100644 --- a/backend/app/routers/assets.py +++ b/backend/app/routers/assets.py @@ -1,14 +1,15 @@ +import io import os import secrets import subprocess from fastapi import APIRouter, HTTPException, Request -from fastapi.responses import JSONResponse +from fastapi.responses import JSONResponse, Response from ..config import cache_dir from ..db import q1 from ..dedup.visual import ffmpeg_path -from ..services import assetstore, assetwork, classify, formapps, libraryfs +from ..services import assetstore, assetwork, classify, docres, formapps, libraryfs from .files import _path from .guard import ensure_visible from .revalidate import NO_STORE, REVALIDATE, must_not_store, revalidated_file @@ -142,3 +143,36 @@ def media_cues(media_id: int, request: Request): if cues is None: cues, _ = captionres.parse(_original_bytes(row)[: captionres.MAX_BYTES].decode("utf-8", "replace")) return _json_response({"cues": cues}, guarded) + + +PAGE_SIZES = (768, 1536) + + +@router.get("/media/{media_id}/page/{index}") +def media_page(media_id: int, index: int, request: Request, w: int = 1536): + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + ensure_visible(row, request) + if row["kind"] != "document" or row["subkind"] != "pdf": + raise HTTPException(415, detail="Only PDF documents have page images") + size = PAGE_SIZES[0] if w <= PAGE_SIZES[0] else PAGE_SIZES[1] + if index < 0 or (row["pages"] is not None and index >= row["pages"]): + raise HTTPException(404, detail="No such page") + guarded = must_not_store(row) + cached = assetstore.extra_path(media_id, f"page{index}_{size}", "webp") + if not guarded and os.path.isfile(cached): + return revalidated_file(request, cached, "image/webp") + source = _original_bytes(row) if guarded else libraryfs.abs_path(row["rel_path"]) + try: + img = docres.render_page(source, index, size) + except Exception as exc: + raise HTTPException(422, detail="This page could not be drawn") from exc + if img is None: + raise HTTPException(404, detail="No such page") + if guarded: + out = io.BytesIO() + img.save(out, "WEBP", quality=82) + return Response(out.getvalue(), media_type="image/webp", headers={"Cache-Control": NO_STORE}) + saved = assetstore.save_image(media_id, img, cached, size) + if saved is None: + raise HTTPException(409, detail="This item was protected while it was prepared") + return revalidated_file(request, saved, "image/webp") diff --git a/backend/app/routers/browse.py b/backend/app/routers/browse.py index c8b59f7..03af634 100644 --- a/backend/app/routers/browse.py +++ b/backend/app/routers/browse.py @@ -11,7 +11,7 @@ router = APIRouter() MEDIA_TYPES = [ - ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("sequence", "Image sequences"), ("camera_raw_video", "Camera raw video"), ("font", "Fonts"), ("lut", "Colour LUTs"), ("caption", "Captions"), ("palette", "Palettes"), ("lottie", "Lottie animations"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), + ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("document", "Documents"), ("sequence", "Image sequences"), ("camera_raw_video", "Camera raw video"), ("font", "Fonts"), ("lut", "Colour LUTs"), ("caption", "Captions"), ("palette", "Palettes"), ("lottie", "Lottie animations"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), ("panorama", "Panoramas"), ("timelapse", "Time-lapse"), ("slomo", "Slo-mo"), ("cinematic", "Cinematic"), ("burst", "Bursts"), ("spatial", "Spatial"), ("long_exposure", "Long Exposure"), ("animated", "Animated"), ("raw", "RAW"), ("screenshot", "Screenshots"), ("screen_recording", "Screen Recordings"), diff --git a/backend/app/routers/mediaapi.py b/backend/app/routers/mediaapi.py index ba33d8d..515ef19 100644 --- a/backend/app/routers/mediaapi.py +++ b/backend/app/routers/mediaapi.py @@ -24,6 +24,7 @@ "projects": ("AND kind='project'", "created_ts DESC, id DESC"), "sequences": ("AND kind='sequence'", "created_ts DESC, id DESC"), "resources": ("AND kind='resource'", "created_ts DESC, id DESC"), + "documents": ("AND kind='document'", "created_ts DESC, id DESC"), "screenshots": ("AND is_screenshot=1", "created_ts DESC, id DESC"), "screenrecs": ("AND is_screen_rec=1", "created_ts DESC, id DESC"), "not_in_album": ("AND id NOT IN (SELECT media_id FROM album_items)", "created_ts DESC, id DESC"), diff --git a/backend/app/routers/system.py b/backend/app/routers/system.py index 8f409d7..72ee36e 100644 --- a/backend/app/routers/system.py +++ b/backend/app/routers/system.py @@ -107,6 +107,7 @@ def count(sql: str) -> int: "audio": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='audio'"), "projects": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='project'"), "sequences": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='sequence'"), + "documents": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='document'"), "resources": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='resource'"), "screenshots": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screenshot=1"), "screenrecs": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screen_rec=1"), diff --git a/backend/app/services/assetkinds.py b/backend/app/services/assetkinds.py index c66fbfd..767c824 100644 --- a/backend/app/services/assetkinds.py +++ b/backend/app/services/assetkinds.py @@ -38,10 +38,11 @@ def _load() -> None: if _loaded["done"]: return _loaded["done"] = True - from . import captionres, fontres, lottieres, lutres, paletteres, projectfile, sequences + from . import captionres, docres, fontres, lottieres, lutres, paletteres, projectfile, sequences register("project", projectfile.extract) register("sequence", sequences.extract) + register("document", docres.extract) register("resource:font", fontres.extract) register("resource:lut", lutres.extract) register("resource:caption", captionres.extract) diff --git a/backend/app/services/classify.py b/backend/app/services/classify.py index 3db6220..6b37512 100644 --- a/backend/app/services/classify.py +++ b/backend/app/services/classify.py @@ -28,6 +28,13 @@ "vtt": ("caption", "text/vtt"), "ase": ("palette", "application/octet-stream"), "lottie": ("lottie", "application/zip"), } LOTTIE_JSON = ("resource", "application/json", "lottie") +DOCUMENT_EXTS = { + "pdf": "application/pdf", "docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "csv": "text/csv", + "tsv": "text/tab-separated-values", "md": "text/markdown", "markdown": "text/markdown", "txt": "text/plain", + "rtf": "application/rtf", "idml": "application/vnd.adobe.indesign-idml-package", +} SEQUENCE_EXTS = {"exr", "dpx", "png", "tif", "tiff"} AUDIO_EXTS = { "mp3": "audio/mpeg", "m4a": "audio/mp4", "aac": "audio/aac", "wav": "audio/wav", "aiff": "audio/aiff", @@ -67,6 +74,8 @@ def file_kind(name: str): from . import formapps ext = ext_of(name) + if ext in DOCUMENT_EXTS: + return "document", DOCUMENT_EXTS[ext], ext if ext in RESOURCE_EXTS: subkind, mime = RESOURCE_EXTS[ext] return "resource", mime, subkind diff --git a/backend/app/services/docres.py b/backend/app/services/docres.py new file mode 100644 index 0000000..e5d1026 --- /dev/null +++ b/backend/app/services/docres.py @@ -0,0 +1,337 @@ +import csv +import html +import io +import logging +import os +import re +import threading +import zipfile +from typing import Any, Dict, List, Optional, Tuple, Union + +from PIL import Image, ImageDraw + +from . import cards, zipsafe +from .assetkinds import Extract + +logger = logging.getLogger(__name__) +_PDF_LOCK = threading.RLock() + +MAX_TEXT = 200_000 +MAX_TEXT_PAGES = 300 +MAX_PLAIN = 32 * 1024 * 1024 +PAGE_LONG = 1024 +XML_CAP = 64 * 1024 * 1024 +TABLE_ROWS, TABLE_COLS = 18, 7 +TAG = re.compile(r"<[^>]+>") +W_TEXT = re.compile(r"]*)?>([^<]*)") +A_TEXT = re.compile(r"]*)?>([^<]*)") +CONTENT = re.compile(r"([^<]*)") +PARA_END = re.compile(r"||") +CORE = re.compile(r"<(dc:title|dc:creator|cp:lastModifiedBy|dc:subject)>([^<]*)") +APP = re.compile(r"<(Pages|Words|Slides|Application)>([^<]*)") +SLIDE = re.compile(r"^ppt/slides/slide(\d+)\.xml$") +SHEET_NAME = re.compile(r']*\bname="([^"]*)"') +CELL = re.compile(r']*)>(.*?)', re.DOTALL) +CELL_REF = re.compile(r'\br="([A-Z]+)(\d+)"') +CELL_SHARED = re.compile(r'\bt="s"') +CELL_V = re.compile(r"([^<]*)") +CELL_IS = re.compile(r"]*>([^<]*)") +SHARED_SI = re.compile(r"(.*?)", re.DOTALL) +RTF_GROUP_SKIP = re.compile(r"\{\\\*[^{}]*\}|\{\\(?:fonttbl|colortbl|stylesheet|info|pict)[^{}]*(?:\{[^{}]*\}[^{}]*)*\}") +RTF_HEX = re.compile(r"\\'([0-9a-fA-F]{2})") +RTF_UNI = re.compile(r"\\u(-?\d+)\??") +RTF_WORD = re.compile(r"\\[a-zA-Z]+-?\d* ?|\\[^a-zA-Z]") + + +def _text(raw: str) -> str: + return html.unescape(raw) + + +def _cap(text: str) -> str: + return text[:MAX_TEXT] + + +class _Zip: + def __init__(self, path: str): + self.archive = zipfile.ZipFile(path) + self.budget = zipsafe.Budget(total_cap=XML_CAP * 4, member_cap=XML_CAP) + self.names = {info.filename: info for info in zipsafe.members(self.archive, self.budget)} + + def read(self, name: str) -> Optional[str]: + info = self.names.get(name) + if info is None: + return None + return zipsafe.read_member(self.archive, info, self.budget).decode("utf-8", "replace") + + def raw(self, name: str) -> Optional[bytes]: + info = self.names.get(name) + return zipsafe.read_member(self.archive, info, self.budget) if info is not None else None + + def close(self) -> None: + self.archive.close() + + +def _props(z: _Zip) -> Dict[str, Any]: + out: Dict[str, Any] = {} + for key, value in CORE.findall(z.read("docProps/core.xml") or ""): + out[{"dc:title": "title", "dc:creator": "author", "cp:lastModifiedBy": "modified_by", "dc:subject": "subject"}[key]] = _text(value)[:300] + for key, value in APP.findall(z.read("docProps/app.xml") or ""): + out[key.lower()] = int(value) if value.isdigit() else _text(value)[:120] + return out + + +def _thumbnail(z: _Zip) -> Optional[Image.Image]: + for name in ("docProps/thumbnail.jpeg", "docProps/thumbnail.jpg", "docProps/thumbnail.png"): + data = z.raw(name) + if data: + try: + with Image.open(io.BytesIO(data)) as img: + img.load() + return img.convert("RGB") + except Exception: + return None + return None + + +def _paragraphs(xml: str, pattern: re.Pattern) -> str: + parts = PARA_END.split(xml) + return "\n".join(t for t in ("".join(_text(m) for m in pattern.findall(p)) for p in parts) if t.strip()) + + +def docx(path: str, row: Dict[str, Any]) -> Extract: + z = _Zip(path) + try: + props = _props(z) + text = _paragraphs(z.read("word/document.xml") or "", W_TEXT) + thumb = _thumbnail(z) + finally: + z.close() + meta = {"format": "Word document", **props} + preview = thumb or cards.text_page(text, props.get("title") or row.get("name", "")) + return Extract(meta=meta, pages=props.get("pages") if isinstance(props.get("pages"), int) else None, + title=props.get("title") or None, text=_cap(text), preview=preview) + + +def pptx(path: str, row: Dict[str, Any]) -> Extract: + z = _Zip(path) + try: + props = _props(z) + slides = sorted((int(m.group(1)), n) for n in z.names for m in [SLIDE.match(n)] if m) + texts = [_paragraphs(z.read(name) or "", A_TEXT) for _, name in slides[:MAX_TEXT_PAGES]] + thumb = _thumbnail(z) + finally: + z.close() + count = len(slides) or (props.get("slides") if isinstance(props.get("slides"), int) else None) + meta = {"format": "PowerPoint presentation", **props, "slides": count} + first = texts[0] if texts else "" + preview = thumb or cards.text_page(first, props.get("title") or row.get("name", "")) + return Extract(meta=meta, pages=count, title=props.get("title") or None, text=_cap("\n\n".join(texts)), preview=preview) + + +def _column(letters: str) -> int: + value = 0 + for ch in letters: + value = value * 26 + ord(ch) - 64 + return value - 1 + + +def _sheet_grid(xml: str, shared: List[str]) -> List[List[str]]: + grid = [["" for _ in range(TABLE_COLS)] for _ in range(TABLE_ROWS)] + for attrs, body in CELL.findall(xml): + ref = CELL_REF.search(attrs) + if not ref: + continue + col, row = _column(ref.group(1)), int(ref.group(2)) - 1 + if row >= TABLE_ROWS: + break + if col >= TABLE_COLS: + continue + value = CELL_V.search(body) + if CELL_SHARED.search(attrs) and value and value.group(1).isdigit(): + idx = int(value.group(1)) + grid[row][col] = shared[idx] if idx < len(shared) else "" + elif value: + grid[row][col] = _text(value.group(1)) + else: + grid[row][col] = "".join(_text(t) for t in CELL_IS.findall(body)) + return grid + + +def table_image(grid: List[List[str]], size: int = PAGE_LONG) -> Image.Image: + width, height = size, int(size * 0.62) + canvas = Image.new("RGB", (width, height), cards.PAGE_BG) + draw = ImageDraw.Draw(canvas) + rows = max(1, len(grid)) + cols = max(1, max((len(r) for r in grid), default=1)) + cell_w, cell_h = width / cols, height / rows + face = cards.font(max(10, int(cell_h * 0.45))) + for r, line in enumerate(grid): + if r == 0: + draw.rectangle([0, 0, width, cell_h], fill=(228, 222, 208)) + for c, value in enumerate(line): + x, y = c * cell_w, r * cell_h + draw.rectangle([x, y, x + cell_w, y + cell_h], outline=(205, 198, 184)) + text = value + while text and draw.textlength(text, font=face) > cell_w - 8: + text = text[:-1] + draw.text((x + 4, y + cell_h * 0.2), text, font=face, fill=cards.PAGE_INK) + return canvas + + +def xlsx(path: str, row: Dict[str, Any]) -> Extract: + z = _Zip(path) + try: + props = _props(z) + sheets = [_text(n) for n in SHEET_NAME.findall(z.read("xl/workbook.xml") or "")] + shared = ["".join(_text(t) for t in CELL_IS.findall(si)) for si in SHARED_SI.findall(z.read("xl/sharedStrings.xml") or "")] + grid = _sheet_grid(z.read("xl/worksheets/sheet1.xml") or "", shared) + finally: + z.close() + meta = {"format": "Excel workbook", **props, "sheets": len(sheets), "sheet_names": sheets[:50]} + return Extract(meta=meta, pages=len(sheets) or None, title=props.get("title") or None, + text=_cap(" ".join(sheets + shared)), preview=table_image(grid)) + + +def _read_text(path: str) -> str: + with open(path, "rb") as handle: + raw = handle.read(MAX_PLAIN) + for codec in ("utf-8-sig", "utf-16"): + try: + if codec == "utf-16" and raw[:2] not in (b"\xff\xfe", b"\xfe\xff"): + continue + return raw.decode(codec) + except UnicodeDecodeError: + continue + return raw.decode("latin-1") + + +def delimited(path: str, row: Dict[str, Any]) -> Extract: + text = _read_text(path) + try: + dialect = csv.Sniffer().sniff(text[:8192], delimiters=",;\t|") + except csv.Error: + dialect = csv.excel_tab if path.lower().endswith(".tsv") else csv.excel + rows = list(csv.reader(io.StringIO(text), dialect)) + columns = max((len(r) for r in rows), default=0) + grid = [r[:TABLE_COLS] + [""] * (TABLE_COLS - len(r[:TABLE_COLS])) for r in rows[:TABLE_ROWS]] + meta = {"format": "CSV", "rows": len(rows), "columns": columns, "header": rows[0][:30] if rows else []} + return Extract(meta=meta, text=_cap(text), preview=table_image(grid) if grid else None) + + +def plain(path: str, row: Dict[str, Any]) -> Extract: + text = _read_text(path) + markdown = path.lower().endswith((".md", ".markdown")) + heading = next((ln.lstrip("# ").strip() for ln in text.splitlines() if ln.startswith("#")), "") if markdown else "" + meta = {"format": "Markdown" if markdown else "Text", "lines": text.count("\n") + (1 if text else 0), + "words": len(text.split())} + shown = re.sub(r"^#+\s*", "", text, flags=re.MULTILINE) if markdown else text + return Extract(meta=meta, title=heading or None, text=_cap(text), preview=cards.text_page(shown, heading)) + + +def rtf_text(raw: str) -> str: + body = RTF_GROUP_SKIP.sub("", raw) + body = RTF_UNI.sub(lambda m: chr(int(m.group(1)) % 65536), body) + body = RTF_HEX.sub(lambda m: bytes([int(m.group(1), 16)]).decode("cp1252", "replace"), body) + body = re.sub(r"\\par[d]?\b ?|\\line\b ?", "\n", body) + body = RTF_WORD.sub("", body) + return body.replace("{", "").replace("}", "").strip() + + +def rtf(path: str, row: Dict[str, Any]) -> Extract: + text = rtf_text(_read_text(path)) + meta = {"format": "Rich Text", "words": len(text.split())} + return Extract(meta=meta, text=_cap(text), preview=cards.text_page(text)) + + +def idml(path: str, row: Dict[str, Any]) -> Extract: + z = _Zip(path) + try: + stories = sorted(n for n in z.names if n.startswith("Stories/") and n.endswith(".xml")) + text = "\n".join(_paragraphs(z.read(n) or "", CONTENT) for n in stories[:2000]) + spreads = [n for n in z.names if n.startswith("Spreads/") and n.endswith(".xml")] + pages = sum((z.read(n) or "").count(" Optional[Image.Image]: + with _PDF_LOCK: + return _render_page(src, index, long_side) + + +def _render_page(src: Union[str, bytes], index: int, long_side: int) -> Optional[Image.Image]: + doc = _pdf(src) + try: + if index < 0 or index >= len(doc): + return None + page = doc[index] + width, height = page.get_size() + scale = long_side / max(width, height, 1) + bitmap = page.render(scale=scale) + return bitmap.to_pil().convert("RGB") + finally: + doc.close() + + +def pdf(path: str, row: Dict[str, Any]) -> Extract: + with _PDF_LOCK: + return _pdf_extract(path) + + +def page_count(src: Union[str, bytes]) -> int: + with _PDF_LOCK: + doc = _pdf(src) + try: + return len(doc) + finally: + doc.close() + + +def _pdf_extract(path: str) -> Extract: + try: + doc = _pdf(path) + except Exception as exc: + logger.info("pdf open failed: %s", exc) + return Extract(meta={"format": "PDF", "error": "This PDF could not be opened (it may need a password)"}) + try: + count = len(doc) + info = {k.lower(): str(v)[:300] for k, v in doc.get_metadata_dict(skip_empty=True).items() + if k in ("Title", "Author", "Subject", "Creator", "Producer")} + texts: List[str] = [] + total = 0 + for index in range(min(count, MAX_TEXT_PAGES)): + page_text = doc[index].get_textpage().get_text_range() + texts.append(page_text) + total += len(page_text) + if total > MAX_TEXT: + break + version = doc.get_version() + finally: + doc.close() + preview = _render_page(path, 0, PAGE_LONG) if count else None + meta = {"format": "PDF", "version": f"{version / 10:.1f}" if version else "", **info} + return Extract(meta=meta, pages=count, title=info.get("title") or None, text=_cap("\n".join(texts)), preview=preview) + + +HANDLERS = { + "pdf": pdf, "docx": docx, "pptx": pptx, "xlsx": xlsx, "csv": delimited, "tsv": delimited, + "md": plain, "markdown": plain, "txt": plain, "rtf": rtf, "idml": idml, +} + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + handler = HANDLERS.get((row.get("subkind") or os.path.splitext(path)[1].lstrip(".")).lower()) + if handler is None: + return Extract(meta={"error": "No reader for this document type"}) + try: + return handler(path, row) + except (zipfile.BadZipFile, zipsafe.ArchiveTooLarge, KeyError) as exc: + return Extract(meta={"error": f"This document could not be read ({exc})"}) diff --git a/backend/app/services/query.py b/backend/app/services/query.py index ac18877..c080db0 100644 --- a/backend/app/services/query.py +++ b/backend/app/services/query.py @@ -32,7 +32,7 @@ "favorite": "m.favorite=1", "photo": "m.kind='image'", "video": "m.kind='video'", "audio": "m.kind='audio'", "project": "m.kind='project'", "has_preview": "m.preview_state=1", "sequence": "m.kind='sequence'", "camera_raw_video": "m.subkind='camera_raw'", - "resource": "m.kind='resource'", "font": "(m.kind='resource' AND m.subkind='font')", + "document": "m.kind='document'", "resource": "m.kind='resource'", "font": "(m.kind='resource' AND m.subkind='font')", "lut": "(m.kind='resource' AND m.subkind='lut')", "caption": "(m.kind='resource' AND m.subkind='caption')", "palette": "(m.kind='resource' AND m.subkind='palette')", "lottie": "(m.kind='resource' AND m.subkind='lottie')", "cover_art": "m.has_cover=1", "lossless": "(m.audio_codec IN ('flac','alac','wavpack','ape','tta') OR m.audio_codec LIKE 'pcm%')", diff --git a/backend/requirements.txt b/backend/requirements.txt index 1c003c1..1e95618 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -13,3 +13,4 @@ pyzipper==0.4.0 resvg_py==0.5.0 fonttools==4.69.1 brotli==1.2.1 +pypdfium2==5.15.2 diff --git a/backend/requirements_macos.txt b/backend/requirements_macos.txt index ef482ef..bc9d29a 100644 --- a/backend/requirements_macos.txt +++ b/backend/requirements_macos.txt @@ -16,3 +16,4 @@ pyzipper==0.4.0 resvg_py==0.5.0 fonttools==4.69.1 brotli==1.2.1 +pypdfium2==5.15.2 diff --git a/backend/tests/test_documents.py b/backend/tests/test_documents.py new file mode 100644 index 0000000..c2d9ea8 --- /dev/null +++ b/backend/tests/test_documents.py @@ -0,0 +1,162 @@ +import io +import json +import os +import zipfile + +from PIL import Image + +from tests.conftest import HEADERS, import_dir + + +def pdf_with_text(path, pages): + objects, kids = [], [] + font_id = 3 + objects.append(b"<< /Type /Catalog /Pages 2 0 R >>") + objects.append(b"") + objects.append(b"<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>") + for text in pages: + stream = f"BT /F1 24 Tf 40 700 Td ({text}) Tj ET".encode() + objects.append(b"<< /Length " + str(len(stream)).encode() + b" >>\nstream\n" + stream + b"\nendstream") + content_id = len(objects) + objects.append(f"<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents {content_id} 0 R " + f"/Resources << /Font << /F1 {font_id} 0 R >> >> >>".encode()) + kids.append(len(objects)) + objects.append(b"<< /Title (Harbour Plan) >>") + objects[1] = f"<< /Type /Pages /Kids [{' '.join(f'{k} 0 R' for k in kids)}] /Count {len(kids)} >>".encode() + out = io.BytesIO() + out.write(b"%PDF-1.4\n") + offsets = [] + for n, body in enumerate(objects, start=1): + offsets.append(out.tell()) + out.write(f"{n} 0 obj\n".encode() + body + b"\nendobj\n") + xref = out.tell() + out.write(f"xref\n0 {len(objects) + 1}\n0000000000 65535 f \n".encode()) + for off in offsets: + out.write(f"{off:010d} 00000 n \n".encode()) + out.write(f"trailer << /Size {len(objects) + 1} /Root 1 0 R /Info {len(objects)} 0 R >>\nstartxref\n{xref}\n%%EOF\n".encode()) + path.write_bytes(out.getvalue()) + return path + + +def ooxml(path, parts): + with zipfile.ZipFile(path, "w") as archive: + for name, body in parts.items(): + archive.writestr(name, body) + return path + + +def docx(path): + body = ('Tide tables' + 'for the north & south quay') + return ooxml(path, {"word/document.xml": body, "docProps/core.xml": "Quay notes", + "docProps/app.xml": "27"}) + + +def pptx(path): + parts = {f"ppt/slides/slide{n}.xml": f"Slide {n} heading" for n in (1, 2, 3)} + png = io.BytesIO() + Image.new("RGB", (40, 30), (0, 0, 220)).save(png, "PNG") + parts["docProps/thumbnail.png"] = png.getvalue() + return ooxml(path, parts) + + +def xlsx(path): + return ooxml(path, { + "xl/workbook.xml": '', + "xl/sharedStrings.xml": "PortHeightFalmouth", + "xl/worksheets/sheet1.xml": ('01' + '25.2'), + }) + + +def idml(path): + return ooxml(path, {"designmap.xml": "", + "Stories/Story_u1.xml": "Shoreline brochure
page two text
", + "Spreads/Spread_u2.xml": ''}) + + +def docs(client): + return {i["name"]: i for i in client.get("/api/media", params={"filter": "documents", "limit": 1000}).json()["items"]} + + +def import_documents(client, tmp_path): + from app.services import assetwork + + src = tmp_path / "src" + os.makedirs(src) + pdf_with_text(src / "plan.pdf", ["Harbour wall", "Second page", "Third page"]) + docx(src / "notes.docx") + pptx(src / "talk.pptx") + xlsx(src / "tides.xlsx") + (src / "ports.csv").write_text("port,height\nFalmouth,5.2\nPlymouth,4.9\n") + (src / "readme.md").write_text("# Survey\n\nSoundings taken at dawn.\n") + (src / "log.txt").write_text("Anchor dragged twice\n") + (src / "memo.rtf").write_text(r"{\rtf1\ansi{\fonttbl{\f0 Arial;}}\f0 Caf\'e9 crew \b bold\b0\par second line}") + idml(src / "brochure.idml") + import_dir(client, src) + assetwork.drain() + return docs(client) + + +def test_every_document_type_imports_with_facts_and_text(client, tmp_path): + found = import_documents(client, tmp_path) + assert set(found) == {"plan.pdf", "notes.docx", "talk.pptx", "tides.xlsx", "ports.csv", "readme.md", "log.txt", "memo.rtf", "brochure.idml"} + assert all(item["preview_state"] == 1 for item in found.values()), {n: i["asset"] for n, i in found.items() if i["preview_state"] != 1} + plan = found["plan.pdf"] + assert plan["pages"] == 3 and plan["title"] == "Harbour Plan" and plan["subkind"] == "pdf" + assert found["notes.docx"]["pages"] == 2 and found["notes.docx"]["title"] == "Quay notes" + assert found["talk.pptx"]["pages"] == 3 and found["tides.xlsx"]["asset"]["sheet_names"] == ["Tides", "Notes"] + assert found["ports.csv"]["asset"]["rows"] == 3 and found["ports.csv"]["asset"]["columns"] == 2 + assert found["readme.md"]["title"] == "Survey" and found["brochure.idml"]["pages"] == 2 + assert client.get("/api/summary").json()["documents"] == 9 + for word, name in (("harbour wall", "plan.pdf"), ("north & south", "notes.docx"), ("slide 3", "talk.pptx"), + ("falmouth", "tides.xlsx"), ("plymouth", "ports.csv"), ("soundings", "readme.md"), + ("café crew", "memo.rtf"), ("shoreline", "brochure.idml")): + spec = {"rules": [{"field": "text", "op": "contains", "value": word}]} + names = [m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]] + assert name in names, (word, names) + thumb = client.get(f"/api/media/{found['talk.pptx']['id']}/thumb", params={"s": 192}).content + with Image.open(io.BytesIO(thumb)) as img: + assert img.convert("RGB").getpixel((img.width // 2, img.height // 2))[2] > 180 + spec = {"rules": [{"field": "flag", "value": "document"}, {"field": "pages", "op": ">=", "value": 3}]} + assert sorted(m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]) == ["plan.pdf", "talk.pptx"] + + +def test_pdf_pages_render_and_protected_pages_stay_off_disk(client, tmp_path): + from app.services import assetstore + + found = import_documents(client, tmp_path) + plan = found["plan.pdf"] + res = client.get(f"/api/media/{plan['id']}/page/1", params={"w": 768}) + assert res.status_code == 200 and os.path.isfile(assetstore.extra_path(plan["id"], "page1_768", "webp")) + with Image.open(io.BytesIO(res.content)) as img: + assert max(img.size) == 768 + assert client.get(f"/api/media/{plan['id']}/page/7").status_code == 404 + assert client.get(f"/api/media/{found['notes.docx']['id']}/page/0").status_code == 415 + token = client.post("/api/vault/setup", json={"passkey": "vaultkey9"}, headers=HEADERS).json()["token"] + assert client.post(f"/api/media/{plan['id']}/hide", headers=HEADERS).status_code == 200 + assert not os.path.exists(assetstore.extra_path(plan["id"], "page1_768", "webp")) + sealed = client.get(f"/api/media/{plan['id']}/page/2", params={"w": 768}, headers={**HEADERS, "x-dam-vault": token}) + assert sealed.status_code == 200 and sealed.headers["cache-control"] == "no-store" + assert not os.path.exists(assetstore.extra_path(plan["id"], "page2_768", "webp")) + + +def test_list_payload_keeps_document_text_short(client, tmp_path): + from app.services import assetwork + + src = tmp_path / "src" + os.makedirs(src) + (src / "long.txt").write_text("word " * 20000) + import_dir(client, src) + assetwork.drain() + item = docs(client)["long.txt"] + assert len(item["ocr_text"]) <= 2000 + from app.db import q1 + + assert len(q1("SELECT ocr_text FROM media WHERE id=?", (item["id"],))["ocr_text"]) > 50000 + + +def test_rtf_text_reader(): + from app.services import docres + + assert docres.rtf_text("{\\rtf1{\\fonttbl{\\f0 Arial;}}\\f0 Hello \\u8364? world\\par next}") == "Hello \u20ac world\nnext" diff --git a/backend/tests/test_idevice.py b/backend/tests/test_idevice.py index 0e166d0..11808a7 100644 --- a/backend/tests/test_idevice.py +++ b/backend/tests/test_idevice.py @@ -69,7 +69,7 @@ def test_drop_upload_import(client): files=[ ("files", ("drop_a.jpg", a, "image/jpeg")), ("files", ("drop_b.jpg", b, "image/jpeg")), - ("files", ("notes.txt", b"hello", "text/plain")), + ("files", ("notes.xyz", b"hello", "application/octet-stream")), ], headers=HEADERS, ) diff --git a/frontend/src/engine/assetkinds.ts b/frontend/src/engine/assetkinds.ts index 6920141..9a005d5 100644 --- a/frontend/src/engine/assetkinds.ts +++ b/frontend/src/engine/assetkinds.ts @@ -168,8 +168,23 @@ export function swatchesOf(facts: AssetFacts): Swatch[] { && /^#[0-9a-f]{6}$/i.test((s as Swatch).hex)); } +export function documentFacts(facts: AssetFacts): FactRow[] { + const count = (key: string, label: string): FactRow => { + const value = num(facts, key); + return [label, value !== null ? String(value) : ""]; + }; + const sheets = list(facts, "sheet_names"); + return [ + ["Format", str(facts, "format")], ["Title", str(facts, "title")], ["Author", str(facts, "author")], + count("pages", "Pages"), count("slides", "Slides"), count("sheets", "Sheets"), ["Sheet names", sheets], + count("rows", "Rows"), count("columns", "Columns"), count("words", "Words"), count("lines", "Lines"), + ["Created with", str(facts, "creator") || str(facts, "application")], ["PDF version", str(facts, "version")], + ]; +} + const FACTS: Readonly FactRow[]>> = { project: projectFacts, + document: documentFacts, sequence: sequenceFacts, "resource:font": fontFacts, "resource:lut": lutFacts, diff --git a/frontend/src/engine/store.ts b/frontend/src/engine/store.ts index 91987fa..c4efb19 100644 --- a/frontend/src/engine/store.ts +++ b/frontend/src/engine/store.ts @@ -217,6 +217,7 @@ const LEGACY_SPECS: Record = { projects: { rules: [{ field: "flag", value: "project" }] }, sequences: { rules: [{ field: "flag", value: "sequence" }] }, resources: { rules: [{ field: "flag", value: "resource" }] }, + documents: { rules: [{ field: "flag", value: "document" }] }, screenshots: { rules: [{ field: "flag", value: "screenshot" }] }, screenrecs: { rules: [{ field: "flag", value: "screen_recording" }] }, not_in_album: { rules: [{ field: "flag", value: "not_in_album" }] }, diff --git a/frontend/src/styles/assets.css b/frontend/src/styles/assets.css index 60b7b79..34821fc 100644 --- a/frontend/src/styles/assets.css +++ b/frontend/src/styles/assets.css @@ -28,6 +28,11 @@ .cue { display: grid; grid-template-columns: 9em 1fr; gap: var(--space-2); } .cue-at { color: var(--text-faint); font-variant-numeric: tabular-nums; } .cue-text { color: var(--text); white-space: pre-wrap; } +.asset-pages { display: flex; flex-direction: column; gap: var(--space-2); align-items: center; } +.asset-pager { display: flex; align-items: center; gap: var(--space-3); } +.asset-doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); } +.asset-excerpt { max-height: 56vh; overflow: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--text); padding: var(--space-2); border-radius: 8px; background: var(--glass-bg-2); } +@media (max-width: 720px) { .asset-doc { grid-template-columns: 1fr; } } .asset-lottie { width: 100%; height: 56vh; border-radius: 10px; background: var(--glass-bg-2); } @media (max-width: 560px) { .cue { grid-template-columns: 1fr; } diff --git a/frontend/src/ui/components/assetbodies.ts b/frontend/src/ui/components/assetbodies.ts index 6085c76..d377c52 100644 --- a/frontend/src/ui/components/assetbodies.ts +++ b/frontend/src/ui/components/assetbodies.ts @@ -54,7 +54,36 @@ function lottieBody(item: Media, signal: AbortSignal): HTMLElement { return stage; } +function pdfBody(item: Media, signal: AbortSignal): HTMLElement { + const total = Math.max(1, item.pages ?? 1); + let index = 0; + const img = h("img", { class: "asset-preview", alt: item.name, draggable: "false" }) as HTMLImageElement; + const label = h("span", { class: "asset-sub" }); + const prev = h("button", { class: "btn", type: "button", "aria-label": "Previous page" }, "Previous") as HTMLButtonElement; + const next = h("button", { class: "btn", type: "button", "aria-label": "Next page" }, "Next") as HTMLButtonElement; + const show = (to: number) => { + index = Math.min(total - 1, Math.max(0, to)); + img.src = `/api/media/${item.id}/page/${index}?w=1536`; + label.textContent = `Page ${index + 1} of ${total}`; + prev.disabled = index === 0; + next.disabled = index >= total - 1; + }; + prev.addEventListener("click", () => show(index - 1), { signal }); + next.addEventListener("click", () => show(index + 1), { signal }); + img.addEventListener("error", () => { img.src = thumbUrl(item.id, 768); }, { once: true, signal }); + show(0); + return h("div", { class: "asset-pages" }, img, h("div", { class: "asset-pager" }, prev, label, next)); +} + +function excerptBody(item: Media): HTMLElement { + const text = (item as Media & { ocr_text?: string | null }).ocr_text ?? ""; + const preview = h("img", { class: "asset-preview", alt: item.name, src: thumbUrl(item.id, 768), draggable: "false" }); + return text ? h("div", { class: "asset-doc" }, preview, h("div", { class: "asset-excerpt" }, text)) : preview; +} + export function registerAssetBodies(): void { + assetBody("document:pdf", pdfBody); + assetBody("document", excerptBody); assetBody("resource:font", fontBody); assetBody("resource:palette", paletteBody); assetBody("resource:caption", captionBody); diff --git a/frontend/src/ui/components/library.ts b/frontend/src/ui/components/library.ts index 022be06..b111d41 100644 --- a/frontend/src/ui/components/library.ts +++ b/frontend/src/ui/components/library.ts @@ -18,6 +18,7 @@ const FILTER_LABELS: Record = { projects: "Form Projects", sequences: "Image Sequences", resources: "Design Resources", + documents: "Documents", screenshots: "Screenshots", screenrecs: "Screen Recordings", not_in_album: "Not in an Album", @@ -74,9 +75,9 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo const filterBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Filter" }, iconEl("sliders")); const menu = h("div", { class: "menu pop-surface hidden" }); const menuAnchor = h("div", { class: "menu-anchor" }, filterBtn, menu); - const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "sequences", "resources", "screenshots", "not_in_album"]; + const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "sequences", "documents", "resources", "screenshots", "not_in_album"]; const FILTER_ICONS: Partial> = { - all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", sequences: "frames", resources: "swatch", + all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", sequences: "frames", resources: "swatch", documents: "doc", screenshots: "screenshot", not_in_album: "albumOff", }; for (const key of filterKeys) { @@ -155,6 +156,7 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo projects: state.summary.projects ?? 0, sequences: state.summary.sequences ?? 0, resources: state.summary.resources ?? 0, + documents: state.summary.documents ?? 0, screenshots: state.summary.screenshots, screenrecs: state.summary.screenrecs, recently_viewed: state.summary.recently_viewed, diff --git a/frontend/src/ui/components/organize.ts b/frontend/src/ui/components/organize.ts index cd14360..8efa22d 100644 --- a/frontend/src/ui/components/organize.ts +++ b/frontend/src/ui/components/organize.ts @@ -339,7 +339,7 @@ const RULE_FIELDS: Array<[string, string]> = [ ["app", "Form app"], ["format", "File format"], ["pages", "Pages or frames"], ]; const FLAG_VALUES: Array<[string, string]> = [ - ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["sequence", "Image sequence"], ["camera_raw_video", "Camera raw video"], ["resource", "Design resource"], ["font", "Font"], ["lut", "Colour LUT"], + ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["sequence", "Image sequence"], ["camera_raw_video", "Camera raw video"], ["document", "Document"], ["resource", "Design resource"], ["font", "Font"], ["lut", "Colour LUT"], ["caption", "Captions"], ["palette", "Palette"], ["lottie", "Lottie animation"], ["raw", "RAW"], ["live", "Live Photo"], ["panorama", "Panorama"], ["selfie", "Selfie"], ["portrait", "Portrait"], ["slomo", "Slo-mo"], ["burst", "Burst"], ["screenshot", "Screenshot"], ["screen_recording", "Screen Recording"], ["edited", "Edited"], ["rejected", "Rejected"], diff --git a/frontend/src/ui/components/pages.ts b/frontend/src/ui/components/pages.ts index 675cd28..478876d 100644 --- a/frontend/src/ui/components/pages.ts +++ b/frontend/src/ui/components/pages.ts @@ -72,7 +72,7 @@ interface MediaType { } const TYPE_ICONS: Record = { - video: "video", audio: "audio", project: "project", sequence: "frames", camera_raw_video: "video", font: "swatch", lut: "swatch", caption: "swatch", palette: "swatch", lottie: "swatch", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", + video: "video", audio: "audio", project: "project", sequence: "frames", camera_raw_video: "video", document: "doc", font: "swatch", lut: "swatch", caption: "swatch", palette: "swatch", lottie: "swatch", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", burst: "stack", raw: "file", screenshot: "screenshot", screen_recording: "stage", timelapse: "clock", cinematic: "video", spatial: "cube", long_exposure: "wave", animated: "play", }; diff --git a/frontend/src/ui/components/sidebar.ts b/frontend/src/ui/components/sidebar.ts index 4ef2820..632d9a3 100644 --- a/frontend/src/ui/components/sidebar.ts +++ b/frontend/src/ui/components/sidebar.ts @@ -21,6 +21,7 @@ const PINNED: RowSpec[] = [ { label: "Videos", icon: "video", hash: "#/f/videos" }, { label: "Audio", icon: "audio", hash: "#/f/audio" }, { label: "Form Projects", icon: "project", hash: "#/f/projects" }, + { label: "Documents", icon: "doc", hash: "#/f/documents" }, { label: "Design Resources", icon: "swatch", hash: "#/f/resources" }, { label: "Screenshots", icon: "screenshot", hash: "#/f/screenshots" }, { label: "People", icon: "people", hash: "#/people" }, diff --git a/frontend/tests/assets.test.ts b/frontend/tests/assets.test.ts index 0d4ffaa..281558c 100644 --- a/frontend/tests/assets.test.ts +++ b/frontend/tests/assets.test.ts @@ -46,3 +46,10 @@ describe("design resources and sequences", () => { expect(clockLabel(65)).toBe("1:05"); }); }); + +describe("documents", () => { + it("lists the counts a document has", () => { + const rows = assetFacts({ kind: "document", subkind: "xlsx", pages: 2, asset: { format: "Excel workbook", sheets: 2, sheet_names: ["Tides", "Notes"] } }); + expect(rows).toEqual([["Format", "Excel workbook"], ["Sheets", "2"], ["Sheet names", "Tides, Notes"]]); + }); +}); From 9c7b83e3bac919331e3eb783d4c77eda8144a61a Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:29:26 -0500 Subject: [PATCH 14/35] fix: workbook previews stream the first rows and fit cells by binary 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. --- backend/HASHOUT_LOG.md | 4 +- backend/app/services/docres.py | 131 +++++++++++++++++++++++++------- backend/tests/test_documents.py | 24 ++++++ 3 files changed, 129 insertions(+), 30 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 264b0e1..a39edde 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -33,7 +33,7 @@ The EXR header reader took each attribute's size as a signed int and trusted it, Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the library without its location (export, packages, shares) now goes through filestrip, which works on an allowlist and refuses whatever it cannot check. An archive (any zip, including sequences, zip-based projects, dotLottie and form.ext packages) is rebuilt member by member, nested archives in memory up to three levels: EXR members have their latitude, longitude and altitude attributes renamed in place to x of the same length and their values zeroed (so the offset table still points at the right bytes) and are read back to confirm; DPX members have their user-defined data block (from byte 2048, the length at byte 32) zeroed, the only place the format leaves for such data; raster members (JPEG, PNG, TIFF, WebP) pass through gpsscrub and must then read as having no GPS; text members (JSON, XML, SVG, captions, LUTs and the like) pass through gpsscrub; and every member is searched for a GPS or GPSDest latitude or longitude with a value, as an attribute or an element, any spacing or quote style, any case, in the bytes and in a UTF-16 reading of them. Any other member type, an unreadable header or a value still present raises LocationRemains, which export and packages report as a refusal and shares as a skipped item. A single non-archive file is scrubbed and refused when GPS reads present, an XMP GPS value is found, or the row has a location and the file is not a raster formDAM can verify. ### services/docres.py · documents -- refers-to: docres (new) pdf, render_page, page_count, docx, pptx, xlsx, delimited, plain, rtf, rtf_text, idml, table_image, _Zip, _props, _thumbnail, extract; classify DOCUMENT_EXTS; assetkinds _load; routers/assets.py /media/{id}/page/{index}; db.media_dict ocr_text cut; query FLAGS document; mediaapi FILTERS documents; summary documents; browse MEDIA_TYPES; requirements pypdfium2; tests/test_documents.py +- refers-to: docres (new) pdf, render_page, page_count, docx, pptx, xlsx, sheet_cells, shared_strings, _events, _fit, _Zip.head, delimited, plain, rtf, rtf_text, idml, table_image, _Zip, _props, _thumbnail, extract; classify DOCUMENT_EXTS; assetkinds _load; routers/assets.py /media/{id}/page/{index}; db.media_dict ocr_text cut; query FLAGS document; mediaapi FILTERS documents; summary documents; browse MEDIA_TYPES; requirements pypdfium2; tests/test_documents.py - kind: feature - logged: after v1.32.4 · 2026-11-29 @@ -41,7 +41,7 @@ PDF, DOCX, PPTX, XLSX, CSV and TSV, Markdown, TXT, RTF and IDML are kind documen PDF is read with pypdfium2 (Apache-2.0 or BSD-3-Clause, PDFium BSD-3-Clause): page count, the info dictionary's title, author, subject, creator and producer, the text layer page by page, and the first page drawn at 1024 px for the preview. The viewer pages through /media/{id}/page/{n} at 768 or 1536 px, cached in the thumbs folder as {id}_page{n}_{size}_v1.webp so the vault's scrub and the settle step's purge remove them; a protected PDF's pages are drawn from the sealed bytes in memory and sent no-store. PDFium is not thread-safe, so every call holds one lock. A PDF that needs a password imports with a note and a drawn card. -The Office formats are zips read through zipsafe with regular expressions rather than an XML parser, so no entity is ever expanded: w:t and a:t runs joined per paragraph, docProps/core.xml for title and author and docProps/app.xml for pages, words and slides, the shared strings and first sheet of a workbook (drawn as an 18 by 7 grid), and the docProps thumbnail when the writing app saved one. IDML gives its Stories' Content runs and counts Page elements in its Spreads. CSV is sniffed for its delimiter and drawn as the same grid. Markdown and text are drawn as a page, Markdown's first heading becoming the title. RTF is reduced to text by dropping destination groups (font, colour and style tables, info, pictures, any \\* group), decoding \\'hh as cp1252 and \\uN, and turning \\par and \\line into breaks. Converting DOCX, PPTX or XLSX pages to images would need an office suite, which formDAM does not carry; their preview is the saved thumbnail or a drawn page of their text. +The Office formats are zips read through zipsafe with regular expressions rather than an XML parser, so no entity is ever expanded: w:t and a:t runs joined per paragraph, docProps/core.xml for title and author and docProps/app.xml for pages, words and slides, the first sheet of a workbook and the shared strings its first rows use (drawn as an 18 by 7 grid; both parts are read only up to their first 2 MiB, through the stdlib pull parser with any document that declares a DOCTYPE or ENTITY ignored, and the sheet stops after 18 rows and the strings after the highest index those rows need; each cell is cut to 200 characters and fitted to its column by a binary search on its drawn width), and the docProps thumbnail when the writing app saved one. IDML gives its Stories' Content runs and counts Page elements in its Spreads. CSV is sniffed for its delimiter and drawn as the same grid. Markdown and text are drawn as a page, Markdown's first heading becoming the title. RTF is reduced to text by dropping destination groups (font, colour and style tables, info, pictures, any \\* group), decoding \\'hh as cp1252 and \\uN, and turning \\par and \\line into breaks. Converting DOCX, PPTX or XLSX pages to images would need an office suite, which formDAM does not carry; their preview is the saved thumbnail or a drawn page of their text. ### services/fontres.py, lutres.py, captionres.py, paletteres.py, lottieres.py · design resources - refers-to: fontres (new) extract, specimen, _names; lutres (new) parse_cube, parse_3dl, apply, sample_image, before_after; captionres (new) parse, seconds, extract; paletteres (new) parse_ase, to_rgb, extract; lottieres (new) looks_lottie, sniff, load_bytes, load_path, _inline_images, sanitise, facts, extract; classify RESOURCE_EXTS, LOTTIE_JSON, file_kind; libraryfs._lottie_json, gather_items, import_one; importer upload check; assetkinds _load; routers/assets.py /media/{id}/lottie, /media/{id}/cues, _original_bytes; query FLAGS resource, font, lut, caption, palette, lottie; mediaapi FILTERS resources; summary resources; browse MEDIA_TYPES; requirements fonttools, brotli; tests/test_design_resources.py diff --git a/backend/app/services/docres.py b/backend/app/services/docres.py index e5d1026..8af5838 100644 --- a/backend/app/services/docres.py +++ b/backend/app/services/docres.py @@ -22,6 +22,9 @@ PAGE_LONG = 1024 XML_CAP = 64 * 1024 * 1024 TABLE_ROWS, TABLE_COLS = 18, 7 +PART_HEAD = 2 * 1024 * 1024 +CELL_SHOWN = 200 +DTD = re.compile(rb"]+>") W_TEXT = re.compile(r"]*)?>([^<]*)") A_TEXT = re.compile(r"]*)?>([^<]*)") @@ -31,12 +34,6 @@ APP = re.compile(r"<(Pages|Words|Slides|Application)>([^<]*)") SLIDE = re.compile(r"^ppt/slides/slide(\d+)\.xml$") SHEET_NAME = re.compile(r']*\bname="([^"]*)"') -CELL = re.compile(r']*)>(.*?)', re.DOTALL) -CELL_REF = re.compile(r'\br="([A-Z]+)(\d+)"') -CELL_SHARED = re.compile(r'\bt="s"') -CELL_V = re.compile(r"([^<]*)") -CELL_IS = re.compile(r"]*>([^<]*)") -SHARED_SI = re.compile(r"(.*?)", re.DOTALL) RTF_GROUP_SKIP = re.compile(r"\{\\\*[^{}]*\}|\{\\(?:fonttbl|colortbl|stylesheet|info|pict)[^{}]*(?:\{[^{}]*\}[^{}]*)*\}") RTF_HEX = re.compile(r"\\'([0-9a-fA-F]{2})") RTF_UNI = re.compile(r"\\u(-?\d+)\??") @@ -63,6 +60,19 @@ def read(self, name: str) -> Optional[str]: return None return zipsafe.read_member(self.archive, info, self.budget).decode("utf-8", "replace") + def head(self, name: str, limit: int = PART_HEAD) -> bytes: + info = self.names.get(name) + if info is None: + return b"" + out = bytearray() + with self.archive.open(info) as handle: + while len(out) < limit: + block = handle.read(min(1 << 16, limit - len(out))) + if not block: + break + out += block + return bytes(out) + def raw(self, name: str) -> Optional[bytes]: info = self.names.get(name) return zipsafe.read_member(self.archive, info, self.budget) if info is not None else None @@ -135,28 +145,92 @@ def _column(letters: str) -> int: return value - 1 -def _sheet_grid(xml: str, shared: List[str]) -> List[List[str]]: +def _local(tag: str) -> str: + return tag.rsplit("}", 1)[-1] + + +def _events(data: bytes): + import xml.etree.ElementTree as ET + + if DTD.search(data): + return + parser = ET.XMLPullParser(events=("start", "end")) + try: + parser.feed(data) + yield from parser.read_events() + parser.close() + except ET.ParseError: + yield from parser.read_events() + + +def sheet_cells(data: bytes) -> List[Tuple[int, int, str, str]]: + cells: List[Tuple[int, int, str, str]] = [] + ref, kind, value, inline = None, "", "", [] + for event, elem in _events(data): + name = _local(elem.tag) + if event == "start" and name == "c": + ref, kind, value, inline = elem.get("r"), elem.get("t") or "", "", [] + elif event == "end" and name == "v": + value = elem.text or "" + elif event == "end" and name == "t": + inline.append(elem.text or "") + elif event == "end" and name == "c" and ref: + match = re.match(r"([A-Z]+)(\d+)$", ref) + if match: + row = int(match.group(2)) - 1 + if row >= TABLE_ROWS: + break + cells.append((row, _column(match.group(1)), kind, value if value or kind != "inlineStr" else "".join(inline))) + elif event == "end" and name == "row": + elem.clear() + return cells + + +def shared_strings(data: bytes, needed: Optional[set] = None) -> List[str]: + out: List[str] = [] + parts: List[str] = [] + top = max(needed) if needed else None + for event, elem in _events(data): + name = _local(elem.tag) + if event == "start" and name == "si": + parts = [] + elif event == "end" and name == "t": + parts.append(elem.text or "") + elif event == "end" and name == "si": + out.append("".join(parts)[:CELL_SHOWN * 5]) + elem.clear() + if top is not None and len(out) > top: + break + return out + + +def _sheet_grid(cells: List[Tuple[int, int, str, str]], shared: List[str]) -> List[List[str]]: grid = [["" for _ in range(TABLE_COLS)] for _ in range(TABLE_ROWS)] - for attrs, body in CELL.findall(xml): - ref = CELL_REF.search(attrs) - if not ref: - continue - col, row = _column(ref.group(1)), int(ref.group(2)) - 1 - if row >= TABLE_ROWS: - break - if col >= TABLE_COLS: + for row, col, kind, value in cells: + if row >= TABLE_ROWS or col >= TABLE_COLS: continue - value = CELL_V.search(body) - if CELL_SHARED.search(attrs) and value and value.group(1).isdigit(): - idx = int(value.group(1)) + if kind == "s" and value.isdigit(): + idx = int(value) grid[row][col] = shared[idx] if idx < len(shared) else "" - elif value: - grid[row][col] = _text(value.group(1)) else: - grid[row][col] = "".join(_text(t) for t in CELL_IS.findall(body)) + grid[row][col] = value return grid +def _fit(draw: ImageDraw.ImageDraw, text: str, face, width: float) -> str: + text = text[:CELL_SHOWN] + if draw.textlength(text, font=face) <= width: + return text + lo, hi = 0, len(text) + while lo < hi: + mid = (lo + hi + 1) // 2 + if draw.textlength(text[:mid], font=face) <= width: + lo = mid + else: + hi = mid - 1 + return text[:lo] + + def table_image(grid: List[List[str]], size: int = PAGE_LONG) -> Image.Image: width, height = size, int(size * 0.62) canvas = Image.new("RGB", (width, height), cards.PAGE_BG) @@ -171,9 +245,7 @@ def table_image(grid: List[List[str]], size: int = PAGE_LONG) -> Image.Image: for c, value in enumerate(line): x, y = c * cell_w, r * cell_h draw.rectangle([x, y, x + cell_w, y + cell_h], outline=(205, 198, 184)) - text = value - while text and draw.textlength(text, font=face) > cell_w - 8: - text = text[:-1] + text = _fit(draw, value, face, cell_w - 8) draw.text((x + 4, y + cell_h * 0.2), text, font=face, fill=cards.PAGE_INK) return canvas @@ -182,14 +254,17 @@ def xlsx(path: str, row: Dict[str, Any]) -> Extract: z = _Zip(path) try: props = _props(z) - sheets = [_text(n) for n in SHEET_NAME.findall(z.read("xl/workbook.xml") or "")] - shared = ["".join(_text(t) for t in CELL_IS.findall(si)) for si in SHARED_SI.findall(z.read("xl/sharedStrings.xml") or "")] - grid = _sheet_grid(z.read("xl/worksheets/sheet1.xml") or "", shared) + sheets = [_text(n) for n in SHEET_NAME.findall(z.head("xl/workbook.xml").decode("utf-8", "replace"))] + cells = sheet_cells(z.head("xl/worksheets/sheet1.xml")) + strings_part = z.head("xl/sharedStrings.xml") finally: z.close() + needed = {int(v) for _r, _c, kind, v in cells if kind == "s" and v.isdigit()} + shown = shared_strings(strings_part, needed) if needed else [] + words = shared_strings(strings_part) meta = {"format": "Excel workbook", **props, "sheets": len(sheets), "sheet_names": sheets[:50]} return Extract(meta=meta, pages=len(sheets) or None, title=props.get("title") or None, - text=_cap(" ".join(sheets + shared)), preview=table_image(grid)) + text=_cap(" ".join(sheets + words)), preview=table_image(_sheet_grid(cells, shown))) def _read_text(path: str) -> str: diff --git a/backend/tests/test_documents.py b/backend/tests/test_documents.py index c2d9ea8..90f89ac 100644 --- a/backend/tests/test_documents.py +++ b/backend/tests/test_documents.py @@ -160,3 +160,27 @@ def test_rtf_text_reader(): from app.services import docres assert docres.rtf_text("{\\rtf1{\\fonttbl{\\f0 Arial;}}\\f0 Hello \\u8364? world\\par next}") == "Hello \u20ac world\nnext" + + +def test_huge_workbook_parts_preview_quickly(client, tmp_path): + import time + + from app.services import assetwork, docres + + shared = "" + "".join(f"string {n}" for n in range(400000)) + "" + sheet = ('3' + + "W" * 500000 + "" + + "".join(f'{n}' for n in range(2, 60000)) + "") + src = tmp_path / "src" + os.makedirs(src) + ooxml(src / "big.xlsx", {"xl/workbook.xml": '', + "xl/sharedStrings.xml": shared, "xl/worksheets/sheet1.xml": sheet}) + started = time.monotonic() + found = docres.xlsx(str(src / "big.xlsx"), {"name": "big.xlsx"}) + assert time.monotonic() - started < 5 + assert found.preview is not None and found.meta["sheets"] == 1 + cells = docres.sheet_cells(sheet.encode()[: docres.PART_HEAD]) + assert max(r for r, _c, _k, _v in cells) == docres.TABLE_ROWS - 1 + assert docres.shared_strings(shared.encode(), {3}) == ["string 0", "string 1", "string 2", "string 3"] + bomb = b']>&a;' + assert docres.shared_strings(bomb) == [] From 4b69d8d73bfb9ceef76a386aea9fa3222bb9827b Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:29:47 -0500 Subject: [PATCH 15/35] feat: 3D models with a drawn still, a turntable and their facts 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. --- README.md | 2 +- backend/HASHOUT_LOG.md | 11 + backend/app/routers/assets.py | 17 + backend/app/routers/browse.py | 2 +- backend/app/routers/mediaapi.py | 1 + backend/app/routers/system.py | 1 + backend/app/services/assetkinds.py | 3 +- backend/app/services/classify.py | 8 + backend/app/services/filestrip.py | 2 +- backend/app/services/modelres.py | 442 ++++++++++++++++++++++ backend/app/services/query.py | 2 +- backend/tests/test_models.py | 163 ++++++++ frontend/HASHOUT_LOG.md | 7 + frontend/src/engine/assetkinds.ts | 26 ++ frontend/src/engine/store.ts | 1 + frontend/src/styles/assets.css | 2 + frontend/src/ui/components/assetbodies.ts | 76 +++- frontend/src/ui/components/library.ts | 6 +- frontend/src/ui/components/organize.ts | 2 +- frontend/src/ui/components/pages.ts | 2 +- frontend/src/ui/components/sidebar.ts | 1 + frontend/tests/assets.test.ts | 14 +- 22 files changed, 780 insertions(+), 11 deletions(-) create mode 100644 backend/app/services/modelres.py create mode 100644 backend/tests/test_models.py diff --git a/README.md b/README.md index 62b7f33..ca09263 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@

Formats

- Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app), fonts (OTF, TTF, WOFF, WOFF2) with a specimen, colour LUTs (.cube, .3dl) as a before and after, captions (SRT, VTT), ASE palettes and Lottie animations (JSON and .lottie), documents (PDF with page images, DOCX, PPTX, XLSX, CSV, Markdown, TXT, RTF, IDML) with full-text search · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP + Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app), fonts (OTF, TTF, WOFF, WOFF2) with a specimen, colour LUTs (.cube, .3dl) as a before and after, captions (SRT, VTT), ASE palettes and Lottie animations (JSON and .lottie), documents (PDF with page images, DOCX, PPTX, XLSX, CSV, Markdown, TXT, RTF, IDML) with full-text search, 3D models (GLB and glTF, OBJ, STL, PLY, text USD and USDZ drawn and turnable; STEP and IGES as point clouds; FBX, binary USD and Alembic catalogued) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index a39edde..0bf105a 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -32,6 +32,17 @@ The EXR header reader took each attribute's size as a signed int and trusted it, Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the library without its location (export, packages, shares) now goes through filestrip, which works on an allowlist and refuses whatever it cannot check. An archive (any zip, including sequences, zip-based projects, dotLottie and form.ext packages) is rebuilt member by member, nested archives in memory up to three levels: EXR members have their latitude, longitude and altitude attributes renamed in place to x of the same length and their values zeroed (so the offset table still points at the right bytes) and are read back to confirm; DPX members have their user-defined data block (from byte 2048, the length at byte 32) zeroed, the only place the format leaves for such data; raster members (JPEG, PNG, TIFF, WebP) pass through gpsscrub and must then read as having no GPS; text members (JSON, XML, SVG, captions, LUTs and the like) pass through gpsscrub; and every member is searched for a GPS or GPSDest latitude or longitude with a value, as an attribute or an element, any spacing or quote style, any case, in the bytes and in a UTF-16 reading of them. Any other member type, an unreadable header or a value still present raises LocationRemains, which export and packages report as a refusal and shares as a skipped item. A single non-archive file is scrubbed and refused when GPS reads present, an XMP GPS value is found, or the row has a location and the file is not a raster formDAM can verify. +### services/modelres.py · 3D models +- refers-to: modelres (new) Mesh, read_stl, read_obj, read_ply, read_gltf, gltf_facts, read_usd, read_step, read_iges, read_fbx, read_alembic, render, viewer_mesh, mesh_from_bytes, extract; classify MODEL_EXTS; assetkinds _load; routers/assets.py /media/{id}/mesh; filestrip TEXT_MEMBERS step, stp, iges, igs; query FLAGS model; mediaapi FILTERS models; summary models; browse MEDIA_TYPES; tests/test_models.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +GLB and glTF, FBX, OBJ, STL, PLY, USD, USDA, USDC and USDZ, Alembic, STEP and IGES are kind model. No 3D library was added: the common geometry formats are small enough to read directly with numpy, and the ones that are not would need libraries outside the licence rules or the bundle size (the Autodesk FBX SDK is proprietary, OpenUSD and Alembic are large C++ builds, and tessellating STEP and IGES needs OpenCASCADE, which is LGPL-2.1 with an exception but a very large native dependency). + +Read with geometry: STL (binary when 84 + 50 n bytes matches the file, else text), OBJ (v and f with fans for polygons, negative indices, usemtl names, o and g objects), PLY (text, or binary with fixed vertex properties and a face list), glTF 2.0 (GLB chunks or embedded data: buffers; a .gltf whose buffers are separate files gets its facts from the JSON, since the files do not travel with it; POSITION and index accessors with strides, triangle primitives only, node transforms not applied), and text USD (point3f[] points, faceVertexCounts and faceVertexIndices per mesh; a USDZ is opened for its first .usda). The facts are triangles, vertices, the bounding size along each axis (glTF in metres), meshes and material names. The preview is drawn by the engine: an orthographic view turned 35 degrees and tilted 24, flat shading from a fixed light, triangles sorted back to front, at most 40 000 sampled triangles. STEP gives its schema, face and solid counts, length unit and every CARTESIAN_POINT, and IGES its entity and surface counts and point entities (116): both are shown as point clouds, which give the shape and bounding size without a solid modeller. FBX (binary version or text), binary USD (crate) and Alembic (Ogawa or HDF5) are recognised and catalogued with their format and a drawn card. + +The viewer's turntable is a canvas in the window, drawing up to 12 000 triangles (or the points) from /media/{id}/mesh, normalised to a unit box; it turns by itself until dragged, double-click toggles the spin. The mesh is cached beside the preview as {id}_mesh_v1.json, purged with the item's other caches; a protected model's mesh is read from the sealed bytes in memory and sent no-store. Files over 512 MiB are catalogued without a preview. + ### services/docres.py · documents - refers-to: docres (new) pdf, render_page, page_count, docx, pptx, xlsx, sheet_cells, shared_strings, _events, _fit, _Zip.head, delimited, plain, rtf, rtf_text, idml, table_image, _Zip, _props, _thumbnail, extract; classify DOCUMENT_EXTS; assetkinds _load; routers/assets.py /media/{id}/page/{index}; db.media_dict ocr_text cut; query FLAGS document; mediaapi FILTERS documents; summary documents; browse MEDIA_TYPES; requirements pypdfium2; tests/test_documents.py - kind: feature diff --git a/backend/app/routers/assets.py b/backend/app/routers/assets.py index 8826a8c..e13bb7e 100644 --- a/backend/app/routers/assets.py +++ b/backend/app/routers/assets.py @@ -176,3 +176,20 @@ def media_page(media_id: int, index: int, request: Request, w: int = 1536): if saved is None: raise HTTPException(409, detail="This item was protected while it was prepared") return revalidated_file(request, saved, "image/webp") + + +@router.get("/media/{media_id}/mesh") +def media_mesh(media_id: int, request: Request): + from ..services import modelres + + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + ensure_visible(row, request) + if row["kind"] != "model": + raise HTTPException(415, detail="Only 3D models have a mesh") + guarded = must_not_store(row) + mesh = None if guarded else assetstore.load_json(media_id, "mesh") + if mesh is None and guarded: + mesh = modelres.mesh_from_bytes(_original_bytes(row), (row["subkind"] or "").lower()) + if mesh is None: + raise HTTPException(404, detail="No viewable mesh for this model") + return _json_response(mesh, guarded) diff --git a/backend/app/routers/browse.py b/backend/app/routers/browse.py index 03af634..61c933a 100644 --- a/backend/app/routers/browse.py +++ b/backend/app/routers/browse.py @@ -11,7 +11,7 @@ router = APIRouter() MEDIA_TYPES = [ - ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("document", "Documents"), ("sequence", "Image sequences"), ("camera_raw_video", "Camera raw video"), ("font", "Fonts"), ("lut", "Colour LUTs"), ("caption", "Captions"), ("palette", "Palettes"), ("lottie", "Lottie animations"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), + ("video", "Videos"), ("audio", "Audio"), ("project", "Form projects"), ("document", "Documents"), ("model", "3D models"), ("sequence", "Image sequences"), ("camera_raw_video", "Camera raw video"), ("font", "Fonts"), ("lut", "Colour LUTs"), ("caption", "Captions"), ("palette", "Palettes"), ("lottie", "Lottie animations"), ("live", "Live Photos"), ("selfie", "Selfies"), ("portrait", "Portrait"), ("panorama", "Panoramas"), ("timelapse", "Time-lapse"), ("slomo", "Slo-mo"), ("cinematic", "Cinematic"), ("burst", "Bursts"), ("spatial", "Spatial"), ("long_exposure", "Long Exposure"), ("animated", "Animated"), ("raw", "RAW"), ("screenshot", "Screenshots"), ("screen_recording", "Screen Recordings"), diff --git a/backend/app/routers/mediaapi.py b/backend/app/routers/mediaapi.py index 515ef19..0ba4cbf 100644 --- a/backend/app/routers/mediaapi.py +++ b/backend/app/routers/mediaapi.py @@ -25,6 +25,7 @@ "sequences": ("AND kind='sequence'", "created_ts DESC, id DESC"), "resources": ("AND kind='resource'", "created_ts DESC, id DESC"), "documents": ("AND kind='document'", "created_ts DESC, id DESC"), + "models": ("AND kind='model'", "created_ts DESC, id DESC"), "screenshots": ("AND is_screenshot=1", "created_ts DESC, id DESC"), "screenrecs": ("AND is_screen_rec=1", "created_ts DESC, id DESC"), "not_in_album": ("AND id NOT IN (SELECT media_id FROM album_items)", "created_ts DESC, id DESC"), diff --git a/backend/app/routers/system.py b/backend/app/routers/system.py index 72ee36e..7ffe8cc 100644 --- a/backend/app/routers/system.py +++ b/backend/app/routers/system.py @@ -107,6 +107,7 @@ def count(sql: str) -> int: "audio": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='audio'"), "projects": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='project'"), "sequences": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='sequence'"), + "models": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='model'"), "documents": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='document'"), "resources": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND kind='resource'"), "screenshots": count(f"SELECT COUNT(*) AS n FROM media WHERE {visible} AND is_screenshot=1"), diff --git a/backend/app/services/assetkinds.py b/backend/app/services/assetkinds.py index 767c824..34a60f5 100644 --- a/backend/app/services/assetkinds.py +++ b/backend/app/services/assetkinds.py @@ -38,11 +38,12 @@ def _load() -> None: if _loaded["done"]: return _loaded["done"] = True - from . import captionres, docres, fontres, lottieres, lutres, paletteres, projectfile, sequences + from . import captionres, docres, fontres, modelres, lottieres, lutres, paletteres, projectfile, sequences register("project", projectfile.extract) register("sequence", sequences.extract) register("document", docres.extract) + register("model", modelres.extract) register("resource:font", fontres.extract) register("resource:lut", lutres.extract) register("resource:caption", captionres.extract) diff --git a/backend/app/services/classify.py b/backend/app/services/classify.py index 6b37512..9da32b5 100644 --- a/backend/app/services/classify.py +++ b/backend/app/services/classify.py @@ -35,6 +35,12 @@ "tsv": "text/tab-separated-values", "md": "text/markdown", "markdown": "text/markdown", "txt": "text/plain", "rtf": "application/rtf", "idml": "application/vnd.adobe.indesign-idml-package", } +MODEL_EXTS = { + "glb": "model/gltf-binary", "gltf": "model/gltf+json", "fbx": "application/octet-stream", "obj": "model/obj", + "stl": "model/stl", "ply": "application/x-ply", "usd": "model/vnd.usd", "usda": "model/vnd.usda", + "usdc": "model/vnd.usd", "usdz": "model/vnd.usdz+zip", "abc": "application/x-alembic", "step": "model/step", + "stp": "model/step", "iges": "model/iges", "igs": "model/iges", +} SEQUENCE_EXTS = {"exr", "dpx", "png", "tif", "tiff"} AUDIO_EXTS = { "mp3": "audio/mpeg", "m4a": "audio/mp4", "aac": "audio/aac", "wav": "audio/wav", "aiff": "audio/aiff", @@ -76,6 +82,8 @@ def file_kind(name: str): ext = ext_of(name) if ext in DOCUMENT_EXTS: return "document", DOCUMENT_EXTS[ext], ext + if ext in MODEL_EXTS: + return "model", MODEL_EXTS[ext], ext if ext in RESOURCE_EXTS: subkind, mime = RESOURCE_EXTS[ext] return "resource", mime, subkind diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index 863a5b4..e195f9c 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -12,7 +12,7 @@ DPX_USER_START = 2048 RASTER_MEMBERS = {".jpg", ".jpeg", ".png", ".tif", ".tiff", ".webp"} TEXT_MEMBERS = {".json", ".xml", ".rels", ".txt", ".md", ".csv", ".tsv", ".srt", ".vtt", ".svg", ".html", ".htm", ".css", - ".cube", ".3dl", ".obj", ".mtl", ".gltf", ".usda", ".idml", ".plist", ".yaml", ".yml", ".toml", ".ini"} + ".cube", ".3dl", ".obj", ".mtl", ".gltf", ".usda", ".step", ".stp", ".iges", ".igs", ".idml", ".plist", ".yaml", ".yml", ".toml", ".ini"} ARCHIVE_MEMBERS = {".zip", ".lottie", ".formpkg"} FONT_MEMBERS = {".ttf", ".otf", ".woff", ".woff2"} NAMED_BINARY = {".ase"} diff --git a/backend/app/services/modelres.py b/backend/app/services/modelres.py new file mode 100644 index 0000000..19ea731 --- /dev/null +++ b/backend/app/services/modelres.py @@ -0,0 +1,442 @@ +import base64 +import json +import logging +import math +import os +import re +import struct +import zipfile +from dataclasses import dataclass, field +from typing import Any, Dict, List, Optional, Tuple + +import numpy as np +from PIL import Image, ImageDraw + +from . import cards, zipsafe +from .assetkinds import Extract + +logger = logging.getLogger(__name__) + +MAX_READ = 512 * 1024 * 1024 +RENDER_TRIS = 40_000 +VIEWER_TRIS = 12_000 +MAX_POINTS = 200_000 +BACKGROUND = (30, 28, 24) +SURFACE = np.array([214, 204, 186], dtype=np.float32) +LIGHT = np.array([0.35, 0.55, 0.76], dtype=np.float32) +GLB_MAGIC = b"glTF" +COMPONENTS = {5120: "b", 5121: "B", 5122: "h", 5123: "H", 5125: "I", 5126: "f"} +WIDTHS = {"SCALAR": 1, "VEC2": 2, "VEC3": 3, "VEC4": 4} +STEP_POINT = re.compile(rb"CARTESIAN_POINT\s*\(\s*'[^']*'\s*,\s*\(\s*([-+0-9.Ee]+)\s*,\s*([-+0-9.Ee]+)\s*,\s*([-+0-9.Ee]+)\s*\)") +STEP_HEADER = re.compile(rb"(FILE_DESCRIPTION|FILE_NAME|FILE_SCHEMA)\s*\((.*?)\)\s*;", re.DOTALL) +STEP_COUNTED = (b"ADVANCED_FACE", b"MANIFOLD_SOLID_BREP", b"PRODUCT(", b"SHELL_BASED_SURFACE_MODEL") +STEP_UNIT = re.compile(rb"SI_UNIT\s*\(\s*\.(MILLI|CENTI|KILO)?\.?\s*,?\s*\.METRE\.") +USDA_POINTS = re.compile(r"point3f\[\]\s+points\s*=\s*\[(.*?)\]", re.DOTALL) +USDA_COUNTS = re.compile(r"int\[\]\s+faceVertexCounts\s*=\s*\[(.*?)\]", re.DOTALL) +USDA_INDICES = re.compile(r"int\[\]\s+faceVertexIndices\s*=\s*\[(.*?)\]", re.DOTALL) +USD_MATERIAL = re.compile(r'def\s+Material\s+"([^"]+)"') +TUPLE = re.compile(r"\(\s*([-+0-9.eE]+)\s*,\s*([-+0-9.eE]+)\s*,\s*([-+0-9.eE]+)\s*\)") + + +class ModelError(ValueError): + pass + + +@dataclass(frozen=True) +class Mesh: + vertices: np.ndarray + faces: np.ndarray + meta: Dict[str, Any] = field(default_factory=dict) + points_only: bool = False + + +def _read(path: str) -> bytes: + if os.path.getsize(path) > MAX_READ: + raise ModelError("This model is too large to preview") + with open(path, "rb") as handle: + return handle.read() + + +def _fan(polygon: List[int]) -> List[Tuple[int, int, int]]: + return [(polygon[0], polygon[i], polygon[i + 1]) for i in range(1, len(polygon) - 1)] + + +def read_stl(data: bytes) -> Mesh: + if len(data) >= 84: + count = struct.unpack_from(" Mesh: + verts: List[Tuple[float, float, float]] = [] + faces: List[Tuple[int, int, int]] = [] + materials, groups = set(), set() + for raw in data.decode("utf-8", "replace").splitlines(): + parts = raw.split() + if not parts: + continue + if parts[0] == "v" and len(parts) >= 4: + verts.append((float(parts[1]), float(parts[2]), float(parts[3]))) + elif parts[0] == "f" and len(parts) >= 4: + idx = [] + for token in parts[1:]: + n = int(token.split("/")[0]) + idx.append(n - 1 if n > 0 else len(verts) + n) + faces.extend(_fan(idx)) + elif parts[0] == "usemtl" and len(parts) > 1: + materials.add(parts[1]) + elif parts[0] in ("o", "g") and len(parts) > 1: + groups.add(parts[1]) + if not verts: + raise ModelError("No vertices in this OBJ file") + return Mesh(np.array(verts, dtype=np.float32), np.array(faces or [(0, 0, 0)], dtype=np.int64), + {"format": "OBJ", "materials": sorted(materials)[:50], "objects": len(groups) or None}) + + +PLY_TYPES = {"char": "i1", "uchar": "u1", "short": "i2", "ushort": "u2", "int": "i4", "uint": "u4", "float": "f4", "double": "f8", + "int8": "i1", "uint8": "u1", "int16": "i2", "uint16": "u2", "int32": "i4", "uint32": "u4", "float32": "f4", "float64": "f8"} + + +def _ply_header(data: bytes) -> Tuple[str, List[Tuple[str, int, List[List[str]]]], int]: + end = data.find(b"end_header") + if not data.startswith(b"ply") or end < 0: + raise ModelError("Not a PLY file") + body = data.index(b"\n", end) + 1 + fmt, elements = "", [] + for line in data[:end].decode("ascii", "replace").splitlines(): + parts = line.split() + if not parts: + continue + if parts[0] == "format": + fmt = parts[1] + elif parts[0] == "element": + elements.append((parts[1], int(parts[2]), [])) + elif parts[0] == "property" and elements: + elements[-1][2].append(parts[1:]) + return fmt, elements, body + + +def read_ply(data: bytes) -> Mesh: + fmt, elements, pos = _ply_header(data) + verts, faces = None, [] + if fmt == "ascii": + lines = data[pos:].decode("ascii", "replace").split("\n") + at = 0 + for name, count, props in elements: + rows = [ln.split() for ln in lines[at:at + count]] + at += count + if name == "vertex": + keys = [p[-1] for p in props] + cols = [keys.index(k) for k in ("x", "y", "z")] + verts = np.array([[float(r[c]) for c in cols] for r in rows if len(r) >= 3], dtype=np.float32) + elif name == "face": + for r in rows: + n = int(r[0]) + faces.extend(_fan([int(v) for v in r[1:1 + n]])) + else: + order = "<" if fmt == "binary_little_endian" else ">" + for name, count, props in elements: + if all(p[0] != "list" for p in props): + dtype = np.dtype([(p[-1], order + PLY_TYPES[p[0]]) for p in props]) + block = np.frombuffer(data, dtype=dtype, count=count, offset=pos) + pos += dtype.itemsize * count + if name == "vertex": + verts = np.stack([block["x"], block["y"], block["z"]], axis=1).astype(np.float32) + continue + if name != "face" or len(props) != 1: + raise ModelError("This PLY layout is not supported for preview") + count_t, index_t = order + PLY_TYPES[props[0][1]], order + PLY_TYPES[props[0][2]] + csize, isize = np.dtype(count_t).itemsize, np.dtype(index_t).itemsize + for _ in range(count): + n = int(np.frombuffer(data, dtype=count_t, count=1, offset=pos)[0]) + idx = np.frombuffer(data, dtype=index_t, count=n, offset=pos + csize).tolist() + pos += csize + n * isize + faces.extend(_fan(idx)) + if verts is None or not len(verts): + raise ModelError("No vertices in this PLY file") + return Mesh(verts, np.array(faces, dtype=np.int64) if faces else np.zeros((0, 3), dtype=np.int64), + {"format": f"PLY ({fmt.replace('_', ' ')})"}, points_only=not faces) + + +def _gltf_parts(data: bytes) -> Tuple[Dict[str, Any], Optional[bytes]]: + if data[:4] == GLB_MAGIC: + length = struct.unpack_from(" bytes: + buf = doc["buffers"][index] + uri = buf.get("uri") + if uri is None: + if binary is None: + raise ModelError("A buffer is missing") + return binary + if uri.startswith("data:") and "," in uri: + return base64.b64decode(uri.split(",", 1)[1]) + raise ModelError("This glTF keeps its geometry in a separate file") + + +def _accessor(doc: Dict[str, Any], index: int, binary: Optional[bytes]) -> np.ndarray: + acc = doc["accessors"][index] + view = doc["bufferViews"][acc["bufferView"]] + data = _buffer(doc, view["buffer"], binary) + width = WIDTHS[acc["type"]] + dtype = np.dtype("<" + COMPONENTS[acc["componentType"]]) + offset = view.get("byteOffset", 0) + acc.get("byteOffset", 0) + stride = view.get("byteStride") or dtype.itemsize * width + count = acc["count"] + if offset + stride * (count - 1) + dtype.itemsize * width > len(data): + raise ModelError("An accessor runs past its buffer") + if stride == dtype.itemsize * width: + return np.frombuffer(data, dtype=dtype, count=count * width, offset=offset).reshape(count, width) + rows = [np.frombuffer(data, dtype=dtype, count=width, offset=offset + i * stride) for i in range(count)] + return np.stack(rows) + + +def gltf_facts(doc: Dict[str, Any]) -> Dict[str, Any]: + tris, lo, hi = 0, None, None + for mesh in doc.get("meshes") or []: + for prim in mesh.get("primitives") or []: + acc = (doc.get("accessors") or [])[prim.get("attributes", {}).get("POSITION", -1)] if "POSITION" in prim.get("attributes", {}) else None + if acc and acc.get("min") and acc.get("max"): + lo = np.minimum(lo, acc["min"]) if lo is not None else np.array(acc["min"], dtype=float) + hi = np.maximum(hi, acc["max"]) if hi is not None else np.array(acc["max"], dtype=float) + if prim.get("mode", 4) == 4: + count = (doc["accessors"][prim["indices"]]["count"] if "indices" in prim else (acc or {}).get("count", 0)) + tris += count // 3 + facts = {"meshes": len(doc.get("meshes") or []), "materials": [m.get("name") or f"Material {i + 1}" for i, m in enumerate(doc.get("materials") or [])][:50], + "generator": str((doc.get("asset") or {}).get("generator") or "")[:120], "triangles": tris, "units": "m"} + if lo is not None: + facts["size"] = [round(float(v), 6) for v in (hi - lo)] + return facts + + +def read_gltf(data: bytes) -> Mesh: + doc, binary = _gltf_parts(data) + facts = {"format": "GLB" if data[:4] == GLB_MAGIC else "glTF", **gltf_facts(doc)} + verts, faces, base = [], [], 0 + for mesh in doc.get("meshes") or []: + for prim in mesh.get("primitives") or []: + if prim.get("mode", 4) != 4 or "POSITION" not in prim.get("attributes", {}): + continue + pos = _accessor(doc, prim["attributes"]["POSITION"], binary).astype(np.float32) + idx = (_accessor(doc, prim["indices"], binary).reshape(-1).astype(np.int64) if "indices" in prim + else np.arange(len(pos), dtype=np.int64)) + verts.append(pos) + faces.append(idx[: len(idx) - len(idx) % 3].reshape(-1, 3) + base) + base += len(pos) + if not verts: + return Mesh(np.zeros((0, 3), np.float32), np.zeros((0, 3), np.int64), facts) + return Mesh(np.concatenate(verts), np.concatenate(faces), facts) + + +def _usda(text: str) -> Mesh: + verts, faces, base = [], [], 0 + for points, counts, indices in zip(USDA_POINTS.findall(text), USDA_COUNTS.findall(text), USDA_INDICES.findall(text)): + pts = [tuple(float(v) for v in t) for t in TUPLE.findall(points)] + sizes = [int(v) for v in re.findall(r"-?\d+", counts)] + idx = [int(v) for v in re.findall(r"-?\d+", indices)] + at = 0 + for n in sizes: + faces.extend(tuple(i + base for i in tri) for tri in _fan(idx[at:at + n])) + at += n + verts.extend(pts) + base += len(pts) + meta = {"format": "USD (text)", "meshes": len(USDA_POINTS.findall(text)), "materials": sorted(set(USD_MATERIAL.findall(text)))[:50]} + if not verts: + raise ModelError("No mesh points in this USD file") + return Mesh(np.array(verts, dtype=np.float32), np.array(faces or [(0, 0, 0)], dtype=np.int64), meta) + + +def read_usd(data: bytes, ext: str) -> Mesh: + if data[:8] == b"PXR-USDC": + raise ModelError("Binary USD (crate) files are catalogued without a preview") + if ext == "usdz" or data[:2] == b"PK": + import io + + budget = zipsafe.Budget(total_cap=MAX_READ) + with zipfile.ZipFile(io.BytesIO(data)) as archive: + for info in zipsafe.members(archive, budget): + if info.filename.lower().endswith(".usda"): + return _usda(zipsafe.read_member(archive, info, budget).decode("utf-8", "replace")) + raise ModelError("This USDZ holds only binary USD, catalogued without a preview") + return _usda(data.decode("utf-8", "replace")) + + +def read_step(data: bytes) -> Mesh: + if b"ISO-10303-21" not in data[:200]: + raise ModelError("Not a STEP file") + head = {key.decode(): value.decode("latin-1", "replace").strip()[:300] for key, value in STEP_HEADER.findall(data[:20000])} + points = np.array([[float(x), float(y), float(z)] for x, y, z in STEP_POINT.findall(data)[:MAX_POINTS]], dtype=np.float32) + unit = STEP_UNIT.search(data) + meta = {"format": "STEP", "schema": head.get("FILE_SCHEMA", "").strip("()' "), + "faces": data.count(b"ADVANCED_FACE"), "solids": data.count(b"MANIFOLD_SOLID_BREP"), + "units": {b"MILLI": "mm", b"CENTI": "cm", b"KILO": "km"}.get(unit.group(1), "m") if unit else ""} + return Mesh(points.reshape(-1, 3), np.zeros((0, 3), np.int64), meta, points_only=True) + + +def read_iges(data: bytes) -> Mesh: + lines = data.decode("latin-1", "replace").splitlines() + sections = [ln[72] if len(ln) > 72 else "" for ln in lines] + if "G" not in sections: + raise ModelError("Not an IGES file") + entries = [ln for ln, sec in zip(lines, sections) if sec == "D"][::2] + kinds: Dict[int, int] = {} + for entry in entries: + try: + kinds[int(entry[:8])] = kinds.get(int(entry[:8]), 0) + 1 + except ValueError: + continue + points = [] + for ln, sec in zip(lines, sections): + if sec == "P" and ln.startswith("116,"): + bits = ln[:64].replace(";", ",").split(",") + try: + points.append([float(bits[1]), float(bits[2]), float(bits[3])]) + except (ValueError, IndexError): + continue + meta = {"format": "IGES", "entities": len(entries), "surfaces": sum(v for k, v in kinds.items() if k in (128, 143, 144, 186))} + return Mesh(np.array(points, dtype=np.float32).reshape(-1, 3), np.zeros((0, 3), np.int64), meta, points_only=True) + + +def read_fbx(data: bytes) -> Mesh: + if data.startswith(b"Kaydara FBX Binary"): + version = struct.unpack_from(" Mesh: + if data[:5] == b"Ogawa": + raise ModelError(json.dumps({"format": "Alembic (Ogawa)"})) + raise ModelError(json.dumps({"format": "Alembic (HDF5)" if data[:8] == b"\x89HDF\r\n\x1a\n" else "Alembic"})) + + +READERS = { + "stl": lambda d, e: read_stl(d), "obj": lambda d, e: read_obj(d), "ply": lambda d, e: read_ply(d), + "glb": lambda d, e: read_gltf(d), "gltf": lambda d, e: read_gltf(d), "usd": read_usd, "usda": read_usd, + "usdc": read_usd, "usdz": read_usd, "step": lambda d, e: read_step(d), "stp": lambda d, e: read_step(d), + "iges": lambda d, e: read_iges(d), "igs": lambda d, e: read_iges(d), "fbx": lambda d, e: read_fbx(d), + "abc": lambda d, e: read_alembic(d), +} + + +def _view(vertices: np.ndarray, yaw: float = 0.62, pitch: float = 0.42) -> np.ndarray: + cy, sy, cp, sp = math.cos(yaw), math.sin(yaw), math.cos(pitch), math.sin(pitch) + turn = np.array([[cy, 0, sy], [0, 1, 0], [-sy, 0, cy]], dtype=np.float32) + tilt = np.array([[1, 0, 0], [0, cp, -sp], [0, sp, cp]], dtype=np.float32) + centre = (vertices.min(axis=0) + vertices.max(axis=0)) / 2 + return (vertices - centre) @ turn.T @ tilt.T + + +def _fit(view: np.ndarray, width: int, height: int) -> Tuple[np.ndarray, float]: + span = float(max(np.ptp(view[:, 0]), np.ptp(view[:, 1]), 1e-9)) + scale = min(width, height) * 0.82 / span + xy = np.stack([width / 2 + view[:, 0] * scale, height / 2 - view[:, 1] * scale], axis=1) + return xy, scale + + +def render(mesh: Mesh, size: int = 1024) -> Optional[Image.Image]: + if not len(mesh.vertices): + return None + width, height = size, int(size * 0.75) + canvas = Image.new("RGB", (width, height), BACKGROUND) + draw = ImageDraw.Draw(canvas) + view = _view(mesh.vertices.astype(np.float32)) + xy, _scale = _fit(view, width, height) + faces = mesh.faces + if mesh.points_only or not len(faces): + step = max(1, len(xy) // MAX_POINTS) + for x, y in xy[::step]: + draw.point((float(x), float(y)), fill=tuple(int(c) for c in SURFACE)) + return canvas + faces = faces[(faces < len(view)).all(axis=1) & (faces >= 0).all(axis=1)] + if len(faces) > RENDER_TRIS: + faces = faces[:: math.ceil(len(faces) / RENDER_TRIS)] + tri = view[faces] + normals = np.cross(tri[:, 1] - tri[:, 0], tri[:, 2] - tri[:, 0]) + lengths = np.linalg.norm(normals, axis=1, keepdims=True) + normals = normals / np.where(lengths == 0, 1, lengths) + shade = 0.28 + 0.72 * np.abs(normals @ LIGHT) + order = np.argsort(tri[:, :, 2].mean(axis=1)) + for i in order: + colour = tuple(int(c) for c in SURFACE * shade[i]) + pts = [tuple(map(float, xy[j])) for j in faces[i]] + draw.polygon(pts, fill=colour) + return canvas + + +def viewer_mesh(mesh: Mesh) -> Dict[str, Any]: + faces = mesh.faces + if len(faces) > VIEWER_TRIS: + faces = faces[:: math.ceil(len(faces) / VIEWER_TRIS)] + used, remap = np.unique(faces.reshape(-1), return_inverse=True) if len(faces) else (np.arange(0), np.arange(0)) + verts = mesh.vertices[used] if len(used) else mesh.vertices[:: max(1, len(mesh.vertices) // 20000)] + centre = (verts.min(axis=0) + verts.max(axis=0)) / 2 if len(verts) else np.zeros(3) + span = float(np.ptp(verts, axis=0).max()) if len(verts) else 1.0 + norm = np.round((verts - centre) / (span or 1.0), 4) + return {"positions": norm.reshape(-1).tolist(), "indices": remap.reshape(-1).tolist() if len(faces) else [], + "points": bool(mesh.points_only or not len(faces))} + + +def mesh_from_bytes(data: bytes, ext: str) -> Optional[Dict[str, Any]]: + reader = READERS.get(ext) + if reader is None or len(data) > MAX_READ: + return None + try: + mesh = reader(data, ext) + except (ModelError, ValueError, KeyError, IndexError, struct.error, zipfile.BadZipFile, zipsafe.ArchiveTooLarge): + return None + return viewer_mesh(mesh) if len(mesh.vertices) else None + + +def extract(path: str, row: Dict[str, Any]) -> Extract: + ext = (row.get("subkind") or os.path.splitext(path)[1].lstrip(".")).lower() + reader = READERS.get(ext) + try: + mesh = reader(_read(path), ext) if reader else None + except (ModelError, ValueError, KeyError, IndexError, struct.error, zipfile.BadZipFile, zipsafe.ArchiveTooLarge) as exc: + text = str(exc) + try: + meta = json.loads(text) if text.startswith("{") else {"format": ext.upper(), "note": text} + except ValueError: + meta = {"format": ext.upper(), "note": text} + return Extract(meta=meta, preview=cards.kind_card(ext, [row.get("name") or "", meta.get("format", "")], ext)) + if mesh is None: + return Extract(meta={"error": "No reader for this model type"}) + verts = mesh.vertices + meta = dict(mesh.meta) + if len(verts): + meta.setdefault("size", [round(float(v), 6) for v in np.ptp(verts, axis=0)]) + if not mesh.points_only: + meta.setdefault("triangles", int(len(mesh.faces))) + meta["vertices"] = int(len(verts)) + else: + meta["points"] = int(len(verts)) + preview = render(mesh) or cards.kind_card(ext, [row.get("name") or ""], ext) + return Extract(meta=meta, preview=preview, extras={"mesh": viewer_mesh(mesh)} if len(verts) else {}) diff --git a/backend/app/services/query.py b/backend/app/services/query.py index c080db0..34b8ad0 100644 --- a/backend/app/services/query.py +++ b/backend/app/services/query.py @@ -32,7 +32,7 @@ "favorite": "m.favorite=1", "photo": "m.kind='image'", "video": "m.kind='video'", "audio": "m.kind='audio'", "project": "m.kind='project'", "has_preview": "m.preview_state=1", "sequence": "m.kind='sequence'", "camera_raw_video": "m.subkind='camera_raw'", - "document": "m.kind='document'", "resource": "m.kind='resource'", "font": "(m.kind='resource' AND m.subkind='font')", + "document": "m.kind='document'", "model": "m.kind='model'", "resource": "m.kind='resource'", "font": "(m.kind='resource' AND m.subkind='font')", "lut": "(m.kind='resource' AND m.subkind='lut')", "caption": "(m.kind='resource' AND m.subkind='caption')", "palette": "(m.kind='resource' AND m.subkind='palette')", "lottie": "(m.kind='resource' AND m.subkind='lottie')", "cover_art": "m.has_cover=1", "lossless": "(m.audio_codec IN ('flac','alac','wavpack','ape','tta') OR m.audio_codec LIKE 'pcm%')", diff --git a/backend/tests/test_models.py b/backend/tests/test_models.py new file mode 100644 index 0000000..d1e7a56 --- /dev/null +++ b/backend/tests/test_models.py @@ -0,0 +1,163 @@ +import base64 +import io +import json +import os +import struct +import zipfile + +import numpy as np +from PIL import Image + +from tests.conftest import HEADERS, import_dir + +CUBE_V = np.array([[x, y, z] for x in (0, 2) for y in (0, 1) for z in (0, 3)], dtype=np.float32) +CUBE_QUADS = [(0, 1, 3, 2), (4, 6, 7, 5), (0, 4, 5, 1), (2, 3, 7, 6), (0, 2, 6, 4), (1, 5, 7, 3)] +CUBE_T = np.array([t for q in CUBE_QUADS for t in ((q[0], q[1], q[2]), (q[0], q[2], q[3]))], dtype=np.uint32) + + +def stl(path): + body = b"".join(struct.pack("<3f", 0, 0, 0) + CUBE_V[list(t)].astype("7}" + + lines = [card("test", "S", 1), card("1H,,1H;;", "G", 1), + card(" 116 1 0 0 0 0 0 000000001", "D", 1), + card(" 116 0 0 1 0 0", "D", 2), + card("116,1.0,2.0,3.0;", "P", 1), card("S 1G 1D 2P 1", "T", 1)] + path.write_text("\n".join(lines) + "\n") + + +WRITERS = { + "cube.stl": stl, "cube.obj": obj, "cube.ply": ply_ascii, "bin.ply": ply_binary, "cube.glb": glb, + "cube.gltf": lambda p: p.write_text(json.dumps(gltf_doc(buffer_uri=True)[0])), + "box.usda": lambda p: p.write_text(usda_text()), + "box.usdz": None, + "part.step": step, "part.igs": iges, + "rig.fbx": lambda p: p.write_bytes(b"Kaydara FBX Binary \x00\x1a\x00" + struct.pack(" 300 + mesh = client.get(f"/api/media/{glb_item['id']}/mesh").json() + assert len(mesh["indices"]) == 36 and len(mesh["positions"]) == 24 and mesh["points"] is False + assert max(abs(v) for v in mesh["positions"]) <= 0.5001 + assert client.get(f"/api/media/{found['rig.fbx']['id']}/mesh").status_code == 404 + assert client.get(f"/api/media/{found['part.step']['id']}/mesh").json()["points"] is True + token = client.post("/api/vault/setup", json={"passkey": "vaultkey9"}, headers=HEADERS).json()["token"] + assert client.post(f"/api/media/{glb_item['id']}/hide", headers=HEADERS).status_code == 200 + sealed = client.get(f"/api/media/{glb_item['id']}/mesh", headers={**HEADERS, "x-dam-vault": token}) + assert sealed.status_code == 200 and sealed.headers["cache-control"] == "no-store" and len(sealed.json()["indices"]) == 36 + + +def test_bad_models_do_not_stop_the_worker(client, tmp_path): + from app.services import assetwork + + src = tmp_path / "src" + os.makedirs(src) + (src / "junk.glb").write_bytes(b"glTF" + b"\xff" * 40) + (src / "junk.ply").write_bytes(b"ply\nformat binary_little_endian 1.0\nelement vertex 99\nproperty float x\nend_header\n") + obj(src / "fine.obj") + import_dir(client, src) + assetwork.drain() + found = {i["name"]: i for i in client.get("/api/media", params={"filter": "models"}).json()["items"]} + assert found["fine.obj"]["asset"]["triangles"] == 12 + assert "note" in found["junk.glb"]["asset"] or "error" in found["junk.glb"]["asset"] + assert found["junk.ply"]["preview_state"] == 1 diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 75a857a..92416db 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### ui/components/assetbodies.ts · pages and the turntable +- refers-to: assetbodies.ts pdfBody, excerptBody, modelBody, drawMesh; assetkinds.ts documentFacts, modelFacts, rotatePoint; library.ts, sidebar.ts, store.ts, organize.ts, pages.ts Documents and 3D Models; styles/assets.css +- kind: feat +- logged: after v1.32.4 · 2026-11-29 + +A PDF opens on its first page with Previous and Next through the engine's page images; other documents show their preview beside the first 2000 characters of their text. A 3D model opens as a canvas turntable drawn in the window (painter's order, flat shading, the same light as the engine's still), turning on its own until dragged. + ### ui/components/assetbodies.ts · resource bodies in the viewer - refers-to: assetbodies.ts (new) fontBody, paletteBody, captionBody, lottieBody, registerAssetBodies; assetkinds.ts fontFacts, lutFacts, captionFacts, paletteFacts, lottieFacts, sequenceFacts, clockLabel, swatchesOf; main.ts registerAssetBodies; library.ts, sidebar.ts, store.ts, organize.ts, pages.ts Design Resources; viewer.ts playable-copy fallback for video; package.json lottie-web 5.12.2; styles/assets.css - kind: feat diff --git a/frontend/src/engine/assetkinds.ts b/frontend/src/engine/assetkinds.ts index 9a005d5..f4673cb 100644 --- a/frontend/src/engine/assetkinds.ts +++ b/frontend/src/engine/assetkinds.ts @@ -182,8 +182,34 @@ export function documentFacts(facts: AssetFacts): FactRow[] { ]; } +function sizeLine(facts: AssetFacts): string { + const size = facts.size; + if (!Array.isArray(size) || size.length !== 3 || !size.every((v) => typeof v === "number")) return ""; + const unit = str(facts, "units"); + const fmt = (v: number) => (Math.abs(v) >= 100 ? v.toFixed(0) : Number(v.toPrecision(4)).toString()); + return `${size.map(fmt).join(" x ")}${unit ? ` ${unit}` : ""}`; +} + +export function modelFacts(facts: AssetFacts): FactRow[] { + const n = (key: string) => (num(facts, key) !== null ? (num(facts, key) as number).toLocaleString("en-US") : ""); + return [ + ["Format", str(facts, "format")], ["Triangles", n("triangles")], ["Vertices", n("vertices")], ["Points", n("points")], + ["Bounding size", sizeLine(facts)], ["Meshes", n("meshes")], ["Materials", list(facts, "materials")], + ["Solids", n("solids")], ["Faces", n("faces")], ["Entities", n("entities")], ["Schema", str(facts, "schema")], + ["Made with", str(facts, "generator")], ["Note", str(facts, "note")], + ]; +} + +export function rotatePoint(x: number, y: number, z: number, yaw: number, pitch: number): [number, number, number] { + const cy = Math.cos(yaw), sy = Math.sin(yaw), cp = Math.cos(pitch), sp = Math.sin(pitch); + const rx = cy * x + sy * z; + const rz = -sy * x + cy * z; + return [rx, cp * y - sp * rz, sp * y + cp * rz]; +} + const FACTS: Readonly FactRow[]>> = { project: projectFacts, + model: modelFacts, document: documentFacts, sequence: sequenceFacts, "resource:font": fontFacts, diff --git a/frontend/src/engine/store.ts b/frontend/src/engine/store.ts index c4efb19..1af5342 100644 --- a/frontend/src/engine/store.ts +++ b/frontend/src/engine/store.ts @@ -218,6 +218,7 @@ const LEGACY_SPECS: Record = { sequences: { rules: [{ field: "flag", value: "sequence" }] }, resources: { rules: [{ field: "flag", value: "resource" }] }, documents: { rules: [{ field: "flag", value: "document" }] }, + models: { rules: [{ field: "flag", value: "model" }] }, screenshots: { rules: [{ field: "flag", value: "screenshot" }] }, screenrecs: { rules: [{ field: "flag", value: "screen_recording" }] }, not_in_album: { rules: [{ field: "flag", value: "not_in_album" }] }, diff --git a/frontend/src/styles/assets.css b/frontend/src/styles/assets.css index 34821fc..b726937 100644 --- a/frontend/src/styles/assets.css +++ b/frontend/src/styles/assets.css @@ -33,6 +33,8 @@ .asset-doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); } .asset-excerpt { max-height: 56vh; overflow: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--text); padding: var(--space-2); border-radius: 8px; background: var(--glass-bg-2); } @media (max-width: 720px) { .asset-doc { grid-template-columns: 1fr; } } +.asset-model { display: flex; justify-content: center; } +.asset-turntable { width: 100%; max-height: 56vh; aspect-ratio: 3 / 2; border-radius: 10px; cursor: grab; touch-action: none; } .asset-lottie { width: 100%; height: 56vh; border-radius: 10px; background: var(--glass-bg-2); } @media (max-width: 560px) { .cue { grid-template-columns: 1fr; } diff --git a/frontend/src/ui/components/assetbodies.ts b/frontend/src/ui/components/assetbodies.ts index d377c52..e753a87 100644 --- a/frontend/src/ui/components/assetbodies.ts +++ b/frontend/src/ui/components/assetbodies.ts @@ -1,5 +1,5 @@ import { api, fileUrl, thumbUrl } from "../../engine/api.js"; -import { clockLabel, swatchesOf } from "../../engine/assetkinds.js"; +import { clockLabel, rotatePoint, swatchesOf } from "../../engine/assetkinds.js"; import type { Media } from "../../engine/types.js"; import { h } from "../dom.js"; import { assetBody } from "./assetview.js"; @@ -81,7 +81,81 @@ function excerptBody(item: Media): HTMLElement { return text ? h("div", { class: "asset-doc" }, preview, h("div", { class: "asset-excerpt" }, text)) : preview; } +interface ViewerMesh { positions: number[]; indices: number[]; points: boolean } + +function drawMesh(canvas: HTMLCanvasElement, mesh: ViewerMesh, yaw: number, pitch: number): void { + const ctx = canvas.getContext("2d"); + if (!ctx) return; + const w = canvas.width, hgt = canvas.height, scale = Math.min(w, hgt) * 0.8; + ctx.fillStyle = "#1e1c18"; + ctx.fillRect(0, 0, w, hgt); + const p = mesh.positions; + const proj: Array<[number, number, number]> = []; + for (let i = 0; i < p.length; i += 3) proj.push(rotatePoint(p[i], p[i + 1], p[i + 2], yaw, pitch)); + const sx = (v: [number, number, number]) => w / 2 + v[0] * scale; + const sy = (v: [number, number, number]) => hgt / 2 - v[1] * scale; + if (mesh.points || mesh.indices.length === 0) { + ctx.fillStyle = "#d6ccba"; + for (const v of proj) ctx.fillRect(sx(v), sy(v), 1.5, 1.5); + return; + } + const tris: Array<[number, number, number, number]> = []; + for (let i = 0; i + 2 < mesh.indices.length; i += 3) { + const a = mesh.indices[i], b = mesh.indices[i + 1], c = mesh.indices[i + 2]; + tris.push([a, b, c, (proj[a][2] + proj[b][2] + proj[c][2]) / 3]); + } + tris.sort((m, n) => m[3] - n[3]); + for (const [a, b, c] of tris) { + const A = proj[a], B = proj[b], C = proj[c]; + const ux = B[0] - A[0], uy = B[1] - A[1], uz = B[2] - A[2]; + const vx = C[0] - A[0], vy = C[1] - A[1], vz = C[2] - A[2]; + const nx = uy * vz - uz * vy, ny = uz * vx - ux * vz, nz = ux * vy - uy * vx; + const len = Math.hypot(nx, ny, nz) || 1; + const shade = 0.28 + 0.72 * Math.abs((nx * 0.35 + ny * 0.55 + nz * 0.76) / len); + ctx.fillStyle = `rgb(${Math.round(214 * shade)}, ${Math.round(204 * shade)}, ${Math.round(186 * shade)})`; + ctx.beginPath(); + ctx.moveTo(sx(A), sy(A)); + ctx.lineTo(sx(B), sy(B)); + ctx.lineTo(sx(C), sy(C)); + ctx.closePath(); + ctx.fill(); + } +} + +function modelBody(item: Media, signal: AbortSignal): HTMLElement { + const canvas = h("canvas", { class: "asset-turntable", width: "960", height: "640", "aria-label": "Turntable: drag to turn" }) as HTMLCanvasElement; + const still = h("img", { class: "asset-preview", alt: item.name, src: thumbUrl(item.id, 768), draggable: "false" }); + const box = h("div", { class: "asset-model" }, still); + let yaw = 0.62, pitch = 0.42, spinning = true, frame = 0; + void api(`/media/${item.id}/mesh`).then((mesh) => { + if (signal.aborted) return; + box.replaceChildren(canvas); + const tick = () => { + if (signal.aborted) return; + if (spinning) yaw += 0.01; + drawMesh(canvas, mesh, yaw, pitch); + frame = requestAnimationFrame(tick); + }; + tick(); + canvas.addEventListener("pointerdown", (event) => { + spinning = false; + const startX = event.clientX, startY = event.clientY, y0 = yaw, p0 = pitch; + canvas.setPointerCapture(event.pointerId); + const move = (ev: PointerEvent) => { + yaw = y0 + (ev.clientX - startX) / 150; + pitch = Math.max(-1.5, Math.min(1.5, p0 + (ev.clientY - startY) / 150)); + }; + canvas.addEventListener("pointermove", move, { signal }); + canvas.addEventListener("pointerup", () => canvas.removeEventListener("pointermove", move), { once: true, signal }); + }, { signal }); + canvas.addEventListener("dblclick", () => { spinning = !spinning; }, { signal }); + }).catch(() => undefined); + signal.addEventListener("abort", () => cancelAnimationFrame(frame)); + return box; +} + export function registerAssetBodies(): void { + assetBody("model", modelBody); assetBody("document:pdf", pdfBody); assetBody("document", excerptBody); assetBody("resource:font", fontBody); diff --git a/frontend/src/ui/components/library.ts b/frontend/src/ui/components/library.ts index b111d41..37cce72 100644 --- a/frontend/src/ui/components/library.ts +++ b/frontend/src/ui/components/library.ts @@ -19,6 +19,7 @@ const FILTER_LABELS: Record = { sequences: "Image Sequences", resources: "Design Resources", documents: "Documents", + models: "3D Models", screenshots: "Screenshots", screenrecs: "Screen Recordings", not_in_album: "Not in an Album", @@ -75,9 +76,9 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo const filterBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Filter" }, iconEl("sliders")); const menu = h("div", { class: "menu pop-surface hidden" }); const menuAnchor = h("div", { class: "menu-anchor" }, filterBtn, menu); - const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "sequences", "documents", "resources", "screenshots", "not_in_album"]; + const filterKeys: FilterName[] = ["all", "favorites", "photos", "videos", "audio", "projects", "sequences", "documents", "models", "resources", "screenshots", "not_in_album"]; const FILTER_ICONS: Partial> = { - all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", sequences: "frames", resources: "swatch", documents: "doc", + all: "library", favorites: "heart", photos: "image", videos: "video", audio: "audio", projects: "project", sequences: "frames", resources: "swatch", documents: "doc", models: "cube", screenshots: "screenshot", not_in_album: "albumOff", }; for (const key of filterKeys) { @@ -157,6 +158,7 @@ export function mountLibrary(host: HTMLElement, filter: FilterName, isLibraryRoo sequences: state.summary.sequences ?? 0, resources: state.summary.resources ?? 0, documents: state.summary.documents ?? 0, + models: state.summary.models ?? 0, screenshots: state.summary.screenshots, screenrecs: state.summary.screenrecs, recently_viewed: state.summary.recently_viewed, diff --git a/frontend/src/ui/components/organize.ts b/frontend/src/ui/components/organize.ts index 8efa22d..60c772d 100644 --- a/frontend/src/ui/components/organize.ts +++ b/frontend/src/ui/components/organize.ts @@ -339,7 +339,7 @@ const RULE_FIELDS: Array<[string, string]> = [ ["app", "Form app"], ["format", "File format"], ["pages", "Pages or frames"], ]; const FLAG_VALUES: Array<[string, string]> = [ - ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["sequence", "Image sequence"], ["camera_raw_video", "Camera raw video"], ["document", "Document"], ["resource", "Design resource"], ["font", "Font"], ["lut", "Colour LUT"], + ["favorite", "Favorite"], ["photo", "Photo"], ["video", "Video"], ["audio", "Audio"], ["project", "Form project"], ["sequence", "Image sequence"], ["camera_raw_video", "Camera raw video"], ["document", "Document"], ["model", "3D model"], ["resource", "Design resource"], ["font", "Font"], ["lut", "Colour LUT"], ["caption", "Captions"], ["palette", "Palette"], ["lottie", "Lottie animation"], ["raw", "RAW"], ["live", "Live Photo"], ["panorama", "Panorama"], ["selfie", "Selfie"], ["portrait", "Portrait"], ["slomo", "Slo-mo"], ["burst", "Burst"], ["screenshot", "Screenshot"], ["screen_recording", "Screen Recording"], ["edited", "Edited"], ["rejected", "Rejected"], diff --git a/frontend/src/ui/components/pages.ts b/frontend/src/ui/components/pages.ts index 478876d..9971f3c 100644 --- a/frontend/src/ui/components/pages.ts +++ b/frontend/src/ui/components/pages.ts @@ -72,7 +72,7 @@ interface MediaType { } const TYPE_ICONS: Record = { - video: "video", audio: "audio", project: "project", sequence: "frames", camera_raw_video: "video", document: "doc", font: "swatch", lut: "swatch", caption: "swatch", palette: "swatch", lottie: "swatch", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", + video: "video", audio: "audio", project: "project", sequence: "frames", camera_raw_video: "video", document: "doc", model: "cube", font: "swatch", lut: "swatch", caption: "swatch", palette: "swatch", lottie: "swatch", live: "play", selfie: "person", portrait: "camera", panorama: "fit", slomo: "clock", burst: "stack", raw: "file", screenshot: "screenshot", screen_recording: "stage", timelapse: "clock", cinematic: "video", spatial: "cube", long_exposure: "wave", animated: "play", }; diff --git a/frontend/src/ui/components/sidebar.ts b/frontend/src/ui/components/sidebar.ts index 632d9a3..3cd8473 100644 --- a/frontend/src/ui/components/sidebar.ts +++ b/frontend/src/ui/components/sidebar.ts @@ -22,6 +22,7 @@ const PINNED: RowSpec[] = [ { label: "Audio", icon: "audio", hash: "#/f/audio" }, { label: "Form Projects", icon: "project", hash: "#/f/projects" }, { label: "Documents", icon: "doc", hash: "#/f/documents" }, + { label: "3D Models", icon: "cube", hash: "#/f/models" }, { label: "Design Resources", icon: "swatch", hash: "#/f/resources" }, { label: "Screenshots", icon: "screenshot", hash: "#/f/screenshots" }, { label: "People", icon: "people", hash: "#/people" }, diff --git a/frontend/tests/assets.test.ts b/frontend/tests/assets.test.ts index 281558c..3075d1a 100644 --- a/frontend/tests/assets.test.ts +++ b/frontend/tests/assets.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { assetFacts, clockLabel, countLine, isFileKind, kindIcon, kindLabel, openLabel, swatchesOf } from "../src/engine/assetkinds"; +import { assetFacts, clockLabel, countLine, isFileKind, kindIcon, kindLabel, openLabel, rotatePoint, swatchesOf } from "../src/engine/assetkinds"; describe("Form project files", () => { it("names the app to open in, only for projects", () => { @@ -53,3 +53,15 @@ describe("documents", () => { expect(rows).toEqual([["Format", "Excel workbook"], ["Sheets", "2"], ["Sheet names", "Tides, Notes"]]); }); }); + +describe("3D models", () => { + it("states polygons, bounds and materials", () => { + const rows = assetFacts({ kind: "model", subkind: "glb", pages: null, asset: { format: "GLB", triangles: 12000, size: [2, 1, 0.25], units: "m", materials: ["Brass"] } }); + expect(rows).toEqual([["Format", "GLB"], ["Triangles", "12,000"], ["Bounding size", "2 x 1 x 0.25 m"], ["Materials", "Brass"]]); + }); + + it("turns points about the vertical axis", () => { + const [x, y, z] = rotatePoint(1, 0, 0, Math.PI / 2, 0); + expect(Math.abs(x) < 1e-9 && Math.abs(y) < 1e-9 && Math.abs(z + 1) < 1e-9).toBe(true); + }); +}); From c04be152456315bad1a594a4b164e623c4438b8a Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:32:37 -0500 Subject: [PATCH 16/35] fix: 3D readers stop at their caps and check glTF accessor bounds 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. --- backend/HASHOUT_LOG.md | 2 +- backend/app/routers/assets.py | 2 +- backend/app/services/modelres.py | 40 ++++++++++++++++++++++-------- backend/tests/test_models.py | 42 ++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 12 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 0bf105a..74cc539 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -41,7 +41,7 @@ GLB and glTF, FBX, OBJ, STL, PLY, USD, USDA, USDC and USDZ, Alembic, STEP and IG Read with geometry: STL (binary when 84 + 50 n bytes matches the file, else text), OBJ (v and f with fans for polygons, negative indices, usemtl names, o and g objects), PLY (text, or binary with fixed vertex properties and a face list), glTF 2.0 (GLB chunks or embedded data: buffers; a .gltf whose buffers are separate files gets its facts from the JSON, since the files do not travel with it; POSITION and index accessors with strides, triangle primitives only, node transforms not applied), and text USD (point3f[] points, faceVertexCounts and faceVertexIndices per mesh; a USDZ is opened for its first .usda). The facts are triangles, vertices, the bounding size along each axis (glTF in metres), meshes and material names. The preview is drawn by the engine: an orthographic view turned 35 degrees and tilted 24, flat shading from a fixed light, triangles sorted back to front, at most 40 000 sampled triangles. STEP gives its schema, face and solid counts, length unit and every CARTESIAN_POINT, and IGES its entity and surface counts and point entities (116): both are shown as point clouds, which give the shape and bounding size without a solid modeller. FBX (binary version or text), binary USD (crate) and Alembic (Ogawa or HDF5) are recognised and catalogued with their format and a drawn card. -The viewer's turntable is a canvas in the window, drawing up to 12 000 triangles (or the points) from /media/{id}/mesh, normalised to a unit box; it turns by itself until dragged, double-click toggles the spin. The mesh is cached beside the preview as {id}_mesh_v1.json, purged with the item's other caches; a protected model's mesh is read from the sealed bytes in memory and sent no-store. Files over 512 MiB are catalogued without a preview. +The viewer's turntable is a canvas in the window, drawing up to 12 000 triangles (or the points) from /media/{id}/mesh, normalised to a unit box; it turns by itself until dragged, double-click toggles the spin. The mesh is cached beside the preview as {id}_mesh_v1.json, purged with the item's other caches; a protected model's mesh is read from the sealed bytes in memory and sent no-store. Files over 512 MiB are catalogued without a preview, and a protected model's mesh is only built in a request when the file is at most 64 MiB. Parsing stops at its caps instead of building everything first: OBJ and USD at 2 million vertices or 4 million faces, STEP and IGES at 200 000 points, each raising so the item is catalogued with a note. A glTF accessor must have 1 to 5 million elements and a stride no smaller than its element, at most 252 and a multiple of 4 when it differs from the element size; strided data is read with one frombuffer and as_strided rather than a row at a time. ### services/docres.py · documents - refers-to: docres (new) pdf, render_page, page_count, docx, pptx, xlsx, sheet_cells, shared_strings, _events, _fit, _Zip.head, delimited, plain, rtf, rtf_text, idml, table_image, _Zip, _props, _thumbnail, extract; classify DOCUMENT_EXTS; assetkinds _load; routers/assets.py /media/{id}/page/{index}; db.media_dict ocr_text cut; query FLAGS document; mediaapi FILTERS documents; summary documents; browse MEDIA_TYPES; requirements pypdfium2; tests/test_documents.py diff --git a/backend/app/routers/assets.py b/backend/app/routers/assets.py index e13bb7e..ac220c9 100644 --- a/backend/app/routers/assets.py +++ b/backend/app/routers/assets.py @@ -188,7 +188,7 @@ def media_mesh(media_id: int, request: Request): raise HTTPException(415, detail="Only 3D models have a mesh") guarded = must_not_store(row) mesh = None if guarded else assetstore.load_json(media_id, "mesh") - if mesh is None and guarded: + if mesh is None and guarded and (row["size"] or 0) <= modelres.REQUEST_READ: mesh = modelres.mesh_from_bytes(_original_bytes(row), (row["subkind"] or "").lower()) if mesh is None: raise HTTPException(404, detail="No viewable mesh for this model") diff --git a/backend/app/services/modelres.py b/backend/app/services/modelres.py index 19ea731..832a920 100644 --- a/backend/app/services/modelres.py +++ b/backend/app/services/modelres.py @@ -6,6 +6,7 @@ import re import struct import zipfile +from itertools import islice from dataclasses import dataclass, field from typing import Any, Dict, List, Optional, Tuple @@ -21,6 +22,10 @@ RENDER_TRIS = 40_000 VIEWER_TRIS = 12_000 MAX_POINTS = 200_000 +MAX_VERTS = 2_000_000 +MAX_FACES = 4_000_000 +MAX_COUNT = 5_000_000 +REQUEST_READ = 64 * 1024 * 1024 BACKGROUND = (30, 28, 24) SURFACE = np.array([214, 204, 186], dtype=np.float32) LIGHT = np.array([0.35, 0.55, 0.76], dtype=np.float32) @@ -84,6 +89,8 @@ def read_obj(data: bytes) -> Mesh: parts = raw.split() if not parts: continue + if len(verts) > MAX_VERTS or len(faces) > MAX_FACES: + raise ModelError("This model has too many vertices or faces to preview") if parts[0] == "v" and len(parts) >= 4: verts.append((float(parts[1]), float(parts[2]), float(parts[3]))) elif parts[0] == "f" and len(parts) >= 4: @@ -203,15 +210,21 @@ def _accessor(doc: Dict[str, Any], index: int, binary: Optional[bytes]) -> np.nd data = _buffer(doc, view["buffer"], binary) width = WIDTHS[acc["type"]] dtype = np.dtype("<" + COMPONENTS[acc["componentType"]]) - offset = view.get("byteOffset", 0) + acc.get("byteOffset", 0) - stride = view.get("byteStride") or dtype.itemsize * width - count = acc["count"] - if offset + stride * (count - 1) + dtype.itemsize * width > len(data): + element = dtype.itemsize * width + offset = int(view.get("byteOffset", 0)) + int(acc.get("byteOffset", 0)) + stride = int(view.get("byteStride") or element) + count = int(acc["count"]) + if not 1 <= count <= MAX_COUNT: + raise ModelError("An accessor count is out of range") + if stride < element or stride > 252 or (stride != element and stride % 4): + raise ModelError("An accessor stride is invalid") + if offset < 0 or offset + stride * (count - 1) + element > len(data): raise ModelError("An accessor runs past its buffer") - if stride == dtype.itemsize * width: + if stride == element: return np.frombuffer(data, dtype=dtype, count=count * width, offset=offset).reshape(count, width) - rows = [np.frombuffer(data, dtype=dtype, count=width, offset=offset + i * stride) for i in range(count)] - return np.stack(rows) + raw = np.frombuffer(data, dtype=np.uint8, count=stride * (count - 1) + element, offset=offset) + rows = np.lib.stride_tricks.as_strided(raw, shape=(count, element), strides=(stride, 1)) + return np.ascontiguousarray(rows).view(dtype).reshape(count, width) def gltf_facts(doc: Dict[str, Any]) -> Dict[str, Any]: @@ -254,7 +267,9 @@ def read_gltf(data: bytes) -> Mesh: def _usda(text: str) -> Mesh: verts, faces, base = [], [], 0 for points, counts, indices in zip(USDA_POINTS.findall(text), USDA_COUNTS.findall(text), USDA_INDICES.findall(text)): - pts = [tuple(float(v) for v in t) for t in TUPLE.findall(points)] + pts = [tuple(float(v) for v in m.groups()) for m in islice(TUPLE.finditer(points), MAX_VERTS + 1)] + if len(pts) > MAX_VERTS or len(verts) + len(pts) > MAX_VERTS or len(faces) > MAX_FACES: + raise ModelError("This model has too many points to preview") sizes = [int(v) for v in re.findall(r"-?\d+", counts)] idx = [int(v) for v in re.findall(r"-?\d+", indices)] at = 0 @@ -288,7 +303,10 @@ def read_step(data: bytes) -> Mesh: if b"ISO-10303-21" not in data[:200]: raise ModelError("Not a STEP file") head = {key.decode(): value.decode("latin-1", "replace").strip()[:300] for key, value in STEP_HEADER.findall(data[:20000])} - points = np.array([[float(x), float(y), float(z)] for x, y, z in STEP_POINT.findall(data)[:MAX_POINTS]], dtype=np.float32) + found = [m.groups() for m in islice(STEP_POINT.finditer(data), MAX_POINTS + 1)] + if len(found) > MAX_POINTS: + raise ModelError("This STEP file has too many points to preview") + points = np.array([[float(x), float(y), float(z)] for x, y, z in found], dtype=np.float32) unit = STEP_UNIT.search(data) meta = {"format": "STEP", "schema": head.get("FILE_SCHEMA", "").strip("()' "), "faces": data.count(b"ADVANCED_FACE"), "solids": data.count(b"MANIFOLD_SOLID_BREP"), @@ -310,6 +328,8 @@ def read_iges(data: bytes) -> Mesh: continue points = [] for ln, sec in zip(lines, sections): + if len(points) > MAX_POINTS: + raise ModelError("This IGES file has too many points to preview") if sec == "P" and ln.startswith("116,"): bits = ln[:64].replace(";", ",").split(",") try: @@ -406,7 +426,7 @@ def viewer_mesh(mesh: Mesh) -> Dict[str, Any]: def mesh_from_bytes(data: bytes, ext: str) -> Optional[Dict[str, Any]]: reader = READERS.get(ext) - if reader is None or len(data) > MAX_READ: + if reader is None or len(data) > REQUEST_READ: return None try: mesh = reader(data, ext) diff --git a/backend/tests/test_models.py b/backend/tests/test_models.py index d1e7a56..89fec73 100644 --- a/backend/tests/test_models.py +++ b/backend/tests/test_models.py @@ -161,3 +161,45 @@ def test_bad_models_do_not_stop_the_worker(client, tmp_path): assert found["fine.obj"]["asset"]["triangles"] == 12 assert "note" in found["junk.glb"]["asset"] or "error" in found["junk.glb"]["asset"] assert found["junk.ply"]["preview_state"] == 1 + + +def test_model_readers_stop_at_their_caps(monkeypatch): + import time + + import pytest + + from app.services import modelres + + monkeypatch.setattr(modelres, "MAX_POINTS", 1000) + monkeypatch.setattr(modelres, "MAX_VERTS", 1000) + started = time.monotonic() + many_points = b"ISO-10303-21;\nDATA;\n" + b"#1=CARTESIAN_POINT('',(1.,2.,3.));\n" * 200000 + with pytest.raises(modelres.ModelError): + modelres.read_step(many_points) + with pytest.raises(modelres.ModelError): + modelres.read_obj(b"v 0 0 0\n" * 200000) + with pytest.raises(modelres.ModelError): + modelres.read_usd(("point3f[] points = [" + "(1, 2, 3), " * 200000 + "]\nint[] faceVertexCounts = [3]\nint[] faceVertexIndices = [0, 1, 2]").encode(), "usda") + assert time.monotonic() - started < 5 + assert modelres.mesh_from_bytes(b"\x00" * (modelres.REQUEST_READ + 1), "stl") is None + + +def test_gltf_accessor_bounds(): + import pytest + + from app.services import modelres + + doc, binary = gltf_doc() + assert modelres._accessor(doc, 0, binary).shape == (8, 3) + interleaved = np.concatenate([CUBE_V, np.zeros((8, 1), np.float32)], axis=1).astype(" Date: Sun, 29 Nov 2026 13:33:44 -0500 Subject: [PATCH 17/35] fix: parse XML through expat with DTDs refused and UTF-8 only 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. --- backend/HASHOUT_LOG.md | 7 +++ backend/app/services/docres.py | 27 +++++----- backend/app/services/imagex.py | 10 ++-- backend/app/services/safexml.py | 93 +++++++++++++++++++++++++++++++++ backend/tests/test_documents.py | 25 +++++++++ 5 files changed, 142 insertions(+), 20 deletions(-) create mode 100644 backend/app/services/safexml.py diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 74cc539..c722ad1 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -32,6 +32,13 @@ The EXR header reader took each attribute's size as a signed int and trusted it, Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the library without its location (export, packages, shares) now goes through filestrip, which works on an allowlist and refuses whatever it cannot check. An archive (any zip, including sequences, zip-based projects, dotLottie and form.ext packages) is rebuilt member by member, nested archives in memory up to three levels: EXR members have their latitude, longitude and altitude attributes renamed in place to x of the same length and their values zeroed (so the offset table still points at the right bytes) and are read back to confirm; DPX members have their user-defined data block (from byte 2048, the length at byte 32) zeroed, the only place the format leaves for such data; raster members (JPEG, PNG, TIFF, WebP) pass through gpsscrub and must then read as having no GPS; text members (JSON, XML, SVG, captions, LUTs and the like) pass through gpsscrub; and every member is searched for a GPS or GPSDest latitude or longitude with a value, as an attribute or an element, any spacing or quote style, any case, in the bytes and in a UTF-16 reading of them. Any other member type, an unreadable header or a value still present raises LocationRemains, which export and packages report as a refusal and shares as a skipped item. A single non-archive file is scrubbed and refused when GPS reads present, an XMP GPS value is found, or the row has a location and the file is not a raster formDAM can verify. +### services/safexml.py · XML is read only as UTF-8 and never with a DTD +- refers-to: safexml (new) check_prolog, events, check, Node, UnsafeXml; docres._events, _local, _Zip.read; imagex.sanitise_svg; tests/test_documents.py +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +A byte search for ]+>") W_TEXT = re.compile(r"]*)?>([^<]*)") A_TEXT = re.compile(r"]*)?>([^<]*)") @@ -55,10 +54,16 @@ def __init__(self, path: str): self.names = {info.filename: info for info in zipsafe.members(self.archive, self.budget)} def read(self, name: str) -> Optional[str]: + from . import safexml + info = self.names.get(name) if info is None: return None - return zipsafe.read_member(self.archive, info, self.budget).decode("utf-8", "replace") + try: + body = safexml.check_prolog(zipsafe.read_member(self.archive, info, self.budget)) + except safexml.UnsafeXml: + return "" + return body.decode("utf-8", "replace") def head(self, name: str, limit: int = PART_HEAD) -> bytes: info = self.names.get(name) @@ -146,21 +151,16 @@ def _column(letters: str) -> int: def _local(tag: str) -> str: - return tag.rsplit("}", 1)[-1] + return tag.rsplit(":", 1)[-1].rsplit("}", 1)[-1] def _events(data: bytes): - import xml.etree.ElementTree as ET + from . import safexml - if DTD.search(data): - return - parser = ET.XMLPullParser(events=("start", "end")) try: - parser.feed(data) - yield from parser.read_events() - parser.close() - except ET.ParseError: - yield from parser.read_events() + yield from safexml.events(data) + except safexml.UnsafeXml: + return def sheet_cells(data: bytes) -> List[Tuple[int, int, str, str]]: @@ -181,8 +181,6 @@ def sheet_cells(data: bytes) -> List[Tuple[int, int, str, str]]: if row >= TABLE_ROWS: break cells.append((row, _column(match.group(1)), kind, value if value or kind != "inlineStr" else "".join(inline))) - elif event == "end" and name == "row": - elem.clear() return cells @@ -198,7 +196,6 @@ def shared_strings(data: bytes, needed: Optional[set] = None) -> List[str]: parts.append(elem.text or "") elif event == "end" and name == "si": out.append("".join(parts)[:CELL_SHOWN * 5]) - elem.clear() if top is not None and len(out) > top: break return out diff --git a/backend/app/services/imagex.py b/backend/app/services/imagex.py index 5be7416..2a7813a 100644 --- a/backend/app/services/imagex.py +++ b/backend/app/services/imagex.py @@ -175,7 +175,6 @@ def number(raw: str) -> Optional[float]: return int(round(width)), int(round(height)) -SVG_DTD = re.compile(rb" bool: def sanitise_svg(data: bytes) -> Optional[bytes]: import xml.etree.ElementTree as ET - if SVG_DTD.search(data): - return None + from . import safexml + try: - root = ET.fromstring(data) - except ET.ParseError: + body = safexml.check(data) + root = ET.fromstring(body) + except (safexml.UnsafeXml, ET.ParseError): return None if _local_name(root.tag) != "svg": return None diff --git a/backend/app/services/safexml.py b/backend/app/services/safexml.py new file mode 100644 index 0000000..6a0c826 --- /dev/null +++ b/backend/app/services/safexml.py @@ -0,0 +1,93 @@ +import re +from dataclasses import dataclass, field +from typing import Dict, Iterator, List, Tuple +from xml.parsers import expat + +FOREIGN_BOMS = (b"\xff\xfe", b"\xfe\xff", b"\x00\x00\xfe\xff", b"\xff\xfe\x00\x00", b"\x2b\x2f\x76", b"\xf7\x64\x4c", b"\x0e\xfe\xff") +DECLARED = re.compile(rb"^\s*<\?xml[^>]*\bencoding\s*=\s*[\"']([^\"']+)[\"']", re.IGNORECASE) +UTF8_NAMES = {b"utf-8", b"utf8"} +CHUNK = 1 << 16 + + +class UnsafeXml(ValueError): + pass + + +@dataclass +class Node: + tag: str + attrs: Dict[str, str] = field(default_factory=dict) + text: str = "" + + def get(self, key: str, default=None): + return self.attrs.get(key, default) + + +def check_prolog(data: bytes) -> bytes: + body = data[3:] if data[:3] == b"\xef\xbb\xbf" else data + if body.startswith(FOREIGN_BOMS) or b"\x00" in body[:4]: + raise UnsafeXml("only UTF-8 XML is read") + declared = DECLARED.match(body[:200]) + if declared and declared.group(1).lower() not in UTF8_NAMES: + raise UnsafeXml("only UTF-8 XML is read") + return body + + +def _refuse(*_args) -> None: + raise UnsafeXml("XML with a document type or entity declaration is not read") + + +def _parser(events: List[Tuple[str, Node]]): + parser = expat.ParserCreate(encoding="utf-8") + stack: List[Node] = [] + parser.StartDoctypeDeclHandler = _refuse + parser.EntityDeclHandler = _refuse + parser.UnparsedEntityDeclHandler = _refuse + parser.ExternalEntityRefHandler = _refuse + parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_NEVER) + + def start(name: str, attrs: Dict[str, str]) -> None: + node = Node(name, dict(attrs)) + stack.append(node) + events.append(("start", node)) + + def end(name: str) -> None: + events.append(("end", stack.pop() if stack else Node(name))) + + def chars(text: str) -> None: + if stack: + stack[-1].text += text + + parser.StartElementHandler = start + parser.EndElementHandler = end + parser.CharacterDataHandler = chars + return parser + + +def events(data: bytes) -> Iterator[Tuple[str, Node]]: + body = check_prolog(data) + pending: List[Tuple[str, Node]] = [] + parser = _parser(pending) + for at in range(0, len(body), CHUNK): + try: + parser.Parse(body[at:at + CHUNK], False) + except expat.ExpatError: + yield from pending + return + yield from pending + pending.clear() + try: + parser.Parse(b"", True) + except expat.ExpatError: + pass + yield from pending + + +def check(data: bytes) -> bytes: + body = check_prolog(data) + parser = _parser([]) + try: + parser.Parse(body, True) + except expat.ExpatError as exc: + raise UnsafeXml(f"this XML is not well formed: {exc}") from exc + return body diff --git a/backend/tests/test_documents.py b/backend/tests/test_documents.py index 90f89ac..345912a 100644 --- a/backend/tests/test_documents.py +++ b/backend/tests/test_documents.py @@ -184,3 +184,28 @@ def test_huge_workbook_parts_preview_quickly(client, tmp_path): assert docres.shared_strings(shared.encode(), {3}) == ["string 0", "string 1", "string 2", "string 3"] bomb = b']>&a;' assert docres.shared_strings(bomb) == [] + + +def test_xml_with_other_encodings_or_dtds_is_not_read(tmp_path): + from app.services import docres, imagex, safexml + + entity = ']>&a;' + for data in (entity.encode("utf-16"), entity.encode("utf-16-le"), entity.replace("UTF-16", "UTF-8").encode()): + assert docres.shared_strings(data) == [] + latin = 'x'.encode("latin-1") + assert docres.shared_strings(latin) == [] + assert docres.shared_strings(b"\xef\xbb\xbfok") == ["ok"] + svg = ']>&x;' + for data in (svg.encode("utf-16"), svg.encode()): + assert imagex.sanitise_svg(data) is None + try: + safexml.check(''.encode("utf-16")) + raise AssertionError("UTF-16 XML was read") + except safexml.UnsafeXml: + pass + path = tmp_path / "wide.xlsx" + ooxml(path, {"xl/workbook.xml": '', + "xl/sharedStrings.xml": entity.encode("utf-16"), + "xl/worksheets/sheet1.xml": '0'}) + found = docres.xlsx(str(path), {"name": "wide.xlsx"}) + assert "boom" not in (found.text or "") From e58bd5026f00006371b6ba03de7a7054d22f2110 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:34:30 -0500 Subject: [PATCH 18/35] fix: 3D model totals are capped before they grow 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. --- backend/HASHOUT_LOG.md | 2 +- backend/app/services/modelres.py | 32 ++++++++++++++++++++++++++++---- backend/tests/test_models.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 5 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index c722ad1..3ad6107 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -48,7 +48,7 @@ GLB and glTF, FBX, OBJ, STL, PLY, USD, USDA, USDC and USDZ, Alembic, STEP and IG Read with geometry: STL (binary when 84 + 50 n bytes matches the file, else text), OBJ (v and f with fans for polygons, negative indices, usemtl names, o and g objects), PLY (text, or binary with fixed vertex properties and a face list), glTF 2.0 (GLB chunks or embedded data: buffers; a .gltf whose buffers are separate files gets its facts from the JSON, since the files do not travel with it; POSITION and index accessors with strides, triangle primitives only, node transforms not applied), and text USD (point3f[] points, faceVertexCounts and faceVertexIndices per mesh; a USDZ is opened for its first .usda). The facts are triangles, vertices, the bounding size along each axis (glTF in metres), meshes and material names. The preview is drawn by the engine: an orthographic view turned 35 degrees and tilted 24, flat shading from a fixed light, triangles sorted back to front, at most 40 000 sampled triangles. STEP gives its schema, face and solid counts, length unit and every CARTESIAN_POINT, and IGES its entity and surface counts and point entities (116): both are shown as point clouds, which give the shape and bounding size without a solid modeller. FBX (binary version or text), binary USD (crate) and Alembic (Ogawa or HDF5) are recognised and catalogued with their format and a drawn card. -The viewer's turntable is a canvas in the window, drawing up to 12 000 triangles (or the points) from /media/{id}/mesh, normalised to a unit box; it turns by itself until dragged, double-click toggles the spin. The mesh is cached beside the preview as {id}_mesh_v1.json, purged with the item's other caches; a protected model's mesh is read from the sealed bytes in memory and sent no-store. Files over 512 MiB are catalogued without a preview, and a protected model's mesh is only built in a request when the file is at most 64 MiB. Parsing stops at its caps instead of building everything first: OBJ and USD at 2 million vertices or 4 million faces, STEP and IGES at 200 000 points, each raising so the item is catalogued with a note. A glTF accessor must have 1 to 5 million elements and a stride no smaller than its element, at most 252 and a multiple of 4 when it differs from the element size; strided data is read with one frombuffer and as_strided rather than a row at a time. +The viewer's turntable is a canvas in the window, drawing up to 12 000 triangles (or the points) from /media/{id}/mesh, normalised to a unit box; it turns by itself until dragged, double-click toggles the spin. The mesh is cached beside the preview as {id}_mesh_v1.json, purged with the item's other caches; a protected model's mesh is read from the sealed bytes in memory and sent no-store. Files over 512 MiB are catalogued without a preview, and a protected model's mesh is only built in a request when the file is at most 64 MiB. Parsing stops at its caps instead of building everything first: OBJ and USD at 2 million vertices or 4 million faces, STEP and IGES at 200 000 points, each raising so the item is catalogued with a note. The totals are checked before anything grows: glTF keeps running vertex and index totals across primitives (from each accessor's count, before it is read) and allows at most 4096 meshes and 4096 primitives; an OBJ face line may have at most 4096 corners and is refused when its fan would pass the face cap; a USD polygon is checked the same way, and its count and index lists are read through islice so an oversized list stops at the cap. A glTF accessor must have 1 to 5 million elements and a stride no smaller than its element, at most 252 and a multiple of 4 when it differs from the element size; strided data is read with one frombuffer and as_strided rather than a row at a time. ### services/docres.py · documents - refers-to: docres (new) pdf, render_page, page_count, docx, pptx, xlsx, sheet_cells, shared_strings, _events, _fit, _Zip.head, delimited, plain, rtf, rtf_text, idml, table_image, _Zip, _props, _thumbnail, extract; classify DOCUMENT_EXTS; assetkinds _load; routers/assets.py /media/{id}/page/{index}; db.media_dict ocr_text cut; query FLAGS document; mediaapi FILTERS documents; summary documents; browse MEDIA_TYPES; requirements pypdfium2; tests/test_documents.py diff --git a/backend/app/services/modelres.py b/backend/app/services/modelres.py index 832a920..c7096ec 100644 --- a/backend/app/services/modelres.py +++ b/backend/app/services/modelres.py @@ -26,6 +26,9 @@ MAX_FACES = 4_000_000 MAX_COUNT = 5_000_000 REQUEST_READ = 64 * 1024 * 1024 +MAX_FACE_VERTS = 4096 +MAX_PRIMITIVES = 4096 +MAX_MESHES = 4096 BACKGROUND = (30, 28, 24) SURFACE = np.array([214, 204, 186], dtype=np.float32) LIGHT = np.array([0.35, 0.55, 0.76], dtype=np.float32) @@ -94,6 +97,8 @@ def read_obj(data: bytes) -> Mesh: if parts[0] == "v" and len(parts) >= 4: verts.append((float(parts[1]), float(parts[2]), float(parts[3]))) elif parts[0] == "f" and len(parts) >= 4: + if len(parts) - 1 > MAX_FACE_VERTS or len(faces) + len(parts) - 3 > MAX_FACES: + raise ModelError("This model has too many faces to preview") idx = [] for token in parts[1:]: n = int(token.split("/")[0]) @@ -248,14 +253,26 @@ def gltf_facts(doc: Dict[str, Any]) -> Dict[str, Any]: def read_gltf(data: bytes) -> Mesh: doc, binary = _gltf_parts(data) facts = {"format": "GLB" if data[:4] == GLB_MAGIC else "glTF", **gltf_facts(doc)} - verts, faces, base = [], [], 0 - for mesh in doc.get("meshes") or []: + verts, faces, base, indices, prims = [], [], 0, 0, 0 + meshes = doc.get("meshes") or [] + if len(meshes) > MAX_MESHES: + raise ModelError("This model has too many meshes to preview") + for mesh in meshes: for prim in mesh.get("primitives") or []: + prims += 1 + if prims > MAX_PRIMITIVES: + raise ModelError("This model has too many primitives to preview") if prim.get("mode", 4) != 4 or "POSITION" not in prim.get("attributes", {}): continue + accessors = doc.get("accessors") or [] + count = int(accessors[prim["attributes"]["POSITION"]].get("count", 0)) + index_count = int(accessors[prim["indices"]].get("count", 0)) if "indices" in prim else count + if base + count > MAX_VERTS or indices + index_count > MAX_FACES * 3: + raise ModelError("This model has too many vertices or faces to preview") pos = _accessor(doc, prim["attributes"]["POSITION"], binary).astype(np.float32) idx = (_accessor(doc, prim["indices"], binary).reshape(-1).astype(np.int64) if "indices" in prim else np.arange(len(pos), dtype=np.int64)) + indices += len(idx) verts.append(pos) faces.append(idx[: len(idx) - len(idx) % 3].reshape(-1, 3) + base) base += len(pos) @@ -270,10 +287,17 @@ def _usda(text: str) -> Mesh: pts = [tuple(float(v) for v in m.groups()) for m in islice(TUPLE.finditer(points), MAX_VERTS + 1)] if len(pts) > MAX_VERTS or len(verts) + len(pts) > MAX_VERTS or len(faces) > MAX_FACES: raise ModelError("This model has too many points to preview") - sizes = [int(v) for v in re.findall(r"-?\d+", counts)] - idx = [int(v) for v in re.findall(r"-?\d+", indices)] + sizes = [int(m.group(0)) for m in islice(re.finditer(r"-?\d+", counts), MAX_FACES + 1)] + idx = [int(m.group(0)) for m in islice(re.finditer(r"-?\d+", indices), MAX_FACES * 3 + 1)] + if len(sizes) > MAX_FACES or len(idx) > MAX_FACES * 3: + raise ModelError("This model has too many faces to preview") at = 0 for n in sizes: + if n < 3 or n > MAX_FACE_VERTS or len(faces) + n - 2 > MAX_FACES: + if n < 3: + at += max(n, 0) + continue + raise ModelError("This model has too many faces to preview") faces.extend(tuple(i + base for i in tri) for tri in _fan(idx[at:at + n])) at += n verts.extend(pts) diff --git a/backend/tests/test_models.py b/backend/tests/test_models.py index 89fec73..d4ec9e5 100644 --- a/backend/tests/test_models.py +++ b/backend/tests/test_models.py @@ -203,3 +203,32 @@ def test_gltf_accessor_bounds(): bad = {**doc, "accessors": [{**doc["accessors"][0], "count": count}, doc["accessors"][1]]} with pytest.raises(modelres.ModelError): modelres._accessor(bad, 0, binary) + + +def test_model_totals_are_capped_before_they_grow(monkeypatch): + import time + + import pytest + + from app.services import modelres + + started = time.monotonic() + doc, binary = gltf_doc() + many = {**doc, "meshes": [{"primitives": [{"attributes": {"POSITION": 0}, "indices": 1}]}] * (modelres.MAX_MESHES + 1)} + with pytest.raises(modelres.ModelError): + modelres.read_gltf(json.dumps({**many, "buffers": [{"byteLength": len(binary), "uri": "data:;base64," + base64.b64encode(binary).decode()}]}).encode()) + prims = {**doc, "meshes": [{"primitives": [{"attributes": {"POSITION": 0}, "indices": 1}] * (modelres.MAX_PRIMITIVES + 1)}]} + with pytest.raises(modelres.ModelError): + modelres.read_gltf(json.dumps({**prims, "buffers": [{"byteLength": len(binary), "uri": "data:;base64," + base64.b64encode(binary).decode()}]}).encode()) + monkeypatch.setattr(modelres, "MAX_VERTS", 20) + small = {**doc, "meshes": [{"primitives": [{"attributes": {"POSITION": 0}, "indices": 1}] * 3}], + "buffers": [{"byteLength": len(binary), "uri": "data:;base64," + base64.b64encode(binary).decode()}]} + with pytest.raises(modelres.ModelError): + modelres.read_gltf(json.dumps(small).encode()) + huge_face = b"v 0 0 0\nv 1 0 0\nv 0 1 0\nf " + b" ".join(b"1" for _ in range(500000)) + b"\n" + with pytest.raises(modelres.ModelError): + modelres.read_obj(huge_face) + usd = "point3f[] points = [(0, 0, 0), (1, 0, 0), (0, 1, 0)]\nint[] faceVertexCounts = [100000]\nint[] faceVertexIndices = [" + ", ".join("0" for _ in range(100000)) + "]" + with pytest.raises(modelres.ModelError): + modelres.read_usd(usd.encode(), "usda") + assert time.monotonic() - started < 5 From c745f860e53649da74c0f031a27dbbd29ed88c33 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:38:11 -0500 Subject: [PATCH 19/35] fix: XML text is gathered once per element and capped Expat buffers character data, each element joins its parts once at its end tag, and text past 8192 characters per element is dropped. --- backend/HASHOUT_LOG.md | 2 +- backend/app/services/safexml.py | 18 +++++++++++++++--- backend/tests/test_documents.py | 12 ++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 3ad6107..083f628 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -37,7 +37,7 @@ Sequences had scrubbed only PNG and TIFF frames. Every file kind that leaves the - kind: fix - logged: after v1.32.4 · 2026-11-29 -A byte search for ]*\bencoding\s*=\s*[\"']([^\"']+)[\"']", re.IGNORECASE) UTF8_NAMES = {b"utf-8", b"utf8"} CHUNK = 1 << 16 +TEXT_CAP = 8192 class UnsafeXml(ValueError): @@ -18,6 +19,8 @@ class Node: tag: str attrs: Dict[str, str] = field(default_factory=dict) text: str = "" + parts: List[str] = field(default_factory=list, repr=False) + kept: int = 0 def get(self, key: str, default=None): return self.attrs.get(key, default) @@ -39,6 +42,7 @@ def _refuse(*_args) -> None: def _parser(events: List[Tuple[str, Node]]): parser = expat.ParserCreate(encoding="utf-8") + parser.buffer_text = True stack: List[Node] = [] parser.StartDoctypeDeclHandler = _refuse parser.EntityDeclHandler = _refuse @@ -52,11 +56,19 @@ def start(name: str, attrs: Dict[str, str]) -> None: events.append(("start", node)) def end(name: str) -> None: - events.append(("end", stack.pop() if stack else Node(name))) + node = stack.pop() if stack else Node(name) + node.text = "".join(node.parts) + node.parts = [] + events.append(("end", node)) def chars(text: str) -> None: - if stack: - stack[-1].text += text + if not stack: + return + node = stack[-1] + room = TEXT_CAP - node.kept + if room > 0: + node.parts.append(text[:room]) + node.kept += min(len(text), room) parser.StartElementHandler = start parser.EndElementHandler = end diff --git a/backend/tests/test_documents.py b/backend/tests/test_documents.py index 345912a..7561501 100644 --- a/backend/tests/test_documents.py +++ b/backend/tests/test_documents.py @@ -209,3 +209,15 @@ def test_xml_with_other_encodings_or_dtds_is_not_read(tmp_path): "xl/worksheets/sheet1.xml": '0'}) found = docres.xlsx(str(path), {"name": "wide.xlsx"}) assert "boom" not in (found.text or "") + + +def test_xml_text_is_gathered_once_and_capped(): + import time + + from app.services import safexml + + body = b"" + b"a&" * 400000 + b"" + started = time.monotonic() + ends = [node for event, node in safexml.events(body) if event == "end" and node.tag == "t"] + assert time.monotonic() - started < 5 + assert len(ends) == 1 and len(ends[0].text) == safexml.TEXT_CAP and ends[0].text.startswith("a&a&") From 57cdbd5469a72792a7e9e72fb0de82968b9ed6b8 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 13:42:55 -0500 Subject: [PATCH 20/35] fix: photos, videos and audio import as previewed Only file kinds wait for the background worker, so the has_preview smart-album flag matches media items again. --- backend/HASHOUT_LOG.md | 2 +- backend/app/services/libraryfs.py | 1 + backend/tests/test_form_projects.py | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 083f628..90f7241 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -117,7 +117,7 @@ The preview and manifest convention, proposed for the family and read when prese Open in the app asks FormPortal first (formportal open-file PATH, the binary from FORMPORTAL_BIN, PATH or the macOS app bundle), which knows the installed channel; without it, macOS opens the app by its bundle identifier from the registry (open -b), and otherwise the operating system's handler for the extension. Protected items are refused as for Reveal and Open With. -The worker is one thread, started with the app and stopped at lifespan exit and before a library switch, as the vault sweep is. It handles the visible items whose preview_state is 0, newest import last, and never a hidden, trashed, private or vaulted one; an item becomes pending again when it is unhidden or when its preview has gone (ensure_thumb requeues it). Until the preview exists the grid gets a drawn card (extension and name) stored as {id}_card_{size}; the card is sealed as the item's placeholder poster (.p384) when it is the only thumb at protect time, so unhiding never restores it as a real thumb. +The worker is one thread, started with the app and stopped at lifespan exit and before a library switch, as the vault sweep is. It handles the visible items whose preview_state is 0, newest import last, and never a hidden, trashed, private or vaulted one; an item becomes pending again when it is unhidden or when its preview has gone (ensure_thumb requeues it). Photos, videos and audio are imported with preview_state 1 (their thumbs are made the usual way), so the has_preview flag matches them; only file kinds start at 0. Until the preview exists the grid gets a drawn card (extension and name) stored as {id}_card_{size}; the card is sealed as the item's placeholder poster (.p384) when it is the only thumb at protect time, so unhiding never restores it as a real thumb. Every generated file sits in the thumbs folder under the media id ({id}_preview_v1.webp and {id}__v1.json), so the vault's scrub of thumbs/{id}_* removes it on protect and delete. The settle step drops the plain previews and extras of a protected item as it does the waveform and listen copy, keeping only the large preview while the vault is about to seal, so the sealed poster is the real one; the protect step then scrubs it. Each writer re-reads the row after os.replace and deletes its file when the item became protected meanwhile (assetstore.keep_if_plain, which the waveform and listen writers now share). diff --git a/backend/app/services/libraryfs.py b/backend/app/services/libraryfs.py index ff4f11c..223aa50 100644 --- a/backend/app/services/libraryfs.py +++ b/backend/app/services/libraryfs.py @@ -129,6 +129,7 @@ def import_one(path: str, move: bool = False, reference: bool = False, ) if reference: ex("UPDATE media SET referenced=1 WHERE id=?", (media_id,)) + ex("UPDATE media SET preview_state=? WHERE id=?", (0 if classify.is_file_kind(kind) else 1, media_id)) if kind not in classify.VISUAL_KINDS or classify.is_camera_raw_video(name): ex("UPDATE media SET face_state=2, clip_state=2, ocr_text='' WHERE id=?", (media_id,)) if classify.is_camera_raw_video(name): diff --git a/backend/tests/test_form_projects.py b/backend/tests/test_form_projects.py index 2d5bc72..5c16c40 100644 --- a/backend/tests/test_form_projects.py +++ b/backend/tests/test_form_projects.py @@ -210,3 +210,20 @@ def test_export_and_share_projects_as_originals(client, tmp_path): shared = gallerysvc.download_path({"include_location": 0}, media_id) assert shared.endswith(".fcad") and zipfile.is_zipfile(shared) assert gallerysvc.download_path({"include_location": 1}, media_id).endswith("kit.fcad") + + +def test_media_kinds_count_as_previewed(client, tmp_path): + from tests.test_audio_import import write_wav + + src = tmp_path / "src" + os.makedirs(src) + Image.new("RGB", (20, 20), (9, 9, 9)).save(src / "photo.png") + write_wav(src / "take.wav") + zip_project(src / "plan.fcad", {"pages": 1}) + import_dir(client, src) + states = {i["name"]: i["preview_state"] for i in client.get("/api/media").json()["items"]} + assert states["photo.png"] == 1 and states["take.wav"] == 1 + settle(client) + spec = {"rules": [{"field": "flag", "value": "has_preview"}]} + names = {m["name"] for m in client.get("/api/browse", params={"spec": json.dumps(spec)}).json()["items"]} + assert names == {"photo.png", "take.wav", "plan.fcad"} From 1438904f1b6eb35b007d38fd6c43f5b8b186cd17 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 14:29:28 -0500 Subject: [PATCH 21/35] feat: PDFs leave without location as a checked clean copy 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. --- LICENSES.md | 1 + backend/HASHOUT_LOG.md | 9 + backend/app/services/filestrip.py | 10 +- backend/app/services/pdfstrip.py | 249 ++++++++++++++++++++++++++++ backend/requirements.txt | 1 + backend/requirements_macos.txt | 1 + backend/tests/test_formats_extra.py | 90 +++++++--- 7 files changed, 337 insertions(+), 24 deletions(-) create mode 100644 backend/app/services/pdfstrip.py diff --git a/LICENSES.md b/LICENSES.md index ac724f2..d68660f 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -49,6 +49,7 @@ Adobe, Bridge, Lightroom and Photoshop are either registered trademarks or trade | fonttools 4.69.1 | MIT | font names, glyph counts, outlines and variable axes for the font resource facts (services/fontres.py), and WOFF and WOFF2 unpacking before a font is checked for location (services/filestrip.py) | | brotli 1.2.1 | MIT | WOFF2 decompression under fontTools | | pypdfium2 5.15.2 | Apache-2.0 OR BSD-3-Clause (bindings); the bundled PDFium build BSD-3-Clause with its third-party parts (FreeType, libjpeg-turbo, OpenJPEG, Little CMS, zlib, ICU, Abseil and the like) under permissive licences listed in the wheel's LICENSES folder | PDF page count, text for search, first-page thumbnail and page images (services/docres.py). One shared library in the wheel, used under a process-wide lock because PDFium is not thread-safe | +| pypdf 7.2.0 | BSD-3-Clause | pure Python, no compiled parts. Writes the location-free copy of a PDF that leaves the library without its location (services/pdfstrip.py): document information and XMP metadata dropped, embedded JPEGs stripped of their EXIF and XMP segments, and the written copy read back and checked before it is used | | pyzipper 0.4.0 | MIT | AES-256 (WinZip AE-2) zip writing and reading for encrypted share packages, services/packagesvc.py | | pycryptodomex (pyzipper dependency) | BSD-2-Clause and public domain | AES and HMAC under pyzipper | | LaMa inpainting (opencv/inpainting_lama, inpainting_lama_2025jan.onnx, revision aee6d22) | Apache-2.0 | Clean Up object removal in services/cleanup.py; fetched by the installers & build script, sha256-pinned, into backend/models; bundled via --add-data like the other models. Without it Clean Up falls back to OpenCV Telea | diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 90f7241..9e53739 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,14 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/pdfstrip.py, filestrip.py · PDFs leave as a checked clean copy +- refers-to: pdfstrip (new) clean_pdf, strip_jpeg, verify, DECODE_CAP, MAX_OBJECTS; filestrip clean_member PDF branch, strip_file verified; requirements.txt and requirements_macos.txt pypdf 7.2.0; tests/test_formats_extra.py located_pdf and the three PDF tests +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +A PDF that leaves the library without its location (export, packages, shares) is rewritten with pypdf instead of refused. The file is opened leniently; an encrypted one is refused, since its streams cannot be read without the password. The whole document is cloned, the document information dictionary is dropped (pypdf writes no /Info, so no Producer either), every /Metadata and /PieceInfo key is removed from every dictionary (catalog, pages, image XObjects, fonts), and objects nothing refers to any more, the old XMP streams among them, are left out of the written file. Earlier incremental revisions do not survive, because the copy is written fresh. Image XObjects whose only filter is DCTDecode keep their JPEG bytes up to the end of the first image with every APPn segment except APP0 (JFIF), APP14 (Adobe, needed for CMYK colour) and an APP2 ICC profile removed, and comments removed; this is lossless, so no image is re-encoded. Embedded files go through clean_member, named by their magic bytes, one level deeper, so an attached photo is scrubbed and an attached file of a kind formDAM cannot check refuses the whole PDF. + +The written copy is then read back and every object listed in its cross-reference table is checked, reachable or not: no /Metadata key or XMP stream anywhere, no dictionary key naming GPS, a latitude, a longitude, a location or geo data, no string or decoded stream with a GPS value in it, every DCTDecode image reading as having no GPS and with nothing left to strip, JPEG 2000 bytes searched for a GPS value, and any image filter chained with another refused. Anything pypdf cannot decode, or any failure at all, refuses the file. Bounds: the input is held to the per-member cap (512 MiB), the check stops past 256 MiB of stream data and 200,000 objects, pypdf's own per-stream decode limits (75 MB) apply, and nested PDFs stop at the archive depth limit. Because the copy is verified, a PDF row with a location may leave without it, where other non-raster kinds are still refused. + ### services/classify.py, audiometa.py, waveform.py, trimsvc.py, routers/audio.py · audio is a third kind - refers-to: classify.AUDIO_EXTS, AUDIO_ONLY_MIMES, is_timed, audio_only_mime; mediainfo.probe, picture_stream, sound_only, audio_meta; audiometa (new); waveform (new); trimsvc (new); routers/audio.py (new) /media/{id}/waveform and /media/{id}/listen; db.py migration 12 (AUDIO_COLUMNS, idx_media_kind); libraryfs.import_one; metasvc.read, _apply_audio; thumbs.cover_art, audio_still, _save_webp; query SORTS duration, FLAGS audio, cover_art, lossless, TEXT_FIELDS, NUM_FIELDS, the audio text scope; browse MEDIA_TYPES; mediaapi FILTERS audio and the tags search field; system summary audio; importer UPLOAD_EXTS and _poster; edit.py trim and trim/export (normalise); gallerysvc, packagesvc strip_timed, outputsvc _copy_stripped; vaultcrypt._scrub listen, _scrub_vaulted listen, _drop_plain_audio in _settle; audiometa.location_of; guard._any_token /listen; tests/test_audio_import.py, tests/test_audio_organise.py - kind: feature diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index e195f9c..e2edc55 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -141,7 +141,9 @@ def clean_member(name: str, data: bytes, depth: int = 0, budget: Optional[zipsaf raise LocationRemains(f"{name} still carries a location") return clean if ext == ".pdf" or data[:5] == b"%PDF-": - raise LocationRemains(f"{name}: formDAM cannot remove location data from a PDF, so it leaves only with its location kept") + from . import pdfstrip + + return pdfstrip.clean_pdf(name, data, depth) if ext in FONT_MEMBERS: if text_located(_font_tables(data)): raise LocationRemains(f"{name} still carries a location") @@ -221,10 +223,12 @@ def strip_file(row, src: Source, dest: str) -> None: with open(dest, "wb") as handle: handle.write(clean) found = gpsscrub.has_gps(dest) - raster = os.path.splitext(name)[1].lower() in RASTER_MEMBERS + ext = os.path.splitext(name)[1].lower() + raster = ext in RASTER_MEMBERS + verified = clean[:5] == b"%PDF-" and ext not in TEXT_MEMBERS if found is True: raise LocationRemains("location could not be removed from this file") - if row["lat"] is not None and not (raster and found is False and raster_located(clean) is False): + if row["lat"] is not None and not verified and not (raster and found is False and raster_located(clean) is False): raise LocationRemains("this item has a location and the file cannot be shown to be free of it") except (LocationRemains, zipfile.BadZipFile, OSError): if os.path.exists(dest): diff --git a/backend/app/services/pdfstrip.py b/backend/app/services/pdfstrip.py new file mode 100644 index 0000000..74181c8 --- /dev/null +++ b/backend/app/services/pdfstrip.py @@ -0,0 +1,249 @@ +import io +import logging +import struct +from typing import Any, Iterator, List + +from . import filestrip, zipsafe + +logger = logging.getLogger(__name__) + +DECODE_CAP = 256 * 1024 * 1024 +MAX_OBJECTS = 200_000 +DROPPED_KEYS = ("/Metadata", "/PieceInfo") +LOCATION_WORDS = ("gps", "latitude", "longitude", "location", "geo") +BILEVEL = {"/JBIG2Decode", "/CCITTFaxDecode"} +JPEG_KEEP = {0xE0, 0xEE} +JPEG_ICC = b"ICC_PROFILE\x00" +SNIFFED = ((b"\xff\xd8", ".jpg"), (b"\x89PNG", ".png"), (b"II*\x00", ".tif"), (b"MM\x00*", ".tif"), (b"%PDF-", ".pdf")) + + +class _Budget: + def __init__(self) -> None: + self.left = DECODE_CAP + + def take(self, size: int) -> None: + self.left -= size + if self.left < 0: + raise filestrip.LocationRemains("a PDF expands past the size limit") + + +def clean_pdf(name: str, data: bytes, depth: int = 0) -> bytes: + if len(data) > zipsafe.MEMBER_CAP: + raise filestrip.LocationRemains(f"{name} is too large to check") + if depth >= zipsafe.MAX_DEPTH: + raise filestrip.LocationRemains(f"{name} nests files too deeply to check") + try: + clean = _rewrite(_open(data), depth) + verify(clean) + except filestrip.LocationRemains as exc: + raise filestrip.LocationRemains(f"{name}: {exc}") from exc + except Exception as exc: + logger.info("pdf clean failed: %s", exc) + raise filestrip.LocationRemains(f"{name}: this PDF could not be rewritten without its location") from exc + return clean + + +def _open(data: bytes) -> Any: + from pypdf import PdfReader + + try: + reader = PdfReader(io.BytesIO(data), strict=False) + encrypted = reader.is_encrypted + except Exception as exc: + raise filestrip.LocationRemains("this PDF could not be read") from exc + if encrypted: + raise filestrip.LocationRemains("an encrypted PDF cannot be checked for a location") + return reader + + +def _rewrite(reader: Any, depth: int) -> bytes: + from pypdf import PdfWriter + + writer = PdfWriter(clone_from=reader) + writer.metadata = None + if len(writer._objects) > MAX_OBJECTS: + raise filestrip.LocationRemains("this PDF holds too many objects to check") + for obj in writer._objects: + if obj is not None: + _scrub(obj.get_object(), depth) + writer.compress_identical_objects(remove_duplicates=False, remove_unreferenced=True) + out = io.BytesIO() + writer.write(out) + return out.getvalue() + + +def _scrub(obj: Any, depth: int) -> None: + from pypdf.generic import ArrayObject, DictionaryObject, StreamObject + + if isinstance(obj, DictionaryObject): + for key in DROPPED_KEYS: + if key in obj: + del obj[key] + for value in obj.values(): + if not _is_ref(value): + _scrub(value, depth) + elif isinstance(obj, ArrayObject): + for value in obj: + if not _is_ref(value): + _scrub(value, depth) + if isinstance(obj, StreamObject): + _scrub_stream(obj, depth) + + +def _is_ref(value: Any) -> bool: + from pypdf.generic import IndirectObject + + return isinstance(value, IndirectObject) + + +def _filters(obj: Any) -> List[str]: + found = obj.get("/Filter") + if found is None: + return [] + found = found.get_object() + if isinstance(found, list): + return [str(item.get_object()) for item in found] + return [str(found)] + + +def _scrub_stream(obj: Any, depth: int) -> None: + filters = _filters(obj) + if filters == ["/DCTDecode"]: + obj._data = strip_jpeg(obj._data) + elif obj.get("/Type") == "/EmbeddedFile": + _scrub_attachment(obj, depth) + + +def _scrub_attachment(obj: Any, depth: int) -> None: + data = obj.get_data() + clean = filestrip.clean_member(_sniffed_name(data), data, depth + 1) if data else data + for key in ("/Filter", "/DecodeParms", "/Params"): + if key in obj: + del obj[key] + obj._data = clean + + +def _sniffed_name(data: bytes) -> str: + for magic, ext in SNIFFED: + if data.startswith(magic): + return f"attachment{ext}" + return "attachment" + + +def strip_jpeg(data: bytes) -> bytes: + if data[:2] != b"\xff\xd8": + raise filestrip.LocationRemains("an embedded JPEG could not be read") + parts = [b"\xff\xd8"] + pos = 2 + while pos + 4 <= len(data): + if data[pos] != 0xFF: + raise filestrip.LocationRemains("an embedded JPEG could not be read") + marker = data[pos + 1] + if marker == 0xFF: + pos += 1 + continue + length = struct.unpack_from(">H", data, pos + 2)[0] + end = pos + 2 + length + if length < 2 or end > len(data): + raise filestrip.LocationRemains("an embedded JPEG could not be read") + if marker == 0xDA: + parts.append(_first_image(data, pos)) + return b"".join(parts) + if not _dropped_segment(marker, data[pos + 4:end]): + parts.append(data[pos:end]) + pos = end + raise filestrip.LocationRemains("an embedded JPEG ends early") + + +def _dropped_segment(marker: int, body: bytes) -> bool: + if marker == 0xFE: + return True + if 0xE0 <= marker <= 0xEF: + return marker not in JPEG_KEEP and not (marker == 0xE2 and body.startswith(JPEG_ICC)) + return False + + +def _first_image(data: bytes, start: int) -> bytes: + end = data.find(b"\xff\xd9", start) + if end < 0: + raise filestrip.LocationRemains("an embedded JPEG ends early") + return data[start:end + 2] + + +def verify(data: bytes) -> None: + from pypdf import PdfReader + + reader = PdfReader(io.BytesIO(data), strict=False) + if reader.is_encrypted: + raise filestrip.LocationRemains("the clean copy could not be checked") + if "/Info" in reader.trailer: + _check_info(reader.trailer["/Info"].get_object()) + if "/Metadata" in reader.trailer["/Root"]: + raise filestrip.LocationRemains("the clean copy still carries XMP metadata") + budget = _Budget() + for obj in _all_objects(reader): + _check(obj, budget) + + +def _check_info(info: Any) -> None: + for key, value in info.items(): + if any(word in str(key).lower() for word in LOCATION_WORDS): + raise filestrip.LocationRemains("the clean copy still names a location") + if filestrip.text_located(str(value.get_object()).encode("utf-8", "ignore")): + raise filestrip.LocationRemains("the clean copy still names a location") + + +def _all_objects(reader: Any) -> Iterator[Any]: + from pypdf.generic import IndirectObject + + seen = 0 + numbers = {(num, gen) for gen, table in reader.xref.items() for num in table} + numbers.update((num, 0) for num in reader.xref_objStm) + for num, gen in sorted(numbers): + seen += 1 + if seen > MAX_OBJECTS: + raise filestrip.LocationRemains("the clean copy holds too many objects to check") + yield IndirectObject(num, gen, reader).get_object() + + +def _check(obj: Any, budget: _Budget) -> None: + from pypdf.generic import ArrayObject, DictionaryObject, StreamObject + + if isinstance(obj, DictionaryObject): + for key, value in obj.items(): + if key == "/Metadata" or any(word in str(key).lower() for word in LOCATION_WORDS): + raise filestrip.LocationRemains("the clean copy still carries metadata") + if not _is_ref(value): + _check(value, budget) + elif isinstance(obj, ArrayObject): + for value in obj: + if not _is_ref(value): + _check(value, budget) + elif isinstance(obj, (str, bytes)): + raw = obj if isinstance(obj, bytes) else obj.encode("utf-8", "ignore") + if filestrip.text_located(raw): + raise filestrip.LocationRemains("the clean copy still names a location") + if isinstance(obj, StreamObject): + _check_stream(obj, budget) + + +def _check_stream(obj: Any, budget: _Budget) -> None: + filters = _filters(obj) + raw = obj._data + budget.take(len(raw)) + if obj.get("/Type") == "/Metadata" or obj.get("/Subtype") == "/XML": + raise filestrip.LocationRemains("the clean copy still carries an XMP stream") + if filters and filters[-1] in BILEVEL | {"/DCTDecode", "/JPXDecode"}: + if len(filters) > 1: + raise filestrip.LocationRemains("an image in the clean copy is encoded in a way formDAM cannot check") + if filters == ["/DCTDecode"] and (filestrip.raster_located(raw) is not False or strip_jpeg(raw) != raw): + raise filestrip.LocationRemains("an embedded JPEG still carries metadata") + if filters == ["/JPXDecode"] and filestrip.text_located(raw): + raise filestrip.LocationRemains("an embedded image still names a location") + return + plain = obj.get_data() + budget.take(len(plain)) + if filestrip.text_located(plain): + raise filestrip.LocationRemains("the clean copy still names a location") + if plain[:2] == b"\xff\xd8" and filestrip.raster_located(plain) is not False: + raise filestrip.LocationRemains("an embedded JPEG still carries a location") diff --git a/backend/requirements.txt b/backend/requirements.txt index 1e95618..f4f714e 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -14,3 +14,4 @@ resvg_py==0.5.0 fonttools==4.69.1 brotli==1.2.1 pypdfium2==5.15.2 +pypdf==7.2.0 diff --git a/backend/requirements_macos.txt b/backend/requirements_macos.txt index bc9d29a..a1adc95 100644 --- a/backend/requirements_macos.txt +++ b/backend/requirements_macos.txt @@ -17,3 +17,4 @@ resvg_py==0.5.0 fonttools==4.69.1 brotli==1.2.1 pypdfium2==5.15.2 +pypdf==7.2.0 diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index d1162ce..57f04bf 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -351,33 +351,81 @@ def test_file_kinds_fail_closed_on_location(tmp_path): assert filestrip.clean_member("p.fdec", b'{"manifest": {"title": "x"}}').startswith(b"{") -def pdf_bytes(xmp: bytes) -> bytes: - import zlib +def located_pdf(tmp_path, encrypt=False): + from pypdf import PdfWriter + from pypdf.generic import ArrayObject, DecodedStreamObject, DictionaryObject, NameObject, NumberObject, StreamObject + + jpeg = located_jpeg(tmp_path / "inside.jpg").read_bytes() + writer = PdfWriter() + page = writer.add_blank_page(200, 200) + xmp = DecodedStreamObject() + xmp.set_data(b'') + xmp.update({NameObject("/Type"): NameObject("/Metadata"), NameObject("/Subtype"): NameObject("/XML")}) + xmp_ref = writer._add_object(xmp) + image = StreamObject() + image._data = jpeg + image.update({NameObject("/Type"): NameObject("/XObject"), NameObject("/Subtype"): NameObject("/Image"), + NameObject("/Width"): NumberObject(32), NameObject("/Height"): NumberObject(32), + NameObject("/ColorSpace"): NameObject("/DeviceRGB"), NameObject("/BitsPerComponent"): NumberObject(8), + NameObject("/Filter"): NameObject("/DCTDecode"), NameObject("/Metadata"): xmp_ref}) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/XObject"): DictionaryObject({NameObject("/Im0"): writer._add_object(image)})}) + content = DecodedStreamObject() + content.set_data(b"q 200 0 0 200 0 0 cm /Im0 Do Q") + page[NameObject("/Contents")] = writer._add_object(content) + page[NameObject("/Annots")] = ArrayObject() + writer.root_object[NameObject("/Metadata")] = xmp_ref + writer.add_metadata({"/Title": "Harbour", "/GPSLatitude": "51.5"}) + if encrypt: + writer.encrypt("secret") + out = io.BytesIO() + writer.write(out) + return out.getvalue() + + +def test_pdf_clean_copy_drops_xmp_info_and_embedded_jpeg_location(tmp_path): + from pypdf import PdfReader + + from app.services import filestrip + + data = located_pdf(tmp_path) + assert b"GPSLatitude" in data and b"Exif" in data + dest = tmp_path / "clean.pdf" + filestrip.strip_file({"kind": "document", "lat": 51.5, "name": "plan.pdf"}, data, str(dest)) + clean = dest.read_bytes() + assert b"GPS" not in clean and b"Exif" not in clean + reader = PdfReader(io.BytesIO(clean)) + assert len(reader.pages) == 1 and "/Metadata" not in reader.trailer["/Root"] and not reader.metadata + image = reader.pages[0]["/Resources"]["/XObject"]["/Im0"].get_object() + assert "/Metadata" not in image and filestrip.raster_located(image._data) is False + assert Image.open(io.BytesIO(image._data)).size == (32, 32) - packed = zlib.compress(xmp) - return (b"%PDF-1.7\n1 0 obj << /Type /Metadata /Filter /FlateDecode /Length " + str(len(packed)).encode() - + b" >>\nstream\n" + packed + b"\nendstream\nendobj\ntrailer << >>\n%%EOF\n") +def test_plain_pdfs_come_out_whole_and_broken_ones_are_refused(tmp_path): + from pypdf import PdfReader -def test_pdfs_never_leave_with_location_stripped(tmp_path): from app.services import filestrip + from tests.test_documents import pdf_with_text + + plain = pdf_with_text(tmp_path / "plan.pdf", ["Harbour wall", "Second page"]).read_bytes() + clean = filestrip.clean_member("plan.pdf", plain) + reader = PdfReader(io.BytesIO(clean)) + assert [page.extract_text() for page in reader.pages] == ["Harbour wall", "Second page"] + titled = plain.replace(b"/Title (Harbour Plan)", b"/Title (exif:GPSLatitude=\"51,3N\")") + assert b"GPSLatitude" not in filestrip.clean_member("plan.pdf", titled) + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("plan.pdf", b"%PDF-1.4\nnot a pdf at all") - plain = b"%PDF-1.4\n1 0 obj << /Length 5 >>\nstream\nhello\nendstream\nendobj\n%%EOF\n" - variants = ( - plain, - plain.replace(b"/Length 5", b"/Filter /Flate#44ecode /Length 5"), - plain.replace(b"/Length 5", b"/Filter 2 0 R /Length 5"), - plain.replace(b"%%EOF", b"trailer<>\n%%EOF"), - pdf_bytes(b""), - ) - for data in variants: - with pytest.raises(filestrip.LocationRemains): - filestrip.clean_member("a.pdf", data) + +def test_encrypted_pdfs_are_refused(tmp_path): + from app.services import filestrip + + data = located_pdf(tmp_path, encrypt=True) + dest = tmp_path / "locked.pdf" + for lat in (None, 51.5): with pytest.raises(filestrip.LocationRemains): - filestrip.strip_file({"kind": "document", "lat": None, "name": "a.pdf"}, data, str(tmp_path / "a.pdf")) - assert not os.path.exists(tmp_path / "a.pdf") - with pytest.raises(filestrip.LocationRemains): - filestrip.clean_member("inside.bin", plain) + filestrip.strip_file({"kind": "document", "lat": lat, "name": "locked.pdf"}, data, str(dest)) + assert not dest.exists() + def test_share_refusal_is_remembered(client, tmp_path, monkeypatch): from app.services import filestrip, gallerysvc From 913a225203d4e74f60379c5750e2eb3c595f9f08 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 14:35:15 -0500 Subject: [PATCH 22/35] fix: PDF clean copies drop attachments and late JPEG segments 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. --- backend/HASHOUT_LOG.md | 13 ++ backend/app/services/filestrip.py | 10 +- backend/app/services/pdfimages.py | 154 ++++++++++++++++++++ backend/app/services/pdfstrip.py | 211 +++++++++++++--------------- backend/tests/test_formats_extra.py | 94 +++++++++++++ 5 files changed, 370 insertions(+), 112 deletions(-) create mode 100644 backend/app/services/pdfimages.py diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 9e53739..c02b179 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,18 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/pdfstrip.py, pdfimages.py · PDF clean copies: attachments, late JPEG segments, JPEG 2000, coverage +- refers-to: pdfstrip DROPPED_KEYS (/AF, /EF, /EmbeddedFiles), _drop_attachment_notes, verify (returns coverage), fully_checked, _known_streams, _check_stream container magic, _check_coded_image; pdfimages (new) strip_jpeg, jpx_clean, codestream_clean, ImageUnchecked; filestrip strip_file _pdf_covered; tests/test_formats_extra.py attachments, late JPEG segments, JPEG 2000 +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +Review of the first PDF clean copy found four gaps. Attachments had been found by /Type /EmbeddedFile, which is optional; the clean copy now has no attachments at all: the /EmbeddedFiles name tree, every /EF and /AF entry and every FileAttachment annotation are removed, and the check refuses any that remain. Every other stream that is not a coded image is decoded and refused when it starts like a JPEG, PNG, TIFF, ZIP, PDF, RIFF, GIF, JPEG 2000 or ISO-BMFF file, so a file smuggled under an unknown key cannot pass as content. + +JPEG segments were dropped only before the first scan. strip_jpeg (now in pdfimages) walks the whole marker stream, entropy-coded data included (stuffed bytes and restart markers skipped), drops every APPn and COM segment after the first scan, and stops at the first EOI, so data after it is gone; a stream that ends early is refused. + +JPEG 2000 bytes had only been searched as text. A JPX image now passes only as a raw codestream or a JP2 file whose top-level boxes are signature, ftyp, rreq, jp2h and jp2c (no uuid, xml, Exif or other boxes), whose codestream main and tile-part headers parse to the end, and whose bytes carry no GPS value. Codestream comments stay allowed (OpenJPEG writes one into every file it makes) and are covered by the text search. + +verify now reports whether it understood every stream: page content and form streams, embedded fonts and ToUnicode maps, patterns, shadings, CMaps, ICC profiles, and images that are not JPEG 2000. strip_file lets a PDF row with a stored location leave without it only when the copy is fully understood; otherwise (a JPEG 2000 image, an unknown stream) such a row is still refused, while a row without a location may leave. + ### services/pdfstrip.py, filestrip.py · PDFs leave as a checked clean copy - refers-to: pdfstrip (new) clean_pdf, strip_jpeg, verify, DECODE_CAP, MAX_OBJECTS; filestrip clean_member PDF branch, strip_file verified; requirements.txt and requirements_macos.txt pypdf 7.2.0; tests/test_formats_extra.py located_pdf and the three PDF tests - kind: fix diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index e2edc55..162eeb5 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -143,7 +143,7 @@ def clean_member(name: str, data: bytes, depth: int = 0, budget: Optional[zipsaf if ext == ".pdf" or data[:5] == b"%PDF-": from . import pdfstrip - return pdfstrip.clean_pdf(name, data, depth) + return pdfstrip.clean_pdf(name, data) if ext in FONT_MEMBERS: if text_located(_font_tables(data)): raise LocationRemains(f"{name} still carries a location") @@ -202,6 +202,12 @@ def strip_zip(src: Source, dest: str) -> None: _strip_archive(source, dest, 0, zipsafe.Budget(total_cap=max(zipsafe.TOTAL_CAP, outer * 4))) +def _pdf_covered(clean: bytes) -> bool: + from . import pdfstrip + + return pdfstrip.fully_checked(clean) + + def _is_zip(src: Source) -> bool: if isinstance(src, (bytes, bytearray)): return bytes(src[:4]) == b"PK\x03\x04" @@ -225,7 +231,7 @@ def strip_file(row, src: Source, dest: str) -> None: found = gpsscrub.has_gps(dest) ext = os.path.splitext(name)[1].lower() raster = ext in RASTER_MEMBERS - verified = clean[:5] == b"%PDF-" and ext not in TEXT_MEMBERS + verified = clean[:5] == b"%PDF-" and ext not in TEXT_MEMBERS and _pdf_covered(clean) if found is True: raise LocationRemains("location could not be removed from this file") if row["lat"] is not None and not verified and not (raster and found is False and raster_located(clean) is False): diff --git a/backend/app/services/pdfimages.py b/backend/app/services/pdfimages.py new file mode 100644 index 0000000..4b75ffc --- /dev/null +++ b/backend/app/services/pdfimages.py @@ -0,0 +1,154 @@ +import struct +from typing import List, Tuple + +JPEG_KEEP = {0xE0, 0xEE} +JPEG_ICC = b"ICC_PROFILE\x00" +JPX_BOXES = {b"jP ", b"ftyp", b"rreq", b"jp2h", b"jp2c"} +JPX_SOT = 0x90 +JPX_SOD = 0x93 +JPX_EOC = 0xD9 + + +class ImageUnchecked(ValueError): + pass + + +def strip_jpeg(data: bytes) -> bytes: + if data[:2] != b"\xff\xd8": + raise ImageUnchecked("an embedded JPEG could not be read") + parts: List[bytes] = [b"\xff\xd8"] + pos, scanned = 2, False + while True: + marker, pos = _marker_at(data, pos) + if marker == 0xD9: + parts.append(b"\xff\xd9") + return b"".join(parts) + if 0xD0 <= marker <= 0xD7 or marker == 0x01: + parts.append(bytes((0xFF, marker))) + continue + end = _segment_end(data, pos) + if not _dropped(marker, data[pos + 4:end], scanned): + parts.append(data[pos:end]) + pos = end + if marker == 0xDA: + scanned = True + stop = _entropy_end(data, pos) + parts.append(data[pos:stop]) + pos = stop + + +def _marker_at(data: bytes, pos: int) -> Tuple[int, int]: + if pos + 2 > len(data) or data[pos] != 0xFF: + raise ImageUnchecked("an embedded JPEG could not be read") + while pos + 1 < len(data) and data[pos + 1] == 0xFF: + pos += 1 + if pos + 2 > len(data): + raise ImageUnchecked("an embedded JPEG ends early") + marker = data[pos + 1] + if marker in (0xD9, 0x01) or 0xD0 <= marker <= 0xD7: + return marker, pos + 2 + return marker, pos + + +def _segment_end(data: bytes, pos: int) -> int: + if pos + 4 > len(data): + raise ImageUnchecked("an embedded JPEG ends early") + length = struct.unpack_from(">H", data, pos + 2)[0] + end = pos + 2 + length + if length < 2 or end > len(data): + raise ImageUnchecked("an embedded JPEG could not be read") + return end + + +def _entropy_end(data: bytes, pos: int) -> int: + while True: + found = data.find(b"\xff", pos) + if found < 0 or found + 1 >= len(data): + raise ImageUnchecked("an embedded JPEG ends early") + follow = data[found + 1] + if follow == 0 or 0xD0 <= follow <= 0xD7: + pos = found + 2 + continue + return found + + +def _dropped(marker: int, body: bytes, scanned: bool) -> bool: + if marker == 0xFE: + return True + if 0xE0 <= marker <= 0xEF: + if scanned: + return True + return marker not in JPEG_KEEP and not (marker == 0xE2 and body.startswith(JPEG_ICC)) + return False + + +def jpx_clean(data: bytes) -> bool: + if data[:4] == b"\xff\x4f\xff\x51": + return codestream_clean(data) + if data[4:8] != b"jP ": + return False + pos, coded = 0, False + while pos < len(data): + box = _box(data, pos) + if box is None: + return False + kind, start, end = box + if kind not in JPX_BOXES: + return False + if kind == b"jp2c": + if not codestream_clean(data[start:end]): + return False + coded = True + pos = end + return coded + + +def _box(data: bytes, pos: int): + if pos + 8 > len(data): + return None + size, kind = struct.unpack_from(">I4s", data, pos) + head = 8 + if size == 1: + if pos + 16 > len(data): + return None + size = struct.unpack_from(">Q", data, pos + 8)[0] + head = 16 + elif size == 0: + size = len(data) - pos + if size < head or pos + size > len(data): + return None + return kind, pos + head, pos + size + + +def codestream_clean(data: bytes) -> bool: + if data[:2] != b"\xff\x4f": + return False + pos = _header_clean(data, 2, JPX_SOT) + while pos is not None and pos + 12 <= len(data): + if data[pos + 1] == JPX_EOC: + return True + if data[pos + 1] != JPX_SOT: + return False + part = struct.unpack_from(">I", data, pos + 6)[0] + if _header_clean(data, pos + 12, JPX_SOD) is None: + return False + if part == 0: + return True + if part < 14 or pos + part > len(data): + return False + pos += part + return pos is not None and data[pos:pos + 2] == b"\xff\xd9" + + +def _header_clean(data: bytes, pos: int, stop: int): + while pos + 4 <= len(data): + if data[pos] != 0xFF: + return None + marker = data[pos + 1] + if marker == stop: + return pos + length = struct.unpack_from(">H", data, pos + 2)[0] + if length < 2: + return None + pos += 2 + length + return None diff --git a/backend/app/services/pdfstrip.py b/backend/app/services/pdfstrip.py index 74181c8..c33a5a5 100644 --- a/backend/app/services/pdfstrip.py +++ b/backend/app/services/pdfstrip.py @@ -1,20 +1,20 @@ import io import logging -import struct -from typing import Any, Iterator, List +from typing import Any, Iterator, List, Set, Tuple -from . import filestrip, zipsafe +from . import filestrip, pdfimages, zipsafe logger = logging.getLogger(__name__) DECODE_CAP = 256 * 1024 * 1024 MAX_OBJECTS = 200_000 -DROPPED_KEYS = ("/Metadata", "/PieceInfo") +DROPPED_KEYS = ("/Metadata", "/PieceInfo", "/AF", "/EF", "/EmbeddedFiles") LOCATION_WORDS = ("gps", "latitude", "longitude", "location", "geo") BILEVEL = {"/JBIG2Decode", "/CCITTFaxDecode"} -JPEG_KEEP = {0xE0, 0xEE} -JPEG_ICC = b"ICC_PROFILE\x00" -SNIFFED = ((b"\xff\xd8", ".jpg"), (b"\x89PNG", ".png"), (b"II*\x00", ".tif"), (b"MM\x00*", ".tif"), (b"%PDF-", ".pdf")) +IMAGE_FILTERS = BILEVEL | {"/DCTDecode", "/JPXDecode"} +FONT_KEYS = ("/FontFile", "/FontFile2", "/FontFile3", "/ToUnicode") +CONTAINER_MAGIC = (b"\xff\xd8", b"\x89PNG", b"II*\x00", b"MM\x00*", b"PK\x03\x04", b"%PDF-", b"RIFF", b"GIF8", + b"\x00\x00\x00\x0cjP ", b"\xff\x4f\xff\x51") class _Budget: @@ -27,13 +27,11 @@ def take(self, size: int) -> None: raise filestrip.LocationRemains("a PDF expands past the size limit") -def clean_pdf(name: str, data: bytes, depth: int = 0) -> bytes: +def clean_pdf(name: str, data: bytes) -> bytes: if len(data) > zipsafe.MEMBER_CAP: raise filestrip.LocationRemains(f"{name} is too large to check") - if depth >= zipsafe.MAX_DEPTH: - raise filestrip.LocationRemains(f"{name} nests files too deeply to check") try: - clean = _rewrite(_open(data), depth) + clean = _rewrite(_open(data)) verify(clean) except filestrip.LocationRemains as exc: raise filestrip.LocationRemains(f"{name}: {exc}") from exc @@ -43,6 +41,13 @@ def clean_pdf(name: str, data: bytes, depth: int = 0) -> bytes: return clean +def fully_checked(data: bytes) -> bool: + try: + return verify(data) + except Exception: + return False + + def _open(data: bytes) -> Any: from pypdf import PdfReader @@ -56,7 +61,7 @@ def _open(data: bytes) -> Any: return reader -def _rewrite(reader: Any, depth: int) -> bytes: +def _rewrite(reader: Any) -> bytes: from pypdf import PdfWriter writer = PdfWriter(clone_from=reader) @@ -65,29 +70,48 @@ def _rewrite(reader: Any, depth: int) -> bytes: raise filestrip.LocationRemains("this PDF holds too many objects to check") for obj in writer._objects: if obj is not None: - _scrub(obj.get_object(), depth) + _scrub(obj.get_object()) writer.compress_identical_objects(remove_duplicates=False, remove_unreferenced=True) out = io.BytesIO() writer.write(out) return out.getvalue() -def _scrub(obj: Any, depth: int) -> None: +def _scrub(obj: Any) -> None: from pypdf.generic import ArrayObject, DictionaryObject, StreamObject if isinstance(obj, DictionaryObject): for key in DROPPED_KEYS: if key in obj: del obj[key] + if "/Annots" in obj: + _drop_attachment_notes(obj) for value in obj.values(): if not _is_ref(value): - _scrub(value, depth) + _scrub(value) elif isinstance(obj, ArrayObject): for value in obj: if not _is_ref(value): - _scrub(value, depth) - if isinstance(obj, StreamObject): - _scrub_stream(obj, depth) + _scrub(value) + if isinstance(obj, StreamObject) and _filters(obj) == ["/DCTDecode"]: + obj._data = _jpeg(obj._data) + + +def _drop_attachment_notes(page: Any) -> None: + from pypdf.generic import ArrayObject, NameObject + + notes = page["/Annots"] + if not isinstance(notes, ArrayObject): + return + kept = ArrayObject(note for note in notes if note.get_object().get("/Subtype") != "/FileAttachment") + page[NameObject("/Annots")] = kept + + +def _jpeg(data: bytes) -> bytes: + try: + return pdfimages.strip_jpeg(data) + except pdfimages.ImageUnchecked as exc: + raise filestrip.LocationRemains(str(exc)) from exc def _is_ref(value: Any) -> bool: @@ -106,71 +130,7 @@ def _filters(obj: Any) -> List[str]: return [str(found)] -def _scrub_stream(obj: Any, depth: int) -> None: - filters = _filters(obj) - if filters == ["/DCTDecode"]: - obj._data = strip_jpeg(obj._data) - elif obj.get("/Type") == "/EmbeddedFile": - _scrub_attachment(obj, depth) - - -def _scrub_attachment(obj: Any, depth: int) -> None: - data = obj.get_data() - clean = filestrip.clean_member(_sniffed_name(data), data, depth + 1) if data else data - for key in ("/Filter", "/DecodeParms", "/Params"): - if key in obj: - del obj[key] - obj._data = clean - - -def _sniffed_name(data: bytes) -> str: - for magic, ext in SNIFFED: - if data.startswith(magic): - return f"attachment{ext}" - return "attachment" - - -def strip_jpeg(data: bytes) -> bytes: - if data[:2] != b"\xff\xd8": - raise filestrip.LocationRemains("an embedded JPEG could not be read") - parts = [b"\xff\xd8"] - pos = 2 - while pos + 4 <= len(data): - if data[pos] != 0xFF: - raise filestrip.LocationRemains("an embedded JPEG could not be read") - marker = data[pos + 1] - if marker == 0xFF: - pos += 1 - continue - length = struct.unpack_from(">H", data, pos + 2)[0] - end = pos + 2 + length - if length < 2 or end > len(data): - raise filestrip.LocationRemains("an embedded JPEG could not be read") - if marker == 0xDA: - parts.append(_first_image(data, pos)) - return b"".join(parts) - if not _dropped_segment(marker, data[pos + 4:end]): - parts.append(data[pos:end]) - pos = end - raise filestrip.LocationRemains("an embedded JPEG ends early") - - -def _dropped_segment(marker: int, body: bytes) -> bool: - if marker == 0xFE: - return True - if 0xE0 <= marker <= 0xEF: - return marker not in JPEG_KEEP and not (marker == 0xE2 and body.startswith(JPEG_ICC)) - return False - - -def _first_image(data: bytes, start: int) -> bytes: - end = data.find(b"\xff\xd9", start) - if end < 0: - raise filestrip.LocationRemains("an embedded JPEG ends early") - return data[start:end + 2] - - -def verify(data: bytes) -> None: +def verify(data: bytes) -> bool: from pypdf import PdfReader reader = PdfReader(io.BytesIO(data), strict=False) @@ -178,11 +138,13 @@ def verify(data: bytes) -> None: raise filestrip.LocationRemains("the clean copy could not be checked") if "/Info" in reader.trailer: _check_info(reader.trailer["/Info"].get_object()) - if "/Metadata" in reader.trailer["/Root"]: - raise filestrip.LocationRemains("the clean copy still carries XMP metadata") + objects = list(_all_objects(reader)) + known = _known_streams(objects) budget = _Budget() - for obj in _all_objects(reader): - _check(obj, budget) + covered = True + for num, obj in objects: + covered = _check(obj, budget, num in known) and covered + return covered def _check_info(info: Any) -> None: @@ -193,57 +155,86 @@ def _check_info(info: Any) -> None: raise filestrip.LocationRemains("the clean copy still names a location") -def _all_objects(reader: Any) -> Iterator[Any]: +def _all_objects(reader: Any) -> Iterator[Tuple[int, Any]]: from pypdf.generic import IndirectObject - seen = 0 numbers = {(num, gen) for gen, table in reader.xref.items() for num in table} numbers.update((num, 0) for num in reader.xref_objStm) + if len(numbers) > MAX_OBJECTS: + raise filestrip.LocationRemains("the clean copy holds too many objects to check") for num, gen in sorted(numbers): - seen += 1 - if seen > MAX_OBJECTS: - raise filestrip.LocationRemains("the clean copy holds too many objects to check") - yield IndirectObject(num, gen, reader).get_object() + yield num, IndirectObject(num, gen, reader).get_object() + + +def _known_streams(objects: List[Tuple[int, Any]]) -> Set[int]: + from pypdf.generic import ArrayObject, DictionaryObject + + known: Set[int] = set() + for _num, obj in objects: + if not isinstance(obj, DictionaryObject): + continue + keys = [key for key in FONT_KEYS if key in obj] + if obj.get("/Type") == "/Page" and "/Contents" in obj: + keys.append("/Contents") + for key in keys: + value = obj.raw_get(key) + listed = value.get_object() if _is_ref(value) else value + known.update(item.idnum for item in (listed if isinstance(listed, ArrayObject) else [value]) if _is_ref(item)) + return known -def _check(obj: Any, budget: _Budget) -> None: +def _check(obj: Any, budget: _Budget, known: bool) -> bool: from pypdf.generic import ArrayObject, DictionaryObject, StreamObject if isinstance(obj, DictionaryObject): for key, value in obj.items(): - if key == "/Metadata" or any(word in str(key).lower() for word in LOCATION_WORDS): - raise filestrip.LocationRemains("the clean copy still carries metadata") + if key in DROPPED_KEYS or any(word in str(key).lower() for word in LOCATION_WORDS): + raise filestrip.LocationRemains("the clean copy still carries metadata or an attachment") if not _is_ref(value): - _check(value, budget) + _check(value, budget, False) + if obj.get("/Subtype") == "/FileAttachment" or obj.get("/Type") == "/EmbeddedFile": + raise filestrip.LocationRemains("the clean copy still carries an attachment") elif isinstance(obj, ArrayObject): for value in obj: if not _is_ref(value): - _check(value, budget) + _check(value, budget, False) elif isinstance(obj, (str, bytes)): raw = obj if isinstance(obj, bytes) else obj.encode("utf-8", "ignore") if filestrip.text_located(raw): raise filestrip.LocationRemains("the clean copy still names a location") if isinstance(obj, StreamObject): - _check_stream(obj, budget) + return _check_stream(obj, budget, known) + return True -def _check_stream(obj: Any, budget: _Budget) -> None: +def _check_stream(obj: Any, budget: _Budget, known: bool) -> bool: filters = _filters(obj) raw = obj._data budget.take(len(raw)) if obj.get("/Type") == "/Metadata" or obj.get("/Subtype") == "/XML": raise filestrip.LocationRemains("the clean copy still carries an XMP stream") - if filters and filters[-1] in BILEVEL | {"/DCTDecode", "/JPXDecode"}: - if len(filters) > 1: - raise filestrip.LocationRemains("an image in the clean copy is encoded in a way formDAM cannot check") - if filters == ["/DCTDecode"] and (filestrip.raster_located(raw) is not False or strip_jpeg(raw) != raw): - raise filestrip.LocationRemains("an embedded JPEG still carries metadata") - if filters == ["/JPXDecode"] and filestrip.text_located(raw): - raise filestrip.LocationRemains("an embedded image still names a location") - return + image = obj.get("/Subtype") == "/Image" + if filters and filters[-1] in IMAGE_FILTERS: + return _check_coded_image(obj, filters, raw, image) plain = obj.get_data() budget.take(len(plain)) if filestrip.text_located(plain): raise filestrip.LocationRemains("the clean copy still names a location") - if plain[:2] == b"\xff\xd8" and filestrip.raster_located(plain) is not False: - raise filestrip.LocationRemains("an embedded JPEG still carries a location") + if not image and (plain.startswith(CONTAINER_MAGIC) or plain[4:8] == b"ftyp"): + raise filestrip.LocationRemains("the clean copy carries an embedded file formDAM cannot check") + drawn = obj.get("/Subtype") == "/Form" or "/PatternType" in obj or "/ShadingType" in obj or obj.get("/Type") == "/CMap" + return known or image or drawn or plain[36:40] == b"acsp" + + +def _check_coded_image(obj: Any, filters: List[str], raw: bytes, image: bool) -> bool: + if len(filters) > 1 or not image: + raise filestrip.LocationRemains("an image in the clean copy is encoded in a way formDAM cannot check") + if filters == ["/DCTDecode"]: + if filestrip.raster_located(raw) is not False or _jpeg(raw) != raw: + raise filestrip.LocationRemains("an embedded JPEG still carries metadata") + return True + if filters == ["/JPXDecode"]: + if not pdfimages.jpx_clean(raw) or filestrip.text_located(raw): + raise filestrip.LocationRemains("an embedded JPEG 2000 image carries metadata or cannot be read") + return False + return True diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index 57f04bf..f99e5dc 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -427,6 +427,100 @@ def test_encrypted_pdfs_are_refused(tmp_path): assert not dest.exists() +def pdf_with(tmp_path, build): + from pypdf import PdfWriter + + writer = PdfWriter() + page = writer.add_blank_page(200, 200) + build(writer, page) + out = io.BytesIO() + writer.write(out) + return out.getvalue() + + +def image_xobject(writer, page, data, filt, size=16): + from pypdf.generic import DictionaryObject, NameObject, NumberObject, StreamObject + + image = StreamObject() + image._data = data + image.update({NameObject("/Type"): NameObject("/XObject"), NameObject("/Subtype"): NameObject("/Image"), + NameObject("/Width"): NumberObject(size), NameObject("/Height"): NumberObject(size), + NameObject("/ColorSpace"): NameObject("/DeviceRGB"), NameObject("/BitsPerComponent"): NumberObject(8), + NameObject("/Filter"): NameObject(filt)}) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/XObject"): DictionaryObject({NameObject("/Im0"): writer._add_object(image)})}) + + +def test_pdf_attachments_are_removed_and_unknown_embedded_files_refused(tmp_path): + from pypdf import PdfReader + from pypdf.generic import ArrayObject, DecodedStreamObject, DictionaryObject, NameObject, TextStringObject + + from app.services import filestrip + + photo = located_jpeg(tmp_path / "photo.jpg").read_bytes() + + def attach(writer, page): + writer.add_attachment("photo.jpg", photo) + held = DecodedStreamObject() + held.set_data(photo) + held[NameObject("/Type")] = NameObject("/EmbeddedFile") + spec = DictionaryObject({NameObject("/Type"): NameObject("/Filespec"), NameObject("/F"): TextStringObject("p.jpg"), + NameObject("/EF"): DictionaryObject({NameObject("/F"): writer._add_object(held)})}) + note = DictionaryObject({NameObject("/Type"): NameObject("/Annot"), NameObject("/Subtype"): NameObject("/FileAttachment"), + NameObject("/Rect"): ArrayObject(), NameObject("/FS"): writer._add_object(spec)}) + page[NameObject("/Annots")] = ArrayObject([writer._add_object(note)]) + + clean = filestrip.clean_member("a.pdf", pdf_with(tmp_path, attach)) + reader = PdfReader(io.BytesIO(clean)) + assert reader.attachments == {} and b"Exif" not in clean and b"EmbeddedFile" not in clean + assert reader.pages[0].get("/Annots", []) == [] + + def smuggle(writer, page): + blob = DecodedStreamObject() + blob.set_data(b"\x89PNG\r\n\x1a\n" + b"\x00" * 32) + page[NameObject("/Extra")] = writer._add_object(blob) + + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", pdf_with(tmp_path, smuggle)) + + +def test_jpeg_segments_after_the_first_scan_are_dropped(tmp_path): + from app.services import filestrip, pdfimages + + plain = io.BytesIO() + Image.new("RGB", (24, 24), (10, 120, 30)).save(plain, "JPEG", progressive=True) + data = plain.getvalue() + late = b"\xff\xe1" + struct.pack(">H", 2 + 18) + b"Exif\x00\x00GPSLatitude!" + b"\xff\xfe\x00\x06note" + scan = data.index(b"\xff\xda") + second = data.index(b"\xff\xc4", scan) if b"\xff\xc4" in data[scan:] else data.rindex(b"\xff\xd9") + hidden = data[:second] + late + data[second:] + b"\xff\xd8\xff\xe1trailing" + clean = pdfimages.strip_jpeg(hidden) + assert b"Exif" not in clean and b"note" not in clean and b"trailing" not in clean + assert Image.open(io.BytesIO(clean)).size == (24, 24) and filestrip.raster_located(clean) is False + with pytest.raises(pdfimages.ImageUnchecked): + pdfimages.strip_jpeg(data[:scan + 20]) + + +def test_jpeg_2000_images_pass_only_with_plain_boxes_and_never_vouch_for_a_location(tmp_path): + from app.services import filestrip + + coded = io.BytesIO() + Image.new("RGB", (16, 16), (9, 9, 9)).save(coded, "JPEG2000") + jp2 = coded.getvalue() + tagged = jp2 + struct.pack(">I4s", 8 + 12, b"xml ") + b"tagged Date: Sun, 29 Nov 2026 14:43:33 -0500 Subject: [PATCH 23/35] fix: rebuild the PDF clean copy from its pages 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. --- backend/HASHOUT_LOG.md | 11 + backend/app/services/filestrip.py | 8 +- backend/app/services/pdfimages.py | 154 ------------- backend/app/services/pdfstrip.py | 342 +++++++++++++++------------- backend/tests/test_formats_extra.py | 117 ++++++---- 5 files changed, 278 insertions(+), 354 deletions(-) delete mode 100644 backend/app/services/pdfimages.py diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index c02b179..9b6bab5 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,16 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/pdfstrip.py · the PDF clean copy is rebuilt from the pages, not cloned +- refers-to: pdfstrip _rebuild, _copy_page, _copy_resources, _copy, _copy_stream, _copy_image, _recode_image, verify, _check_bytes; pdfimages removed; filestrip strip_file verified; tests/test_formats_extra.py stream_of, located_tiff, unreached objects, real resources, rebuilt images +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +Supersedes the two entries below. Cloning the document and then deciding which streams were understood left coverage to markers anyone can write (an acsp header, a dictionary that merely has a font or /Contents key), and non-image streams were not searched for EXIF or TIFF data. The clean copy is now safe by construction. A new pypdf document gets, for each page of the source, its boxes, rotation and transparency group, one content stream (the page's decoded contents, Flate encoded), and a resource dictionary rebuilt from the source's /Font, /XObject, /ColorSpace, /Pattern, /Shading and /ExtGState entries, keeping only the names the content stream uses. What those resources reach is copied object by object (forms and patterns keep only the resources their own content uses); every stream is decoded and written again with Flate. Nothing else is reached: no document information, catalog entries, outlines, names, attachments, annotations, forms, actions, JavaScript, optional content, measure or viewport (geospatial) data, page piece data or marked-content properties, and those keys are dropped wherever they appear. ICCBased colour spaces become the device space with the same number of components, so no profile is carried. + +Images whose filters are only Flate, LZW, run length or ASCII keep their decoded samples, which hold no metadata, under the same colour space and decode array. DCTDecode and JPXDecode images are decoded by Pillow and written as a fresh baseline JPEG (quality 95, grey or RGB, no APP segments beyond JFIF), so EXIF, XMP, comments, segments after the first scan, data after the image and JPEG 2000 boxes cannot survive. A coded image with a decode range other than the default, a chained filter or a size that does not match its dictionary is refused, as are CCITT and JBIG2 images, which pypdf cannot decode without outside tools. CMYK JPEGs become RGB, so their colours move a little. + +The written copy is read back and every object in its cross-reference table is checked: no dropped key and no key naming GPS, a latitude, a longitude, a location or geo data; every string and every decoded stream searched for a GPS value, an Exif header and an XMP packet; every non-image stream refused when it starts like a JPEG, PNG, TIFF, ZIP, PDF, RIFF, GIF, JPEG 2000 or ISO-BMFF file; every JPEG image read by filestrip.raster_located, which must say False. An inline image in a content stream that carries EXIF therefore refuses the PDF. Because the copy holds nothing the rebuild did not make, a PDF row with a stored location may leave without it once the check passes. Bounds as before: 512 MiB in, 256 MiB decoded, 200,000 objects, 64 megapixels per image. + ### services/pdfstrip.py, pdfimages.py · PDF clean copies: attachments, late JPEG segments, JPEG 2000, coverage - refers-to: pdfstrip DROPPED_KEYS (/AF, /EF, /EmbeddedFiles), _drop_attachment_notes, verify (returns coverage), fully_checked, _known_streams, _check_stream container magic, _check_coded_image; pdfimages (new) strip_jpeg, jpx_clean, codestream_clean, ImageUnchecked; filestrip strip_file _pdf_covered; tests/test_formats_extra.py attachments, late JPEG segments, JPEG 2000 - kind: fix diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index 162eeb5..fd47495 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -202,12 +202,6 @@ def strip_zip(src: Source, dest: str) -> None: _strip_archive(source, dest, 0, zipsafe.Budget(total_cap=max(zipsafe.TOTAL_CAP, outer * 4))) -def _pdf_covered(clean: bytes) -> bool: - from . import pdfstrip - - return pdfstrip.fully_checked(clean) - - def _is_zip(src: Source) -> bool: if isinstance(src, (bytes, bytearray)): return bytes(src[:4]) == b"PK\x03\x04" @@ -231,7 +225,7 @@ def strip_file(row, src: Source, dest: str) -> None: found = gpsscrub.has_gps(dest) ext = os.path.splitext(name)[1].lower() raster = ext in RASTER_MEMBERS - verified = clean[:5] == b"%PDF-" and ext not in TEXT_MEMBERS and _pdf_covered(clean) + verified = clean[:5] == b"%PDF-" and ext not in TEXT_MEMBERS if found is True: raise LocationRemains("location could not be removed from this file") if row["lat"] is not None and not verified and not (raster and found is False and raster_located(clean) is False): diff --git a/backend/app/services/pdfimages.py b/backend/app/services/pdfimages.py deleted file mode 100644 index 4b75ffc..0000000 --- a/backend/app/services/pdfimages.py +++ /dev/null @@ -1,154 +0,0 @@ -import struct -from typing import List, Tuple - -JPEG_KEEP = {0xE0, 0xEE} -JPEG_ICC = b"ICC_PROFILE\x00" -JPX_BOXES = {b"jP ", b"ftyp", b"rreq", b"jp2h", b"jp2c"} -JPX_SOT = 0x90 -JPX_SOD = 0x93 -JPX_EOC = 0xD9 - - -class ImageUnchecked(ValueError): - pass - - -def strip_jpeg(data: bytes) -> bytes: - if data[:2] != b"\xff\xd8": - raise ImageUnchecked("an embedded JPEG could not be read") - parts: List[bytes] = [b"\xff\xd8"] - pos, scanned = 2, False - while True: - marker, pos = _marker_at(data, pos) - if marker == 0xD9: - parts.append(b"\xff\xd9") - return b"".join(parts) - if 0xD0 <= marker <= 0xD7 or marker == 0x01: - parts.append(bytes((0xFF, marker))) - continue - end = _segment_end(data, pos) - if not _dropped(marker, data[pos + 4:end], scanned): - parts.append(data[pos:end]) - pos = end - if marker == 0xDA: - scanned = True - stop = _entropy_end(data, pos) - parts.append(data[pos:stop]) - pos = stop - - -def _marker_at(data: bytes, pos: int) -> Tuple[int, int]: - if pos + 2 > len(data) or data[pos] != 0xFF: - raise ImageUnchecked("an embedded JPEG could not be read") - while pos + 1 < len(data) and data[pos + 1] == 0xFF: - pos += 1 - if pos + 2 > len(data): - raise ImageUnchecked("an embedded JPEG ends early") - marker = data[pos + 1] - if marker in (0xD9, 0x01) or 0xD0 <= marker <= 0xD7: - return marker, pos + 2 - return marker, pos - - -def _segment_end(data: bytes, pos: int) -> int: - if pos + 4 > len(data): - raise ImageUnchecked("an embedded JPEG ends early") - length = struct.unpack_from(">H", data, pos + 2)[0] - end = pos + 2 + length - if length < 2 or end > len(data): - raise ImageUnchecked("an embedded JPEG could not be read") - return end - - -def _entropy_end(data: bytes, pos: int) -> int: - while True: - found = data.find(b"\xff", pos) - if found < 0 or found + 1 >= len(data): - raise ImageUnchecked("an embedded JPEG ends early") - follow = data[found + 1] - if follow == 0 or 0xD0 <= follow <= 0xD7: - pos = found + 2 - continue - return found - - -def _dropped(marker: int, body: bytes, scanned: bool) -> bool: - if marker == 0xFE: - return True - if 0xE0 <= marker <= 0xEF: - if scanned: - return True - return marker not in JPEG_KEEP and not (marker == 0xE2 and body.startswith(JPEG_ICC)) - return False - - -def jpx_clean(data: bytes) -> bool: - if data[:4] == b"\xff\x4f\xff\x51": - return codestream_clean(data) - if data[4:8] != b"jP ": - return False - pos, coded = 0, False - while pos < len(data): - box = _box(data, pos) - if box is None: - return False - kind, start, end = box - if kind not in JPX_BOXES: - return False - if kind == b"jp2c": - if not codestream_clean(data[start:end]): - return False - coded = True - pos = end - return coded - - -def _box(data: bytes, pos: int): - if pos + 8 > len(data): - return None - size, kind = struct.unpack_from(">I4s", data, pos) - head = 8 - if size == 1: - if pos + 16 > len(data): - return None - size = struct.unpack_from(">Q", data, pos + 8)[0] - head = 16 - elif size == 0: - size = len(data) - pos - if size < head or pos + size > len(data): - return None - return kind, pos + head, pos + size - - -def codestream_clean(data: bytes) -> bool: - if data[:2] != b"\xff\x4f": - return False - pos = _header_clean(data, 2, JPX_SOT) - while pos is not None and pos + 12 <= len(data): - if data[pos + 1] == JPX_EOC: - return True - if data[pos + 1] != JPX_SOT: - return False - part = struct.unpack_from(">I", data, pos + 6)[0] - if _header_clean(data, pos + 12, JPX_SOD) is None: - return False - if part == 0: - return True - if part < 14 or pos + part > len(data): - return False - pos += part - return pos is not None and data[pos:pos + 2] == b"\xff\xd9" - - -def _header_clean(data: bytes, pos: int, stop: int): - while pos + 4 <= len(data): - if data[pos] != 0xFF: - return None - marker = data[pos + 1] - if marker == stop: - return pos - length = struct.unpack_from(">H", data, pos + 2)[0] - if length < 2: - return None - pos += 2 + length - return None diff --git a/backend/app/services/pdfstrip.py b/backend/app/services/pdfstrip.py index c33a5a5..aa5cf91 100644 --- a/backend/app/services/pdfstrip.py +++ b/backend/app/services/pdfstrip.py @@ -1,53 +1,61 @@ import io import logging -from typing import Any, Iterator, List, Set, Tuple +import re +from typing import Any, Dict, List, Optional, Set -from . import filestrip, pdfimages, zipsafe +from . import filestrip, zipsafe logger = logging.getLogger(__name__) DECODE_CAP = 256 * 1024 * 1024 MAX_OBJECTS = 200_000 -DROPPED_KEYS = ("/Metadata", "/PieceInfo", "/AF", "/EF", "/EmbeddedFiles") +MAX_PIXELS = 64 * 1024 * 1024 +PAGE_KEYS = ("/CropBox", "/BleedBox", "/TrimBox", "/ArtBox", "/Rotate", "/UserUnit", "/Group") +RESOURCE_KEYS = ("/Font", "/XObject", "/ColorSpace", "/Pattern", "/Shading", "/ExtGState") +PROC_SET = ("/PDF", "/Text", "/ImageB", "/ImageC", "/ImageI") +DROPPED_KEYS = {"/Metadata", "/PieceInfo", "/AF", "/EF", "/EmbeddedFiles", "/JS", "/JavaScript", "/AA", "/A", + "/OpenAction", "/URI", "/Annots", "/Parent", "/OC", "/OPI", "/Measure", "/PtData", "/VP", "/StructParent", + "/StructParents", "/Properties", "/Names", "/Dests", "/Outlines", "/LastModified", "/AcroForm"} +STREAM_KEYS = {"/Length", "/Filter", "/DecodeParms", "/F", "/FFilter", "/FDecodeParms", "/DL"} +RAW_FILTERS = {"/FlateDecode", "/Fl", "/LZWDecode", "/LZW", "/RunLengthDecode", "/RL", "/ASCII85Decode", "/A85", + "/ASCIIHexDecode", "/AHx"} +CODED_FILTERS = {"/DCTDecode", "/DCT", "/JPXDecode"} LOCATION_WORDS = ("gps", "latitude", "longitude", "location", "geo") -BILEVEL = {"/JBIG2Decode", "/CCITTFaxDecode"} -IMAGE_FILTERS = BILEVEL | {"/DCTDecode", "/JPXDecode"} -FONT_KEYS = ("/FontFile", "/FontFile2", "/FontFile3", "/ToUnicode") +DEVICE_BY_N = {1: "/DeviceGray", 3: "/DeviceRGB", 4: "/DeviceCMYK"} CONTAINER_MAGIC = (b"\xff\xd8", b"\x89PNG", b"II*\x00", b"MM\x00*", b"PK\x03\x04", b"%PDF-", b"RIFF", b"GIF8", b"\x00\x00\x00\x0cjP ", b"\xff\x4f\xff\x51") +METADATA_MARKS = (b"Exif\x00", b"{}%]+)") -class _Budget: - def __init__(self) -> None: +class _Copier: + def __init__(self, writer: Any) -> None: + self.writer = writer + self.memo: Dict[Any, Any] = {} self.left = DECODE_CAP def take(self, size: int) -> None: self.left -= size if self.left < 0: raise filestrip.LocationRemains("a PDF expands past the size limit") + if len(self.memo) > MAX_OBJECTS: + raise filestrip.LocationRemains("this PDF holds too many objects to check") def clean_pdf(name: str, data: bytes) -> bytes: if len(data) > zipsafe.MEMBER_CAP: raise filestrip.LocationRemains(f"{name} is too large to check") try: - clean = _rewrite(_open(data)) + clean = _rebuild(_open(data)) verify(clean) except filestrip.LocationRemains as exc: raise filestrip.LocationRemains(f"{name}: {exc}") from exc except Exception as exc: logger.info("pdf clean failed: %s", exc) - raise filestrip.LocationRemains(f"{name}: this PDF could not be rewritten without its location") from exc + raise filestrip.LocationRemains(f"{name}: this PDF could not be rebuilt without its location") from exc return clean -def fully_checked(data: bytes) -> bool: - try: - return verify(data) - except Exception: - return False - - def _open(data: bytes) -> Any: from pypdf import PdfReader @@ -61,180 +69,210 @@ def _open(data: bytes) -> Any: return reader -def _rewrite(reader: Any) -> bytes: +def _rebuild(reader: Any) -> bytes: from pypdf import PdfWriter - writer = PdfWriter(clone_from=reader) + writer = PdfWriter() writer.metadata = None - if len(writer._objects) > MAX_OBJECTS: - raise filestrip.LocationRemains("this PDF holds too many objects to check") - for obj in writer._objects: - if obj is not None: - _scrub(obj.get_object()) - writer.compress_identical_objects(remove_duplicates=False, remove_unreferenced=True) + copier = _Copier(writer) + for source in reader.pages: + _copy_page(copier, source) out = io.BytesIO() writer.write(out) return out.getvalue() -def _scrub(obj: Any) -> None: - from pypdf.generic import ArrayObject, DictionaryObject, StreamObject - - if isinstance(obj, DictionaryObject): - for key in DROPPED_KEYS: - if key in obj: - del obj[key] - if "/Annots" in obj: - _drop_attachment_notes(obj) - for value in obj.values(): - if not _is_ref(value): - _scrub(value) - elif isinstance(obj, ArrayObject): - for value in obj: - if not _is_ref(value): - _scrub(value) - if isinstance(obj, StreamObject) and _filters(obj) == ["/DCTDecode"]: - obj._data = _jpeg(obj._data) - - -def _drop_attachment_notes(page: Any) -> None: +def _copy_page(copier: _Copier, source: Any) -> None: + from pypdf.generic import NameObject + + box = source.mediabox + page = copier.writer.add_blank_page(float(box.width), float(box.height)) + page[NameObject("/MediaBox")] = _copy(copier, source.mediabox) + for key in PAGE_KEYS: + if key in source: + page[NameObject(key)] = _copy(copier, source.raw_get(key)) + contents = source.get_contents() + content = contents.get_data() if contents is not None else b"" + copier.take(len(content)) + page[NameObject("/Contents")] = copier.writer._add_object(_new_stream({}, content)) + resources = source.get("/Resources") + if resources is not None: + page[NameObject("/Resources")] = _copy_resources(copier, resources.get_object(), content) + + +def _copy_resources(copier: _Copier, resources: Any, content: bytes) -> Any: + from pypdf.generic import ArrayObject, DictionaryObject, NameObject + + used = {b"/" + token for token in NAME_TOKEN.findall(content)} + out = DictionaryObject() + for key in RESOURCE_KEYS: + group = resources.get(key) + group = group.get_object() if group is not None else None + if not isinstance(group, DictionaryObject): + continue + kept = DictionaryObject() + for name in group: + if str(name).encode("latin-1", "replace") in used: + kept[NameObject(name)] = _copy(copier, group.raw_get(name)) + out[NameObject(key)] = kept + out[NameObject("/ProcSet")] = ArrayObject([NameObject(name) for name in PROC_SET]) + return out + + +def _copy(copier: _Copier, value: Any) -> Any: + from pypdf.generic import ArrayObject, DictionaryObject, IndirectObject, NullObject, StreamObject + + if isinstance(value, IndirectObject): + key = (value.idnum, value.generation) + if key not in copier.memo: + slot = copier.writer._add_object(NullObject()) + copier.memo[key] = slot + copier.take(0) + copier.writer._replace_object(slot, _copy(copier, value.get_object())) + return copier.memo[key] + if isinstance(value, StreamObject): + return _copy_stream(copier, value) + if isinstance(value, DictionaryObject): + return _copy_dict(copier, value) + if isinstance(value, ArrayObject): + return _copy_array(copier, value) + return value + + +def _copy_dict(copier: _Copier, value: Any, skip: Optional[Set[str]] = None) -> Any: + from pypdf.generic import DictionaryObject, NameObject + + out = DictionaryObject() + for key in value: + if key not in DROPPED_KEYS and not (skip and key in skip): + out[NameObject(key)] = _copy(copier, value.raw_get(key)) + return out + + +def _copy_array(copier: _Copier, value: Any) -> Any: from pypdf.generic import ArrayObject, NameObject - notes = page["/Annots"] - if not isinstance(notes, ArrayObject): - return - kept = ArrayObject(note for note in notes if note.get_object().get("/Subtype") != "/FileAttachment") - page[NameObject("/Annots")] = kept + if value and value[0] == "/ICCBased": + profile = value[1].get_object() + return NameObject(DEVICE_BY_N.get(int(profile.get("/N", 3)), "/DeviceRGB")) + return ArrayObject(_copy(copier, item) for item in value) -def _jpeg(data: bytes) -> bytes: - try: - return pdfimages.strip_jpeg(data) - except pdfimages.ImageUnchecked as exc: - raise filestrip.LocationRemains(str(exc)) from exc +def _copy_stream(copier: _Copier, value: Any) -> Any: + from pypdf.generic import NameObject + if value.get("/Subtype") == "/Image": + return _copy_image(copier, value) + data = value.get_data() + copier.take(len(data)) + fields = _copy_dict(copier, value, STREAM_KEYS | {"/Resources"}) + if "/Resources" in value: + fields[NameObject("/Resources")] = _copy_resources(copier, value["/Resources"].get_object(), data) + return _new_stream(fields, data) -def _is_ref(value: Any) -> bool: - from pypdf.generic import IndirectObject - return isinstance(value, IndirectObject) +def _new_stream(fields: Any, data: bytes) -> Any: + from pypdf.generic import DecodedStreamObject, NameObject + stream = DecodedStreamObject() + for key, item in dict(fields).items(): + stream[NameObject(key)] = item + stream.set_data(data) + return stream.flate_encode() -def _filters(obj: Any) -> List[str]: - found = obj.get("/Filter") + +def _filters(value: Any) -> List[str]: + found = value.get("/Filter") if found is None: return [] found = found.get_object() - if isinstance(found, list): - return [str(item.get_object()) for item in found] - return [str(found)] - - -def verify(data: bytes) -> bool: + return [str(item) for item in found] if isinstance(found, list) else [str(found)] + + +def _copy_image(copier: _Copier, value: Any) -> Any: + width, height = int(value.get("/Width", 0)), int(value.get("/Height", 0)) + if width <= 0 or height <= 0 or width * height > MAX_PIXELS: + raise filestrip.LocationRemains("an image in this PDF is too large or has no size") + filters = set(_filters(value)) + if not filters <= RAW_FILTERS | CODED_FILTERS or (filters & CODED_FILTERS and len(filters) > 1): + raise filestrip.LocationRemains("an image in this PDF is encoded in a way formDAM cannot rebuild") + if filters & CODED_FILTERS: + return _recode_image(copier, value, width, height) + data = value.get_data() + copier.take(len(data)) + return _new_stream(_copy_dict(copier, value, STREAM_KEYS), data) + + +def _recode_image(copier: _Copier, value: Any, width: int, height: int) -> Any: + from PIL import Image + from pypdf.generic import NameObject, NumberObject, StreamObject + + decode = value.get("/Decode") + if decode is not None and [float(x) for x in decode] != [0.0, 1.0] * (len(decode) // 2): + raise filestrip.LocationRemains("an image in this PDF uses a decode range formDAM cannot rebuild") + copier.take(width * height * 4) + with Image.open(io.BytesIO(value._data)) as img: + if img.size != (width, height): + raise filestrip.LocationRemains("an image in this PDF does not match its stated size") + img.load() + pixels = img.convert("L" if img.mode in ("L", "1", "I", "I;16") else "RGB") + fresh = io.BytesIO() + pixels.save(fresh, "JPEG", quality=95) + stream = StreamObject() + stream.update(_copy_dict(copier, value, STREAM_KEYS | {"/ColorSpace", "/Decode", "/Mask", "/BitsPerComponent"})) + stream[NameObject("/ColorSpace")] = NameObject("/DeviceGray" if pixels.mode == "L" else "/DeviceRGB") + stream[NameObject("/BitsPerComponent")] = NumberObject(8) + stream[NameObject("/Filter")] = NameObject("/DCTDecode") + stream._data = fresh.getvalue() + return stream + + +def verify(data: bytes) -> None: from pypdf import PdfReader + from pypdf.generic import IndirectObject reader = PdfReader(io.BytesIO(data), strict=False) - if reader.is_encrypted: + if reader.is_encrypted or "/Info" in reader.trailer: raise filestrip.LocationRemains("the clean copy could not be checked") - if "/Info" in reader.trailer: - _check_info(reader.trailer["/Info"].get_object()) - objects = list(_all_objects(reader)) - known = _known_streams(objects) - budget = _Budget() - covered = True - for num, obj in objects: - covered = _check(obj, budget, num in known) and covered - return covered - - -def _check_info(info: Any) -> None: - for key, value in info.items(): - if any(word in str(key).lower() for word in LOCATION_WORDS): - raise filestrip.LocationRemains("the clean copy still names a location") - if filestrip.text_located(str(value.get_object()).encode("utf-8", "ignore")): - raise filestrip.LocationRemains("the clean copy still names a location") - - -def _all_objects(reader: Any) -> Iterator[Tuple[int, Any]]: - from pypdf.generic import IndirectObject - numbers = {(num, gen) for gen, table in reader.xref.items() for num in table} numbers.update((num, 0) for num in reader.xref_objStm) if len(numbers) > MAX_OBJECTS: raise filestrip.LocationRemains("the clean copy holds too many objects to check") for num, gen in sorted(numbers): - yield num, IndirectObject(num, gen, reader).get_object() + _check(IndirectObject(num, gen, reader).get_object()) -def _known_streams(objects: List[Tuple[int, Any]]) -> Set[int]: - from pypdf.generic import ArrayObject, DictionaryObject - - known: Set[int] = set() - for _num, obj in objects: - if not isinstance(obj, DictionaryObject): - continue - keys = [key for key in FONT_KEYS if key in obj] - if obj.get("/Type") == "/Page" and "/Contents" in obj: - keys.append("/Contents") - for key in keys: - value = obj.raw_get(key) - listed = value.get_object() if _is_ref(value) else value - known.update(item.idnum for item in (listed if isinstance(listed, ArrayObject) else [value]) if _is_ref(item)) - return known - - -def _check(obj: Any, budget: _Budget, known: bool) -> bool: - from pypdf.generic import ArrayObject, DictionaryObject, StreamObject +def _check(obj: Any) -> None: + from pypdf.generic import ArrayObject, DictionaryObject, IndirectObject, StreamObject if isinstance(obj, DictionaryObject): for key, value in obj.items(): - if key in DROPPED_KEYS or any(word in str(key).lower() for word in LOCATION_WORDS): - raise filestrip.LocationRemains("the clean copy still carries metadata or an attachment") - if not _is_ref(value): - _check(value, budget, False) - if obj.get("/Subtype") == "/FileAttachment" or obj.get("/Type") == "/EmbeddedFile": - raise filestrip.LocationRemains("the clean copy still carries an attachment") + if key in DROPPED_KEYS - {"/Parent"} or any(word in str(key).lower() for word in LOCATION_WORDS): + raise filestrip.LocationRemains("the clean copy still carries metadata") + if not isinstance(value, IndirectObject): + _check(value) elif isinstance(obj, ArrayObject): for value in obj: - if not _is_ref(value): - _check(value, budget, False) + if not isinstance(value, IndirectObject): + _check(value) elif isinstance(obj, (str, bytes)): - raw = obj if isinstance(obj, bytes) else obj.encode("utf-8", "ignore") - if filestrip.text_located(raw): - raise filestrip.LocationRemains("the clean copy still names a location") + _check_bytes(obj if isinstance(obj, bytes) else obj.encode("utf-8", "ignore")) if isinstance(obj, StreamObject): - return _check_stream(obj, budget, known) - return True + _check_stream(obj) -def _check_stream(obj: Any, budget: _Budget, known: bool) -> bool: - filters = _filters(obj) - raw = obj._data - budget.take(len(raw)) - if obj.get("/Type") == "/Metadata" or obj.get("/Subtype") == "/XML": - raise filestrip.LocationRemains("the clean copy still carries an XMP stream") +def _check_stream(obj: Any) -> None: image = obj.get("/Subtype") == "/Image" - if filters and filters[-1] in IMAGE_FILTERS: - return _check_coded_image(obj, filters, raw, image) - plain = obj.get_data() - budget.take(len(plain)) - if filestrip.text_located(plain): - raise filestrip.LocationRemains("the clean copy still names a location") - if not image and (plain.startswith(CONTAINER_MAGIC) or plain[4:8] == b"ftyp"): + if _filters(obj) == ["/DCTDecode"]: + if not image or filestrip.raster_located(obj._data) is not False: + raise filestrip.LocationRemains("an image in the clean copy still carries a location") + _check_bytes(obj._data, image=True) + return + _check_bytes(obj.get_data(), image=image) + + +def _check_bytes(data: bytes, image: bool = False) -> None: + if filestrip.text_located(data) or any(mark in data for mark in METADATA_MARKS): + raise filestrip.LocationRemains("the clean copy still carries a location or photo metadata") + if not image and (data.startswith(CONTAINER_MAGIC) or data[4:8] == b"ftyp"): raise filestrip.LocationRemains("the clean copy carries an embedded file formDAM cannot check") - drawn = obj.get("/Subtype") == "/Form" or "/PatternType" in obj or "/ShadingType" in obj or obj.get("/Type") == "/CMap" - return known or image or drawn or plain[36:40] == b"acsp" - - -def _check_coded_image(obj: Any, filters: List[str], raw: bytes, image: bool) -> bool: - if len(filters) > 1 or not image: - raise filestrip.LocationRemains("an image in the clean copy is encoded in a way formDAM cannot check") - if filters == ["/DCTDecode"]: - if filestrip.raster_located(raw) is not False or _jpeg(raw) != raw: - raise filestrip.LocationRemains("an embedded JPEG still carries metadata") - return True - if filters == ["/JPXDecode"]: - if not pdfimages.jpx_clean(raw) or filestrip.text_located(raw): - raise filestrip.LocationRemains("an embedded JPEG 2000 image carries metadata or cannot be read") - return False - return True diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index f99e5dc..4f44cc9 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -448,77 +448,112 @@ def image_xobject(writer, page, data, filt, size=16): NameObject("/ColorSpace"): NameObject("/DeviceRGB"), NameObject("/BitsPerComponent"): NumberObject(8), NameObject("/Filter"): NameObject(filt)}) page[NameObject("/Resources")] = DictionaryObject({NameObject("/XObject"): DictionaryObject({NameObject("/Im0"): writer._add_object(image)})}) + page[NameObject("/Contents")] = stream_of(writer, b"q 16 0 0 16 0 0 cm /Im0 Do Q") -def test_pdf_attachments_are_removed_and_unknown_embedded_files_refused(tmp_path): +def stream_of(writer, data, **fields): + from pypdf.generic import DecodedStreamObject, NameObject + + stream = DecodedStreamObject() + stream.set_data(data) + for key, value in fields.items(): + stream[NameObject(f"/{key}")] = value + return writer._add_object(stream) + + +def located_tiff(): + out = io.BytesIO() + exif = Image.Exif() + exif.get_ifd(0x8825).update({1: "N", 2: (51.0, 30.0, 0.0), 3: "W", 4: (0.0, 7.0, 0.0)}) + Image.new("RGB", (4, 4)).save(out, "TIFF", exif=exif) + return out.getvalue() + + +def test_pdf_attachments_and_unreached_objects_are_left_out(tmp_path): from pypdf import PdfReader - from pypdf.generic import ArrayObject, DecodedStreamObject, DictionaryObject, NameObject, TextStringObject + from pypdf.generic import ArrayObject, DictionaryObject, NameObject, NumberObject, TextStringObject from app.services import filestrip photo = located_jpeg(tmp_path / "photo.jpg").read_bytes() + tiff = located_tiff() def attach(writer, page): writer.add_attachment("photo.jpg", photo) - held = DecodedStreamObject() - held.set_data(photo) - held[NameObject("/Type")] = NameObject("/EmbeddedFile") spec = DictionaryObject({NameObject("/Type"): NameObject("/Filespec"), NameObject("/F"): TextStringObject("p.jpg"), - NameObject("/EF"): DictionaryObject({NameObject("/F"): writer._add_object(held)})}) + NameObject("/EF"): DictionaryObject({NameObject("/F"): stream_of(writer, photo)})}) note = DictionaryObject({NameObject("/Type"): NameObject("/Annot"), NameObject("/Subtype"): NameObject("/FileAttachment"), NameObject("/Rect"): ArrayObject(), NameObject("/FS"): writer._add_object(spec)}) page[NameObject("/Annots")] = ArrayObject([writer._add_object(note)]) + page[NameObject("/Extra")] = stream_of(writer, tiff) + profile = stream_of(writer, b"\x00" * 36 + b"acsp" + tiff, N=NumberObject(3)) + fake = DictionaryObject({NameObject("/FontFile2"): stream_of(writer, tiff)}) + page[NameObject("/Resources")] = DictionaryObject({ + NameObject("/ColorSpace"): DictionaryObject({NameObject("/CS0"): ArrayObject([NameObject("/ICCBased"), profile])}), + NameObject("/Properties"): DictionaryObject({NameObject("/P0"): writer._add_object(fake)})}) + page[NameObject("/Contents")] = stream_of(writer, b"/CS0 cs /P0 BDC EMC") + writer.root_object[NameObject("/OpenAction")] = DictionaryObject({NameObject("/S"): NameObject("/JavaScript"), + NameObject("/JS"): TextStringObject("app.alert(1)")}) clean = filestrip.clean_member("a.pdf", pdf_with(tmp_path, attach)) reader = PdfReader(io.BytesIO(clean)) - assert reader.attachments == {} and b"Exif" not in clean and b"EmbeddedFile" not in clean - assert reader.pages[0].get("/Annots", []) == [] + assert reader.attachments == {} and "/Annots" not in reader.pages[0] and "/OpenAction" not in reader.trailer["/Root"] + for mark in (b"Exif", b"acsp", b"II*", b"EmbeddedFile", b"JavaScript"): + assert mark not in clean + assert reader.pages[0]["/Resources"]["/ColorSpace"]["/CS0"] == "/DeviceRGB" - def smuggle(writer, page): - blob = DecodedStreamObject() - blob.set_data(b"\x89PNG\r\n\x1a\n" + b"\x00" * 32) - page[NameObject("/Extra")] = writer._add_object(blob) - with pytest.raises(filestrip.LocationRemains): - filestrip.clean_member("a.pdf", pdf_with(tmp_path, smuggle)) +def test_pdf_located_data_reached_through_real_resources_is_refused(tmp_path): + from pypdf.generic import ArrayObject, DictionaryObject, NameObject, NumberObject + + from app.services import filestrip + + tiff = located_tiff() + + def in_font(writer, page): + descriptor = DictionaryObject({NameObject("/Type"): NameObject("/FontDescriptor"), + NameObject("/FontFile2"): stream_of(writer, tiff)}) + font = DictionaryObject({NameObject("/Type"): NameObject("/Font"), NameObject("/Subtype"): NameObject("/TrueType"), + NameObject("/BaseFont"): NameObject("/Spoof"), NameObject("/FontDescriptor"): writer._add_object(descriptor)}) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/Font"): DictionaryObject({NameObject("/F1"): writer._add_object(font)})}) + page[NameObject("/Contents")] = stream_of(writer, b"BT /F1 12 Tf (a) Tj ET") + def in_form(writer, page): + form = stream_of(writer, tiff, Type=NameObject("/XObject"), Subtype=NameObject("/Form"), + BBox=ArrayObject([NumberObject(0)] * 4)) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/XObject"): DictionaryObject({NameObject("/Fm0"): form})}) + page[NameObject("/Contents")] = stream_of(writer, b"/Fm0 Do") -def test_jpeg_segments_after_the_first_scan_are_dropped(tmp_path): - from app.services import filestrip, pdfimages + for build in (in_font, in_form): + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", pdf_with(tmp_path, build)) + + +def test_pdf_images_are_rebuilt_from_their_pixels(tmp_path): + from pypdf import PdfReader + + from app.services import filestrip plain = io.BytesIO() - Image.new("RGB", (24, 24), (10, 120, 30)).save(plain, "JPEG", progressive=True) + Image.new("RGB", (16, 16), (10, 120, 30)).save(plain, "JPEG", progressive=True) data = plain.getvalue() late = b"\xff\xe1" + struct.pack(">H", 2 + 18) + b"Exif\x00\x00GPSLatitude!" + b"\xff\xfe\x00\x06note" scan = data.index(b"\xff\xda") second = data.index(b"\xff\xc4", scan) if b"\xff\xc4" in data[scan:] else data.rindex(b"\xff\xd9") hidden = data[:second] + late + data[second:] + b"\xff\xd8\xff\xe1trailing" - clean = pdfimages.strip_jpeg(hidden) - assert b"Exif" not in clean and b"note" not in clean and b"trailing" not in clean - assert Image.open(io.BytesIO(clean)).size == (24, 24) and filestrip.raster_located(clean) is False - with pytest.raises(pdfimages.ImageUnchecked): - pdfimages.strip_jpeg(data[:scan + 20]) - - -def test_jpeg_2000_images_pass_only_with_plain_boxes_and_never_vouch_for_a_location(tmp_path): - from app.services import filestrip - coded = io.BytesIO() Image.new("RGB", (16, 16), (9, 9, 9)).save(coded, "JPEG2000") - jp2 = coded.getvalue() - tagged = jp2 + struct.pack(">I4s", 8 + 12, b"xml ") + b"taggedI4s", 8 + 12, b"xml ") + b"tagged Date: Sun, 29 Nov 2026 14:59:15 -0500 Subject: [PATCH 24/35] fix: PDF rebuild copies only known kinds of object 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. --- LICENSES.md | 2 +- backend/HASHOUT_LOG.md | 9 + backend/app/services/pdfcopy.py | 276 ++++++++++++++++++++++++++++ backend/app/services/pdfstrip.py | 208 +++------------------ backend/tests/test_formats_extra.py | 64 +++++++ 5 files changed, 372 insertions(+), 187 deletions(-) create mode 100644 backend/app/services/pdfcopy.py diff --git a/LICENSES.md b/LICENSES.md index d68660f..1515e53 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -49,7 +49,7 @@ Adobe, Bridge, Lightroom and Photoshop are either registered trademarks or trade | fonttools 4.69.1 | MIT | font names, glyph counts, outlines and variable axes for the font resource facts (services/fontres.py), and WOFF and WOFF2 unpacking before a font is checked for location (services/filestrip.py) | | brotli 1.2.1 | MIT | WOFF2 decompression under fontTools | | pypdfium2 5.15.2 | Apache-2.0 OR BSD-3-Clause (bindings); the bundled PDFium build BSD-3-Clause with its third-party parts (FreeType, libjpeg-turbo, OpenJPEG, Little CMS, zlib, ICU, Abseil and the like) under permissive licences listed in the wheel's LICENSES folder | PDF page count, text for search, first-page thumbnail and page images (services/docres.py). One shared library in the wheel, used under a process-wide lock because PDFium is not thread-safe | -| pypdf 7.2.0 | BSD-3-Clause | pure Python, no compiled parts. Writes the location-free copy of a PDF that leaves the library without its location (services/pdfstrip.py): document information and XMP metadata dropped, embedded JPEGs stripped of their EXIF and XMP segments, and the written copy read back and checked before it is used | +| pypdf 7.2.0 | BSD-3-Clause | pure Python, no compiled parts. Builds the location-free copy of a PDF that leaves the library without its location (services/pdfstrip.py, services/pdfcopy.py): a new document holding only the pages, their contents and the resources they use, images rebuilt from their pixels, and the written copy read back and checked before it is used | | pyzipper 0.4.0 | MIT | AES-256 (WinZip AE-2) zip writing and reading for encrypted share packages, services/packagesvc.py | | pycryptodomex (pyzipper dependency) | BSD-2-Clause and public domain | AES and HMAC under pyzipper | | LaMa inpainting (opencv/inpainting_lama, inpainting_lama_2025jan.onnx, revision aee6d22) | Apache-2.0 | Clean Up object removal in services/cleanup.py; fetched by the installers & build script, sha256-pinned, into backend/models; bundled via --add-data like the other models. Without it Clean Up falls back to OpenCV Telea | diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 9b6bab5..b22ae4e 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,14 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/pdfcopy.py, pdfstrip.py · the rebuild copies only known kinds and refuses the rest +- refers-to: pdfcopy (new) Copier content, resources, copy, dictionary, array, stream, image, samples, recode, sniff, the key allowlists FONT, DESCRIPTOR, FONT_PROGRAM, FORM, PATTERN, SHADING, FUNCTION, IMAGE, PLAIN; pdfstrip _rebuild, _copy_page, verify, _check_stream; tests/test_formats_extra.py raw_image and the raw sample, inline image, unknown stream and key allowlist tests +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +Refines the entry below. Every dictionary is copied through an allowlist chosen by what it is (font, font descriptor, font program, form, pattern, shading, function, image, or the plain set for graphics states, groups, soft masks, encodings, CID system info and calibrated colour spaces); any other key is dropped, so a ToUnicode map, a CIDToGIDMap stream or a private key never reaches the copy. A stream is copied only when it is one of the known kinds, and the rebuild refuses the PDF on any other: page and form contents (tiling patterns and Type 3 glyph procedures count as contents), images, and font programs reached through a font descriptor's FontFile, FontFile2 or FontFile3 that start like a Type 1, TrueType, CFF or OpenType font. Function and shading streams, embedded CMaps and anything else refuse. Indexed colour tables become strings. Contents are parsed with pypdf's ContentStream and any inline image refuses the page, filtered or not. Images whose data are raw samples are checked to hold exactly rows times ceil(width times components times bits / 8) bytes, read into Pillow (1-bit, grey, RGB or CMYK at 8 bits; anything else refuses) and written as fresh bytes. Every copied string, content stream, font program and image is searched anywhere in its bytes for an Exif header, a PNG, ZIP, PDF, RIFF, GIF, PSD or JPEG 2000 signature, an ISO-BMFF ftyp box, a TIFF header with the usual first offset and an XMP packet, as well as for GPS values; a match refuses the PDF. Long, specific signatures keep chance matches in pixel or font data rare, and a chance match only refuses. + +Because the rebuild refuses whatever it does not recognise, a copy that is written at all holds only those known kinds, and the read-back check also refuses a catalog with anything but /Type and /Pages and any stream not written by the rebuild (Flate, or DCT for a recoded image). That is why strip_file treats a PDF clean copy as verified whenever it succeeds. The cost is that more PDFs are refused: scans with CCITT or JBIG2 images, images at 2, 4 or 16 bits, Separation or DeviceN images, sampled or PostScript functions, mesh shadings and PDFs with inline images. + ### services/pdfstrip.py · the PDF clean copy is rebuilt from the pages, not cloned - refers-to: pdfstrip _rebuild, _copy_page, _copy_resources, _copy, _copy_stream, _copy_image, _recode_image, verify, _check_bytes; pdfimages removed; filestrip strip_file verified; tests/test_formats_extra.py stream_of, located_tiff, unreached objects, real resources, rebuilt images - kind: fix diff --git a/backend/app/services/pdfcopy.py b/backend/app/services/pdfcopy.py new file mode 100644 index 0000000..6ffab89 --- /dev/null +++ b/backend/app/services/pdfcopy.py @@ -0,0 +1,276 @@ +import io +import math +import re +from typing import Any, Dict, FrozenSet, List, Optional + +from . import filestrip + +DECODE_CAP = 256 * 1024 * 1024 +MAX_OBJECTS = 200_000 +MAX_PIXELS = 64 * 1024 * 1024 +NAME_TOKEN = re.compile(rb"/([^\s/\[\]()<>{}%]+)") +RESOURCE_KEYS = ("/Font", "/XObject", "/ColorSpace", "/Pattern", "/Shading", "/ExtGState") +RAW_FILTERS = {"/FlateDecode", "/Fl", "/LZWDecode", "/LZW", "/RunLengthDecode", "/RL", "/ASCII85Decode", "/A85", + "/ASCIIHexDecode", "/AHx"} +CODED_FILTERS = {"/DCTDecode", "/DCT", "/JPXDecode"} +DEVICE_BY_N = {1: "/DeviceGray", 3: "/DeviceRGB", 4: "/DeviceCMYK"} +COMPONENTS = {"/DeviceGray": 1, "/G": 1, "/DeviceRGB": 3, "/RGB": 3, "/DeviceCMYK": 4, "/CMYK": 4} +SAMPLE_MODES = {(1, 1): "1", (1, 8): "L", (3, 8): "RGB", (4, 8): "CMYK"} +FONT_PROGRAMS = { + "/FontFile": (b"%!",), + "/FontFile2": (b"\x00\x01\x00\x00", b"true"), + "/FontFile3": (b"\x01\x00", b"OTTO", b"\x00\x01\x00\x00"), +} +EMBEDDED_MARKS = (b"Exif\x00\x00", b"\x89PNG\r\n\x1a\n", b"PK\x03\x04", b"%PDF-", b"ftyp", b"RIFF", b"GIF87a", b"GIF89a", + b"II*\x00\x08\x00\x00\x00", b"MM\x00*\x00\x00\x00\x08", b"\x00\x00\x00\x0cjP ", b"8BPS", + b" FrozenSet[str]: + return frozenset(f"/{name}" for name in names) + + +FONT = _keys("Type", "Subtype", "BaseFont", "FirstChar", "LastChar", "Widths", "FontDescriptor", "Encoding", + "DescendantFonts", "CIDSystemInfo", "DW", "W", "DW2", "W2", "FontBBox", "FontMatrix", "CharProcs", + "Resources", "Name") +DESCRIPTOR = _keys("Type", "FontName", "FontFamily", "FontStretch", "FontWeight", "Flags", "FontBBox", "ItalicAngle", + "Ascent", "Descent", "Leading", "CapHeight", "XHeight", "StemV", "StemH", "AvgWidth", "MaxWidth", + "MissingWidth", "FontFile", "FontFile2", "FontFile3", "CharSet", "Style", "Lang", "FD") +FONT_PROGRAM = _keys("Length1", "Length2", "Length3", "Subtype") +FORM = _keys("Type", "Subtype", "BBox", "Matrix", "Resources", "Group", "FormType") +PATTERN = _keys("Type", "PatternType", "PaintType", "TilingType", "BBox", "XStep", "YStep", "Resources", "Matrix", + "Shading", "ExtGState") +SHADING = _keys("ShadingType", "ColorSpace", "Background", "BBox", "AntiAlias", "Coords", "Domain", "Function", "Extend", + "Matrix") +FUNCTION = _keys("FunctionType", "Domain", "Range", "C0", "C1", "N", "Functions", "Bounds", "Encode") +IMAGE = _keys("Type", "Subtype", "Width", "Height", "ColorSpace", "BitsPerComponent", "ImageMask", "Mask", "Decode", + "Interpolate", "SMask", "Intent") +PLAIN = _keys("Type", "LW", "LC", "LJ", "ML", "D", "RI", "OP", "op", "OPM", "Font", "FL", "SM", "SA", "BM", "SMask", "CA", + "ca", "AIS", "TK", "S", "G", "BC", "CS", "I", "K", "BaseEncoding", "Differences", "Registry", "Ordering", + "Supplement", "WhitePoint", "BlackPoint", "Gamma", "Matrix", "Range") + + +class Copier: + def __init__(self, writer: Any) -> None: + self.writer = writer + self.memo: Dict[Any, Any] = {} + self.left = DECODE_CAP + + def take(self, size: int) -> None: + self.left -= size + if self.left < 0: + raise filestrip.LocationRemains("a PDF expands past the size limit") + if len(self.memo) > MAX_OBJECTS: + raise filestrip.LocationRemains("this PDF holds too many objects to check") + + def content(self, data: bytes) -> bytes: + from pypdf.generic import ContentStream, DecodedStreamObject + + self.take(len(data)) + holder = DecodedStreamObject() + holder.set_data(data) + if any(operator == b"INLINE IMAGE" for _operands, operator in ContentStream(holder, None).operations): + raise refused("a page draws an inline image") + sniff(data) + return data + + def resources(self, resources: Any, content: bytes) -> Any: + from pypdf.generic import ArrayObject, DictionaryObject, NameObject + + used = {b"/" + token for token in NAME_TOKEN.findall(content)} + out = DictionaryObject() + for key in RESOURCE_KEYS: + group = resources.get(key) + group = group.get_object() if group is not None else None + if not isinstance(group, DictionaryObject): + continue + kept = DictionaryObject() + for name in group: + if str(name).encode("latin-1", "replace") in used: + kept[NameObject(name)] = self.copy(group.raw_get(name)) + out[NameObject(key)] = kept + out[NameObject("/ProcSet")] = ArrayObject([NameObject(n) for n in ("/PDF", "/Text", "/ImageB", "/ImageC", "/ImageI")]) + return out + + def copy(self, value: Any, role: Optional[str] = None) -> Any: + from pypdf.generic import ArrayObject, DictionaryObject, IndirectObject, NullObject, StreamObject + + if isinstance(value, IndirectObject): + key = (value.idnum, value.generation) + if key not in self.memo: + slot = self.writer._add_object(NullObject()) + self.memo[key] = slot + self.take(0) + self.writer._replace_object(slot, self.copy(value.get_object(), role)) + return self.memo[key] + if isinstance(value, StreamObject): + return self.stream(value, role) + if isinstance(value, DictionaryObject): + return self.dictionary(value, role) + if isinstance(value, ArrayObject): + return self.array(value) + if isinstance(value, (str, bytes)): + sniff(value if isinstance(value, bytes) else value.encode("utf-8", "ignore")) + return value + + def dictionary(self, value: Any, role: Optional[str] = None, skip: FrozenSet[str] = frozenset()) -> Any: + from pypdf.generic import DictionaryObject, NameObject + + allowed = _allowed(value, role) + out = DictionaryObject() + for key in value: + if key in allowed and key not in skip: + out[NameObject(key)] = self.copy(value.raw_get(key), _child_role(value, key, role)) + return out + + def array(self, value: Any) -> Any: + from pypdf.generic import ArrayObject, ByteStringObject, NameObject + + if value and value[0] == "/ICCBased": + return NameObject(DEVICE_BY_N.get(int(value[1].get_object().get("/N", 3)), "/DeviceRGB")) + if value and value[0] == "/Indexed" and len(value) == 4: + lookup = value[3].get_object() + table = lookup.get_data() if hasattr(lookup, "get_data") else bytes(lookup) + sniff(table) + return ArrayObject([NameObject("/Indexed"), self.copy(value[1]), value[2], ByteStringObject(table)]) + return ArrayObject(self.copy(item) for item in value) + + def stream(self, value: Any, role: Optional[str]) -> Any: + from pypdf.generic import NameObject + + if value.get("/Subtype") == "/Image": + return self.image(value) + if role in FONT_PROGRAMS: + data = value.get_data() + self.take(len(data)) + if not data.startswith(FONT_PROGRAMS[role]): + raise refused("a font program is not a font") + sniff(data) + return new_stream(self.dictionary(value, "font-program"), data) + if role == "content" or value.get("/Subtype") == "/Form" or value.get("/PatternType") == 1: + data = self.content(value.get_data()) + fields = self.dictionary(value, "form", frozenset({"/Resources"})) + if "/Resources" in value: + fields[NameObject("/Resources")] = self.resources(value["/Resources"].get_object(), data) + return new_stream(fields, data) + raise refused("this PDF holds a stream formDAM cannot rebuild") + + def image(self, value: Any) -> Any: + width, height = int(value.get("/Width", 0)), int(value.get("/Height", 0)) + if width <= 0 or height <= 0 or width * height > MAX_PIXELS: + raise refused("an image in this PDF is too large or has no size") + found = filters(value) + if not set(found) <= RAW_FILTERS | CODED_FILTERS or (set(found) & CODED_FILTERS and len(found) > 1): + raise refused("an image in this PDF is encoded in a way formDAM cannot rebuild") + self.take(width * height * 4) + if set(found) & CODED_FILTERS: + return self.recode(value, width, height) + return self.samples(value, width, height) + + def samples(self, value: Any, width: int, height: int) -> Any: + from PIL import Image + + mask = bool(value.get("/ImageMask", False)) + depth = 1 if mask else int(value.get("/BitsPerComponent", 8)) + comps = 1 if mask else _components(value.get("/ColorSpace")) + mode = SAMPLE_MODES.get((comps, depth)) + data = value.get_data() + if mode is None or len(data) != height * math.ceil(width * comps * depth / 8): + raise refused("an image's samples do not match its size") + fresh = Image.frombytes(mode, (width, height), data).tobytes() + sniff(fresh) + return new_stream(self.dictionary(value, "image"), fresh) + + def recode(self, value: Any, width: int, height: int) -> Any: + from PIL import Image + from pypdf.generic import NameObject, NumberObject, StreamObject + + decode = value.get("/Decode") + if decode is not None and [float(x) for x in decode] != [0.0, 1.0] * (len(decode) // 2): + raise refused("an image in this PDF uses a decode range formDAM cannot rebuild") + with Image.open(io.BytesIO(value._data)) as img: + if img.size != (width, height): + raise refused("an image in this PDF does not match its stated size") + img.load() + pixels = img.convert("L" if img.mode in ("L", "1", "I", "I;16") else "RGB") + fresh = io.BytesIO() + pixels.save(fresh, "JPEG", quality=95) + stream = StreamObject() + stream.update(self.dictionary(value, "image", frozenset({"/ColorSpace", "/Decode", "/Mask", "/BitsPerComponent"}))) + stream[NameObject("/ColorSpace")] = NameObject("/DeviceGray" if pixels.mode == "L" else "/DeviceRGB") + stream[NameObject("/BitsPerComponent")] = NumberObject(8) + stream[NameObject("/Filter")] = NameObject("/DCTDecode") + stream._data = fresh.getvalue() + sniff(stream._data) + return stream + + +def _allowed(value: Any, role: Optional[str]) -> FrozenSet[str]: + if role == "font-program": + return FONT_PROGRAM + if role == "image" or value.get("/Subtype") == "/Image": + return IMAGE + if role == "form" or value.get("/Subtype") == "/Form": + return PATTERN | FORM if "/PatternType" in value else FORM + if role == "charprocs": + return frozenset(value.keys()) + kind = value.get("/Type") + if kind == "/Font": + return FONT + if kind == "/FontDescriptor": + return DESCRIPTOR + if "/PatternType" in value: + return PATTERN + if "/ShadingType" in value: + return SHADING + if "/FunctionType" in value: + return FUNCTION + return PLAIN + + +def _child_role(value: Any, key: str, role: Optional[str]) -> Optional[str]: + if key in FONT_PROGRAMS and value.get("/Type") == "/FontDescriptor": + return key + if key == "/CharProcs": + return "charprocs" + if role == "charprocs": + return "content" + return None + + +def _components(space: Any) -> int: + space = space.get_object() if space is not None else None + if isinstance(space, list) and space: + if space[0] == "/ICCBased": + return int(space[1].get_object().get("/N", 0)) + if space[0] == "/Indexed": + return 1 + return 0 + return COMPONENTS.get(str(space), 0) + + +def filters(value: Any) -> List[str]: + found = value.get("/Filter") + if found is None: + return [] + found = found.get_object() + return [str(item) for item in found] if isinstance(found, list) else [str(found)] + + +def new_stream(fields: Any, data: bytes) -> Any: + from pypdf.generic import DecodedStreamObject, NameObject + + stream = DecodedStreamObject() + for key, item in dict(fields).items(): + stream[NameObject(key)] = item + stream.set_data(data) + return stream.flate_encode() + + +def sniff(data: bytes) -> None: + if filestrip.text_located(data) or any(mark in data for mark in EMBEDDED_MARKS): + raise refused("this PDF carries a location, photo metadata or an embedded file") + + +def refused(reason: str) -> filestrip.LocationRemains: + return filestrip.LocationRemains(reason) diff --git a/backend/app/services/pdfstrip.py b/backend/app/services/pdfstrip.py index aa5cf91..318bb98 100644 --- a/backend/app/services/pdfstrip.py +++ b/backend/app/services/pdfstrip.py @@ -1,45 +1,14 @@ import io import logging -import re -from typing import Any, Dict, List, Optional, Set +from typing import Any -from . import filestrip, zipsafe +from . import filestrip, pdfcopy, zipsafe logger = logging.getLogger(__name__) -DECODE_CAP = 256 * 1024 * 1024 -MAX_OBJECTS = 200_000 -MAX_PIXELS = 64 * 1024 * 1024 PAGE_KEYS = ("/CropBox", "/BleedBox", "/TrimBox", "/ArtBox", "/Rotate", "/UserUnit", "/Group") -RESOURCE_KEYS = ("/Font", "/XObject", "/ColorSpace", "/Pattern", "/Shading", "/ExtGState") -PROC_SET = ("/PDF", "/Text", "/ImageB", "/ImageC", "/ImageI") -DROPPED_KEYS = {"/Metadata", "/PieceInfo", "/AF", "/EF", "/EmbeddedFiles", "/JS", "/JavaScript", "/AA", "/A", - "/OpenAction", "/URI", "/Annots", "/Parent", "/OC", "/OPI", "/Measure", "/PtData", "/VP", "/StructParent", - "/StructParents", "/Properties", "/Names", "/Dests", "/Outlines", "/LastModified", "/AcroForm"} -STREAM_KEYS = {"/Length", "/Filter", "/DecodeParms", "/F", "/FFilter", "/FDecodeParms", "/DL"} -RAW_FILTERS = {"/FlateDecode", "/Fl", "/LZWDecode", "/LZW", "/RunLengthDecode", "/RL", "/ASCII85Decode", "/A85", - "/ASCIIHexDecode", "/AHx"} -CODED_FILTERS = {"/DCTDecode", "/DCT", "/JPXDecode"} LOCATION_WORDS = ("gps", "latitude", "longitude", "location", "geo") -DEVICE_BY_N = {1: "/DeviceGray", 3: "/DeviceRGB", 4: "/DeviceCMYK"} -CONTAINER_MAGIC = (b"\xff\xd8", b"\x89PNG", b"II*\x00", b"MM\x00*", b"PK\x03\x04", b"%PDF-", b"RIFF", b"GIF8", - b"\x00\x00\x00\x0cjP ", b"\xff\x4f\xff\x51") -METADATA_MARKS = (b"Exif\x00", b"{}%]+)") - - -class _Copier: - def __init__(self, writer: Any) -> None: - self.writer = writer - self.memo: Dict[Any, Any] = {} - self.left = DECODE_CAP - - def take(self, size: int) -> None: - self.left -= size - if self.left < 0: - raise filestrip.LocationRemains("a PDF expands past the size limit") - if len(self.memo) > MAX_OBJECTS: - raise filestrip.LocationRemains("this PDF holds too many objects to check") +OUTPUT_FILTERS = (["/FlateDecode"], ["/DCTDecode"]) def clean_pdf(name: str, data: bytes) -> bytes: @@ -74,7 +43,7 @@ def _rebuild(reader: Any) -> bytes: writer = PdfWriter() writer.metadata = None - copier = _Copier(writer) + copier = pdfcopy.Copier(writer) for source in reader.pages: _copy_page(copier, source) out = io.BytesIO() @@ -82,149 +51,21 @@ def _rebuild(reader: Any) -> bytes: return out.getvalue() -def _copy_page(copier: _Copier, source: Any) -> None: +def _copy_page(copier: pdfcopy.Copier, source: Any) -> None: from pypdf.generic import NameObject box = source.mediabox page = copier.writer.add_blank_page(float(box.width), float(box.height)) - page[NameObject("/MediaBox")] = _copy(copier, source.mediabox) + page[NameObject("/MediaBox")] = copier.copy(source.mediabox) for key in PAGE_KEYS: if key in source: - page[NameObject(key)] = _copy(copier, source.raw_get(key)) + page[NameObject(key)] = copier.copy(source.raw_get(key)) contents = source.get_contents() - content = contents.get_data() if contents is not None else b"" - copier.take(len(content)) - page[NameObject("/Contents")] = copier.writer._add_object(_new_stream({}, content)) + content = copier.content(contents.get_data() if contents is not None else b"") + page[NameObject("/Contents")] = copier.writer._add_object(pdfcopy.new_stream({}, content)) resources = source.get("/Resources") if resources is not None: - page[NameObject("/Resources")] = _copy_resources(copier, resources.get_object(), content) - - -def _copy_resources(copier: _Copier, resources: Any, content: bytes) -> Any: - from pypdf.generic import ArrayObject, DictionaryObject, NameObject - - used = {b"/" + token for token in NAME_TOKEN.findall(content)} - out = DictionaryObject() - for key in RESOURCE_KEYS: - group = resources.get(key) - group = group.get_object() if group is not None else None - if not isinstance(group, DictionaryObject): - continue - kept = DictionaryObject() - for name in group: - if str(name).encode("latin-1", "replace") in used: - kept[NameObject(name)] = _copy(copier, group.raw_get(name)) - out[NameObject(key)] = kept - out[NameObject("/ProcSet")] = ArrayObject([NameObject(name) for name in PROC_SET]) - return out - - -def _copy(copier: _Copier, value: Any) -> Any: - from pypdf.generic import ArrayObject, DictionaryObject, IndirectObject, NullObject, StreamObject - - if isinstance(value, IndirectObject): - key = (value.idnum, value.generation) - if key not in copier.memo: - slot = copier.writer._add_object(NullObject()) - copier.memo[key] = slot - copier.take(0) - copier.writer._replace_object(slot, _copy(copier, value.get_object())) - return copier.memo[key] - if isinstance(value, StreamObject): - return _copy_stream(copier, value) - if isinstance(value, DictionaryObject): - return _copy_dict(copier, value) - if isinstance(value, ArrayObject): - return _copy_array(copier, value) - return value - - -def _copy_dict(copier: _Copier, value: Any, skip: Optional[Set[str]] = None) -> Any: - from pypdf.generic import DictionaryObject, NameObject - - out = DictionaryObject() - for key in value: - if key not in DROPPED_KEYS and not (skip and key in skip): - out[NameObject(key)] = _copy(copier, value.raw_get(key)) - return out - - -def _copy_array(copier: _Copier, value: Any) -> Any: - from pypdf.generic import ArrayObject, NameObject - - if value and value[0] == "/ICCBased": - profile = value[1].get_object() - return NameObject(DEVICE_BY_N.get(int(profile.get("/N", 3)), "/DeviceRGB")) - return ArrayObject(_copy(copier, item) for item in value) - - -def _copy_stream(copier: _Copier, value: Any) -> Any: - from pypdf.generic import NameObject - - if value.get("/Subtype") == "/Image": - return _copy_image(copier, value) - data = value.get_data() - copier.take(len(data)) - fields = _copy_dict(copier, value, STREAM_KEYS | {"/Resources"}) - if "/Resources" in value: - fields[NameObject("/Resources")] = _copy_resources(copier, value["/Resources"].get_object(), data) - return _new_stream(fields, data) - - -def _new_stream(fields: Any, data: bytes) -> Any: - from pypdf.generic import DecodedStreamObject, NameObject - - stream = DecodedStreamObject() - for key, item in dict(fields).items(): - stream[NameObject(key)] = item - stream.set_data(data) - return stream.flate_encode() - - -def _filters(value: Any) -> List[str]: - found = value.get("/Filter") - if found is None: - return [] - found = found.get_object() - return [str(item) for item in found] if isinstance(found, list) else [str(found)] - - -def _copy_image(copier: _Copier, value: Any) -> Any: - width, height = int(value.get("/Width", 0)), int(value.get("/Height", 0)) - if width <= 0 or height <= 0 or width * height > MAX_PIXELS: - raise filestrip.LocationRemains("an image in this PDF is too large or has no size") - filters = set(_filters(value)) - if not filters <= RAW_FILTERS | CODED_FILTERS or (filters & CODED_FILTERS and len(filters) > 1): - raise filestrip.LocationRemains("an image in this PDF is encoded in a way formDAM cannot rebuild") - if filters & CODED_FILTERS: - return _recode_image(copier, value, width, height) - data = value.get_data() - copier.take(len(data)) - return _new_stream(_copy_dict(copier, value, STREAM_KEYS), data) - - -def _recode_image(copier: _Copier, value: Any, width: int, height: int) -> Any: - from PIL import Image - from pypdf.generic import NameObject, NumberObject, StreamObject - - decode = value.get("/Decode") - if decode is not None and [float(x) for x in decode] != [0.0, 1.0] * (len(decode) // 2): - raise filestrip.LocationRemains("an image in this PDF uses a decode range formDAM cannot rebuild") - copier.take(width * height * 4) - with Image.open(io.BytesIO(value._data)) as img: - if img.size != (width, height): - raise filestrip.LocationRemains("an image in this PDF does not match its stated size") - img.load() - pixels = img.convert("L" if img.mode in ("L", "1", "I", "I;16") else "RGB") - fresh = io.BytesIO() - pixels.save(fresh, "JPEG", quality=95) - stream = StreamObject() - stream.update(_copy_dict(copier, value, STREAM_KEYS | {"/ColorSpace", "/Decode", "/Mask", "/BitsPerComponent"})) - stream[NameObject("/ColorSpace")] = NameObject("/DeviceGray" if pixels.mode == "L" else "/DeviceRGB") - stream[NameObject("/BitsPerComponent")] = NumberObject(8) - stream[NameObject("/Filter")] = NameObject("/DCTDecode") - stream._data = fresh.getvalue() - return stream + page[NameObject("/Resources")] = copier.resources(resources.get_object(), content) def verify(data: bytes) -> None: @@ -232,11 +73,11 @@ def verify(data: bytes) -> None: from pypdf.generic import IndirectObject reader = PdfReader(io.BytesIO(data), strict=False) - if reader.is_encrypted or "/Info" in reader.trailer: + if reader.is_encrypted or "/Info" in reader.trailer or set(reader.trailer["/Root"]) != {"/Type", "/Pages"}: raise filestrip.LocationRemains("the clean copy could not be checked") numbers = {(num, gen) for gen, table in reader.xref.items() for num in table} numbers.update((num, 0) for num in reader.xref_objStm) - if len(numbers) > MAX_OBJECTS: + if len(numbers) > pdfcopy.MAX_OBJECTS: raise filestrip.LocationRemains("the clean copy holds too many objects to check") for num, gen in sorted(numbers): _check(IndirectObject(num, gen, reader).get_object()) @@ -247,8 +88,8 @@ def _check(obj: Any) -> None: if isinstance(obj, DictionaryObject): for key, value in obj.items(): - if key in DROPPED_KEYS - {"/Parent"} or any(word in str(key).lower() for word in LOCATION_WORDS): - raise filestrip.LocationRemains("the clean copy still carries metadata") + if any(word in str(key).lower() for word in LOCATION_WORDS): + raise filestrip.LocationRemains("the clean copy still names a location") if not isinstance(value, IndirectObject): _check(value) elif isinstance(obj, ArrayObject): @@ -256,23 +97,18 @@ def _check(obj: Any) -> None: if not isinstance(value, IndirectObject): _check(value) elif isinstance(obj, (str, bytes)): - _check_bytes(obj if isinstance(obj, bytes) else obj.encode("utf-8", "ignore")) + pdfcopy.sniff(obj if isinstance(obj, bytes) else obj.encode("utf-8", "ignore")) if isinstance(obj, StreamObject): _check_stream(obj) def _check_stream(obj: Any) -> None: - image = obj.get("/Subtype") == "/Image" - if _filters(obj) == ["/DCTDecode"]: - if not image or filestrip.raster_located(obj._data) is not False: + found = pdfcopy.filters(obj) + if found not in OUTPUT_FILTERS: + raise filestrip.LocationRemains("the clean copy holds a stream formDAM did not write") + if found == ["/DCTDecode"]: + if obj.get("/Subtype") != "/Image" or filestrip.raster_located(obj._data) is not False: raise filestrip.LocationRemains("an image in the clean copy still carries a location") - _check_bytes(obj._data, image=True) + pdfcopy.sniff(obj._data) return - _check_bytes(obj.get_data(), image=image) - - -def _check_bytes(data: bytes, image: bool = False) -> None: - if filestrip.text_located(data) or any(mark in data for mark in METADATA_MARKS): - raise filestrip.LocationRemains("the clean copy still carries a location or photo metadata") - if not image and (data.startswith(CONTAINER_MAGIC) or data[4:8] == b"ftyp"): - raise filestrip.LocationRemains("the clean copy carries an embedded file formDAM cannot check") + pdfcopy.sniff(obj.get_data()) diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index 4f44cc9..89b1db3 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -556,6 +556,70 @@ def test_pdf_images_are_rebuilt_from_their_pixels(tmp_path): assert image["/Filter"] == "/DCTDecode" and Image.open(io.BytesIO(image._data)).size == (16, 16) +def raw_image(writer, page, data, size=4): + from pypdf.generic import DictionaryObject, NameObject, NumberObject + + image = stream_of(writer, data, Type=NameObject("/XObject"), Subtype=NameObject("/Image"), Width=NumberObject(size), + Height=NumberObject(size), ColorSpace=NameObject("/DeviceRGB"), BitsPerComponent=NumberObject(8)) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/XObject"): DictionaryObject({NameObject("/Im0"): image})}) + page[NameObject("/Contents")] = stream_of(writer, b"q 4 0 0 4 0 0 cm /Im0 Do Q") + + +def test_pdf_raw_image_samples_are_checked_and_written_fresh(tmp_path): + from pypdf import PdfReader + + from app.services import filestrip + + pixels = bytes(range(48)) + clean = filestrip.clean_member("a.pdf", pdf_with(tmp_path, lambda w, p: raw_image(w, p, pixels))) + image = PdfReader(io.BytesIO(clean)).pages[0]["/Resources"]["/XObject"]["/Im0"].get_object() + assert image.get_data() == pixels and image["/Filter"] == "/FlateDecode" + hidden = located_tiff() + for data in (pixels + hidden, (hidden * 4)[:48], pixels[:47]): + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", pdf_with(tmp_path, lambda w, p, d=data: raw_image(w, p, d))) + + +def test_pdf_inline_images_and_unknown_streams_are_refused(tmp_path): + from pypdf.generic import ArrayObject, DictionaryObject, NameObject, NumberObject + + from app.services import filestrip + + def inline(writer, page): + page[NameObject("/Contents")] = stream_of(writer, b"q BI /W 1 /H 1 /CS /G /BPC 8 ID \x00 EI Q") + + def sampled(writer, page): + function = stream_of(writer, b"{ pop 0 }", FunctionType=NumberObject(4), Domain=ArrayObject([NumberObject(0), NumberObject(1)]), + Range=ArrayObject([NumberObject(0), NumberObject(1)])) + shading = DictionaryObject({NameObject("/ShadingType"): NumberObject(2), NameObject("/ColorSpace"): NameObject("/DeviceGray"), + NameObject("/Coords"): ArrayObject([NumberObject(0)] * 4), NameObject("/Function"): function}) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/Shading"): DictionaryObject({NameObject("/Sh0"): writer._add_object(shading)})}) + page[NameObject("/Contents")] = stream_of(writer, b"/Sh0 sh") + + for build in (inline, sampled): + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", pdf_with(tmp_path, build)) + + +def test_pdf_dictionaries_keep_only_known_keys(tmp_path): + from pypdf import PdfReader + from pypdf.generic import DictionaryObject, NameObject, TextStringObject + + from app.services import filestrip + + def font(writer, page): + cmap = stream_of(writer, b"begincmap endcmap") + face = DictionaryObject({NameObject("/Type"): NameObject("/Font"), NameObject("/Subtype"): NameObject("/Type1"), + NameObject("/BaseFont"): NameObject("/Helvetica"), NameObject("/ToUnicode"): cmap, + NameObject("/Note"): TextStringObject("taken at the harbour")}) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/Font"): DictionaryObject({NameObject("/F1"): writer._add_object(face)})}) + page[NameObject("/Contents")] = stream_of(writer, b"BT /F1 12 Tf 10 10 Td (Hi) Tj ET") + + clean = filestrip.clean_member("a.pdf", pdf_with(tmp_path, font)) + face = PdfReader(io.BytesIO(clean)).pages[0]["/Resources"]["/Font"]["/F1"].get_object() + assert set(face) == {"/Type", "/Subtype", "/BaseFont"} and b"harbour" not in clean + + def test_share_refusal_is_remembered(client, tmp_path, monkeypatch): from app.services import filestrip, gallerysvc From 3fcb547c81fd2b78a4c994d838d70dab26254f60 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:01:47 -0500 Subject: [PATCH 25/35] feat: third-party notices with full licence texts 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. --- .github/workflows/ci.yml | 2 + LICENSES.md | 4 +- THIRD-PARTY-NOTICES.txt | 33910 +++++++++++++++++++++++ backend/HASHOUT_LOG.md | 11 + backend/app/config.py | 8 + backend/app/routers/system.py | 18 +- backend/tests/test_notices.py | 15 + frontend/HASHOUT_LOG.md | 7 + frontend/src/styles/app.css | 2 + frontend/src/ui/components/notices.ts | 24 + frontend/src/ui/components/settings.ts | 4 +- setup/build_linux_app | 1 + setup/build_macos_app | 1 + setup/build_windows_app.bat | 1 + setup/notices.py | 335 + setup/notices_crates.py | 86 + src-tauri/tauri.conf.json | 3 +- 17 files changed, 34427 insertions(+), 5 deletions(-) create mode 100644 THIRD-PARTY-NOTICES.txt create mode 100644 backend/tests/test_notices.py create mode 100644 frontend/src/ui/components/notices.ts create mode 100644 setup/notices.py create mode 100644 setup/notices_crates.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8045835..a38605d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,8 @@ jobs: run: | npm ci npm test + - name: Third-party notices cover what ships + run: python setup/notices.py --check window: runs-on: ubuntu-latest diff --git a/LICENSES.md b/LICENSES.md index 1515e53..8d97c41 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -1,6 +1,6 @@ # formDAM license ledger -formDAM itself is Apache-2.0, copyright 2026 NodeAgentc, Inc. (see LICENSE and NOTICE.md; MIT until v1.27.5). Every dependency & binary that enters the tree is classified here before use, per dev-rules licensing policy. Runtime web deps are also tabled in README.md. +formDAM itself is Apache-2.0, copyright 2026 NodeAgentc, Inc. (see LICENSE and NOTICE.md; MIT until v1.27.5). Every dependency & binary that enters the tree is classified here before use, per dev-rules licensing policy. The full licence texts of everything shipped are in THIRD-PARTY-NOTICES.txt, written and checked by `setup/notices.py`. Runtime web deps are also tabled in README.md. ## Adobe DNG patent licence @@ -75,7 +75,7 @@ Tauri links these crates unedited (no `[patch]` and no vendored copy): | webpki-roots | CDLA-Permissive-2.0 | root certificates for TLS | | r-efi | MIT OR Apache-2.0 OR LGPL-2.1-or-later | used under MIT | -The Linux bundles also carry the build machine's WebKitGTK, GTK and GLib (LGPL-2.1-or-later) as separate shared libraries. This ledger and LICENSE ship inside every installer (`bundle.resources`). +The Linux bundles also carry the build machine's WebKitGTK, GTK and GLib (LGPL-2.1-or-later) as separate shared libraries. This ledger, LICENSE and THIRD-PARTY-NOTICES.txt ship inside every installer (`bundle.resources`); THIRD-PARTY-NOTICES.txt is also frozen into the engine, which shows it under Settings > App > About formDAM, Licences and notices. ## Build-time only (never distributed) diff --git a/THIRD-PARTY-NOTICES.txt b/THIRD-PARTY-NOTICES.txt new file mode 100644 index 0000000..3a15cd5 --- /dev/null +++ b/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,33910 @@ +formDAM third-party notices + +formDAM is Apache-2.0 (see LICENSE and NOTICE.md). This file holds the licence +texts of the third-party software that ships with it: the Python packages frozen +into the engine, the JavaScript packages built into the window, the Rust crates +compiled into the desktop shell, and the binaries the app downloads. LICENSES.md +is the human ledger with the reason each component is there. + +Generated by setup/notices.py from the installed packages, the lock files and +the cargo registry; regenerate it with `python3 setup/notices.py` and check it +with `python3 setup/notices.py --check`. Licence texts that are identical across +components are printed once, at the end, and referred to by number. + +============================================================================== +runtime: python 3.12.13 +Licence: PSF-2.0 +Source: https://www.python.org/ +[[ file LICENSE.txt: shared text T1 ]] + +============================================================================== +python: annotated-doc 0.0.7 +Licence: MIT +Source: https://github.com/fastapi/annotated-doc +[[ begin file annotated_doc-0.0.7.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2025 Sebastián Ramírez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file annotated_doc-0.0.7.dist-info/licenses/LICENSE ]] + +============================================================================== +python: annotated-types 0.8.0 +Licence: MIT +Source: https://github.com/annotated-types/annotated-types +[[ begin file annotated_types-0.8.0.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2022 the contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file annotated_types-0.8.0.dist-info/licenses/LICENSE ]] + +============================================================================== +python: anyio 4.16.0 +Licence: MIT +Source: https://anyio.readthedocs.io/en/latest/ +[[ begin file anyio-4.16.0.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2018 Alex Grönholm + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file anyio-4.16.0.dist-info/licenses/LICENSE ]] + +============================================================================== +python: brotli 1.2.1 +Licence: MIT +Source: https://github.com/google/brotli +[[ file brotli-1.2.1.dist-info/licenses/LICENSE: shared text T2 ]] + +============================================================================== +python: cffi 2.1.1 +Licence: MIT-0 +Source: https://cffi.readthedocs.io/ +[[ begin file cffi-2.1.1.dist-info/licenses/LICENSE ]] + +Except when otherwise stated (look for LICENSE files in directories or +information at the beginning of each file) all software and +documentation is licensed as follows: + + MIT No Attribution + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the + Software is furnished to do so. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +[[ end file cffi-2.1.1.dist-info/licenses/LICENSE ]] + +============================================================================== +python: click 8.5.1 +Licence: BSD-3-Clause +Source: https://click.palletsprojects.com/page/changes/ +[[ begin file click-8.5.1.dist-info/licenses/LICENSE.txt ]] +Copyright 2014 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file click-8.5.1.dist-info/licenses/LICENSE.txt ]] + +============================================================================== +python: cryptography 50.0.1 +Licence: Apache-2.0 OR BSD-3-Clause +Source: https://cryptography.io/en/latest/changelog/ +[[ begin file cryptography-50.0.1.dist-info/licenses/LICENSE ]] +This software is made available under the terms of *either* of the licenses +found in LICENSE.APACHE or LICENSE.BSD. Contributions to cryptography are made +under the terms of *both* these licenses. +[[ end file cryptography-50.0.1.dist-info/licenses/LICENSE ]] +[[ file cryptography-50.0.1.dist-info/licenses/LICENSE.APACHE: shared text T3 ]] +[[ begin file cryptography-50.0.1.dist-info/licenses/LICENSE.BSD ]] +Copyright (c) Individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of PyCA Cryptography nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file cryptography-50.0.1.dist-info/licenses/LICENSE.BSD ]] + +============================================================================== +python: exifread 3.5.1 +Licence: see the licence text +Source: https://github.com/ianare/exif-py +[[ begin file exifread-3.5.1.dist-info/licenses/LICENSE ]] + +Copyright (c) 2002-2007 Gene Cash +Copyright (c) 2007-2025 Ianaré Sévi and contributors + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + 3. Neither the name of the authors nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file exifread-3.5.1.dist-info/licenses/LICENSE ]] + +============================================================================== +python: fastapi 0.121.1 +Licence: MIT +Source: https://github.com/fastapi/fastapi +[[ begin file fastapi-0.121.1.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2018 Sebastián Ramírez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file fastapi-0.121.1.dist-info/licenses/LICENSE ]] + +============================================================================== +python: flatbuffers 25.12.19 +Licence: Apache 2.0 +Source: https://google.github.io/flatbuffers/ +Note: The distribution carries no licence file; its licence is given above. + +============================================================================== +python: fonttools 4.69.1 +Licence: MIT +Source: http://github.com/fonttools/fonttools +[[ begin file fonttools-4.69.1.dist-info/licenses/LICENSE ]] +MIT License + +Copyright (c) 2017 Just van Rossum + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file fonttools-4.69.1.dist-info/licenses/LICENSE ]] +[[ begin file fonttools-4.69.1.dist-info/licenses/LICENSE.external ]] +FontTools includes the following font projects for testing purposes, which are +under SIL Open Font License, Version 1.1: + +Lobster + Copyright (c) 2010, Pablo Impallari (www.impallari.com|impallari@gmail.com), + with Reserved Font Name Lobster. + This Font Software is licensed under the SIL Open Font License, Version 1.1. + +Noto Fonts + This Font Software is licensed under the SIL Open Font License, Version 1.1. + +XITS font project + Copyright (c) 2001-2010 by the STI Pub Companies, consisting of the American + Institute of Physics, the American Chemical Society, the American + Mathematical Society, the American Physical Society, Elsevier, Inc., and The + Institute of Electrical and Electronic Engineers, Inc. (www.stixfonts.org), + with Reserved Font Name STIX Fonts, STIX Fonts (TM) is a trademark of The + Institute of Electrical and Electronics Engineers, Inc. + + Portions copyright (c) 1998-2003 by MicroPress, Inc. + (www.micropress-inc.com), with Reserved Font Name TM Math. To obtain + additional mathematical fonts, please contact MicroPress, Inc., 68-30 Harrow + Street, Forest Hills, NY 11375, USA, Phone: (718) 575-1816. + + Portions copyright (c) 1990 by Elsevier, Inc. + + This Font Software is licensed under the SIL Open Font License, Version 1.1. + +Iosevka + Copyright (c) 2015-2020 Belleve Invis (belleve@typeof.net). + This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font +creation efforts of academic and linguistic communities, and to +provide a free and open framework in which fonts may be shared and +improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply to +any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software +components as distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, +deleting, or substituting -- in part or in whole -- any of the +components of the Original Version, by changing formats or by porting +the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, +modify, redistribute, and sell modified and unmodified copies of the +Font Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, in +Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the +corresponding Copyright Holder. This restriction only applies to the +primary font name as presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created using +the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +===== + +FontTools includes Adobe AGL & AGLFN, which is under 3-clauses BSD license: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the name of Adobe Systems Incorporated nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +===== + +FontTools includes cu2qu, which is Copyright 2016 Google Inc. All Rights Reserved. +Licensed under the Apache License, Version 2.0, a copy of which is reproduced below: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +===== + +FontTools includes code in `fontTools.misc.filesystem` which is derived from: + +PyFilesystem2 (i.e. the `fs` package) by Will McGugan +Licensed under the MIT License +https://github.com/PyFilesystem/pyfilesystem2 + +Copyright (c) 2017-2021 The PyFilesystem2 contributors +Copyright (c) 2016-2019 Will McGugan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file fonttools-4.69.1.dist-info/licenses/LICENSE.external ]] + +============================================================================== +python: h11 0.16.0 +Licence: MIT +Source: https://github.com/python-hyper/h11 +[[ begin file h11-0.16.0.dist-info/licenses/LICENSE.txt ]] +The MIT License (MIT) + +Copyright (c) 2016 Nathaniel J. Smith and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file h11-0.16.0.dist-info/licenses/LICENSE.txt ]] + +============================================================================== +python: idna 3.20 +Licence: BSD-3-Clause +Source: https://github.com/kjd/idna/blob/master/HISTORY.md +[[ begin file idna-3.20.dist-info/licenses/LICENSE.md ]] +BSD 3-Clause License + +Copyright (c) 2013-2026, Kim Davies and contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file idna-3.20.dist-info/licenses/LICENSE.md ]] + +============================================================================== +python: numpy 2.5.5 +Licence: BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0 +Source: https://numpy.org +[[ begin file numpy-2.5.5.dist-info/licenses/LICENSE.txt ]] +Copyright (c) 2005-2025, NumPy Developers. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the NumPy Developers nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---- + + +---- + +This binary distribution of NumPy also bundles the following software: + + +Name: OpenBLAS +Files: numpy/.dylibs/libscipy_openblas*.so +Description: bundled as a dynamically linked library +Availability: https://github.com/OpenMathLib/OpenBLAS/ +License: BSD-3-Clause + Copyright (c) 2011-2014, The OpenBLAS Project + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. Neither the name of the OpenBLAS project nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Name: LAPACK +Files: numpy/.dylibs/libscipy_openblas*.so +Description: bundled in OpenBLAS +Availability: https://github.com/OpenMathLib/OpenBLAS/ +License: BSD-3-Clause-Open-MPI + Copyright (c) 1992-2013 The University of Tennessee and The University + of Tennessee Research Foundation. All rights + reserved. + Copyright (c) 2000-2013 The University of California Berkeley. All + rights reserved. + Copyright (c) 2006-2013 The University of Colorado Denver. All rights + reserved. + + $COPYRIGHT$ + + Additional copyrights may follow + + $HEADER$ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer listed + in this license in the documentation and/or other materials + provided with the distribution. + + - Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + The copyright holders provide no reassurances that the source code + provided does not infringe any patent, copyright, or any other + intellectual property rights of third parties. The copyright holders + disclaim any liability to any recipient for claims brought against + recipient by any third party for infringement of that parties + intellectual property rights. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Name: GCC runtime library libgfortran +Files: numpy/.dylibs/libscipy_openblas*.so +Description: statically linked to files compiled with gcc +Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran +License: GPL-3.0-or-later WITH GCC-exception-3.1 + Copyright (C) 2002-2017 Free Software Foundation, Inc. + + Libgfortran is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + Libgfortran is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . + +---- + +Full text of license texts referred to above follows (that they are +listed below does not necessarily imply the conditions apply to the +present binary release): + +---- + +GCC RUNTIME LIBRARY EXCEPTION + +Version 3.1, 31 March 2009 + +Copyright (C) 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This GCC Runtime Library Exception ("Exception") is an additional +permission under section 7 of the GNU General Public License, version +3 ("GPLv3"). It applies to a given file (the "Runtime Library") that +bears a notice placed by the copyright holder of the file stating that +the file is governed by GPLv3 along with this Exception. + +When you use GCC to compile a program, GCC may combine portions of +certain GCC header files and runtime libraries with the compiled +program. The purpose of this Exception is to allow compilation of +non-GPL (including proprietary) programs to use, in this way, the +header files and runtime libraries covered by this Exception. + +0. Definitions. + +A file is an "Independent Module" if it either requires the Runtime +Library for execution after a Compilation Process, or makes use of an +interface provided by the Runtime Library, but is not otherwise based +on the Runtime Library. + +"GCC" means a version of the GNU Compiler Collection, with or without +modifications, governed by version 3 (or a specified later version) of +the GNU General Public License (GPL) with the option of using any +subsequent versions published by the FSF. + +"GPL-compatible Software" is software whose conditions of propagation, +modification and use would permit combination with GCC in accord with +the license of GCC. + +"Target Code" refers to output from any compiler for a real or virtual +target processor architecture, in executable form or suitable for +input to an assembler, loader, linker and/or execution +phase. Notwithstanding that, Target Code does not include data in any +format that is used as a compiler intermediate representation, or used +for producing a compiler intermediate representation. + +The "Compilation Process" transforms code entirely represented in +non-intermediate languages designed for human-written code, and/or in +Java Virtual Machine byte code, into Target Code. Thus, for example, +use of source code generators and preprocessors need not be considered +part of the Compilation Process, since the Compilation Process can be +understood as starting with the output of the generators or +preprocessors. + +A Compilation Process is "Eligible" if it is done using GCC, alone or +with other GPL-compatible software, or if it is done without using any +work based on GCC. For example, using non-GPL-compatible Software to +optimize any GCC intermediate representations would not qualify as an +Eligible Compilation Process. + +1. Grant of Additional Permission. + +You have permission to propagate a work of Target Code formed by +combining the Runtime Library with Independent Modules, even if such +propagation would otherwise violate the terms of GPLv3, provided that +all Target Code was generated by Eligible Compilation Processes. You +may then convey such a combination under terms of your choice, +consistent with the licensing of the Independent Modules. + +2. No Weakening of GCC Copyleft. + +The availability of this Exception does not imply any general +presumption that third-party software is unaffected by the copyleft +requirements of the license of GCC. + +---- + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. +[[ end file numpy-2.5.5.dist-info/licenses/LICENSE.txt ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/_core/include/numpy/libdivide/LICENSE.txt ]] + zlib License + ------------ + + Copyright (C) 2010 - 2019 ridiculous_fish, + Copyright (C) 2016 - 2019 Kim Walisch, + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/_core/include/numpy/libdivide/LICENSE.txt ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/_core/src/common/pythoncapi-compat/COPYING ]] +BSD Zero Clause License + +Copyright Contributors to the pythoncapi_compat project. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/_core/src/common/pythoncapi-compat/COPYING ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/_core/src/highway/LICENSE ]] +This project is primarily dual-licensed under your choice of either the Apache +License 2.0 or the BSD 3-Clause License. + +The following files are licensed under different terms: +* hwy/contrib/random/random-inl.h: CC0 1.0 Universal + +The full texts of all applicable licenses are included below, separated by +'---'. + +-------------------------------------------------------------------------------- +Apache License 2.0 +-------------------------------------------------------------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------------------------------------------------------------------- +BSD 3-Clause License +-------------------------------------------------------------------------------- + +Copyright (c) The Highway Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------------------- +CC0 1.0 Universal +-------------------------------------------------------------------------------- + +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/_core/src/highway/LICENSE ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/_core/src/multiarray/dragon4_LICENSE.txt ]] +Copyright (c) 2014 Ryan Juckett + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +dragon4.c|h h contains a modified version of Ryan Juckett's Dragon4 +implementation, obtained from https://www.ryanjuckett.com, +which has been ported from C++ to C and which has +modifications specific to printing floats in numpy. + +Ryan Juckett's original code was under the Zlib license; he gave numpy +permission to include it under the MIT license instead. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/_core/src/multiarray/dragon4_LICENSE.txt ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/_core/src/npysort/x86-simd-sort/LICENSE.md ]] +BSD 3-Clause License + +Copyright (c) 2022, Intel. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/_core/src/npysort/x86-simd-sort/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/_core/src/umath/svml/LICENSE ]] +Copyright (c) 2005-2021, NumPy Developers. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the NumPy Developers nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/_core/src/umath/svml/LICENSE ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/fft/pocketfft/LICENSE.md ]] +Copyright (C) 2010-2018 Max-Planck-Society +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. +* Neither the name of the copyright holder nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/fft/pocketfft/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/linalg/lapack_lite/LICENSE.txt ]] +Copyright (c) 1992-2013 The University of Tennessee and The University + of Tennessee Research Foundation. All rights + reserved. +Copyright (c) 2000-2013 The University of California Berkeley. All + rights reserved. +Copyright (c) 2006-2013 The University of Colorado Denver. All rights + reserved. + +$COPYRIGHT$ + +Additional copyrights may follow + +$HEADER$ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer listed + in this license in the documentation and/or other materials + provided with the distribution. + +- Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +The copyright holders provide no reassurances that the source code +provided does not infringe any patent, copyright, or any other +intellectual property rights of third parties. The copyright holders +disclaim any liability to any recipient for claims brought against +recipient by any third party for infringement of that parties +intellectual property rights. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/linalg/lapack_lite/LICENSE.txt ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/ma/LICENSE ]] +* Copyright (c) 2006, University of Georgia and Pierre G.F. Gerard-Marchant +* All rights reserved. +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the University of Georgia nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/ma/LICENSE ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/random/LICENSE.md ]] +**This software is dual-licensed under the The University of Illinois/NCSA +Open Source License (NCSA) and The 3-Clause BSD License** + +# NCSA Open Source License +**Copyright (c) 2019 Kevin Sheppard. All rights reserved.** + +Developed by: Kevin Sheppard (, +) +[http://www.kevinsheppard.com](http://www.kevinsheppard.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimers. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimers in the documentation and/or +other materials provided with the distribution. + +Neither the names of Kevin Sheppard, nor the names of any contributors may be +used to endorse or promote products derived from this Software without specific +prior written permission. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH +THE SOFTWARE.** + + +# 3-Clause BSD License +**Copyright (c) 2019 Kevin Sheppard. All rights reserved.** + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +**THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE.** + +# Components + +Many parts of this module have been derived from original sources, +often the algorithm's designer. Component licenses are located with +the component code. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/random/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/random/src/distributions/LICENSE.md ]] +## NumPy + +Copyright (c) 2005-2017, NumPy Developers. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +* Neither the name of the NumPy Developers nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +## Julia + +The ziggurat methods were derived from Julia. + +Copyright (c) 2009-2019: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, +and other contributors: + +https://github.com/JuliaLang/julia/contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/random/src/distributions/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/random/src/mt19937/LICENSE.md ]] +# MT19937 + +Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org) + +The rk_random and rk_seed functions algorithms and the original design of +the Mersenne Twister RNG: + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Original algorithm for the implementation of rk_interval function from +Richard J. Wagner's implementation of the Mersenne Twister RNG, optimised by +Magnus Jonsson. + +Constants used in the rk_double implementation by Isaku Wada. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/random/src/mt19937/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/random/src/pcg64/LICENSE.md ]] +# PCG64 + +## The MIT License + +PCG Random Number Generation for C. + +Copyright 2014 Melissa O'Neill + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/random/src/pcg64/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/random/src/philox/LICENSE.md ]] +# PHILOX + +Copyright 2010-2012, D. E. Shaw Research. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name of D. E. Shaw Research nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/random/src/philox/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/random/src/sfc64/LICENSE.md ]] +# SFC64 + +## The MIT License + +Adapted from a C++ implementation of Chris Doty-Humphrey's SFC PRNG. + +https://gist.github.com/imneme/f1f7821f07cf76504a97f6537c818083 + +Copyright (c) 2018 Melissa E. O'Neill + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file numpy-2.5.5.dist-info/licenses/numpy/random/src/sfc64/LICENSE.md ]] +[[ begin file numpy-2.5.5.dist-info/licenses/numpy/random/src/splitmix64/LICENSE.md ]] +# SPLITMIX64 + +Written in 2015 by Sebastiano Vigna (vigna@acm.org) + +To the extent possible under law, the author has dedicated all copyright +and related and neighboring rights to this software to the public domain +worldwide. This software is distributed without any warranty. + +See . +[[ end file numpy-2.5.5.dist-info/licenses/numpy/random/src/splitmix64/LICENSE.md ]] + +============================================================================== +python: onnxruntime 1.31.0 +Licence: MIT License +Source: https://onnxruntime.ai +[[ begin file onnxruntime/LICENSE ]] +MIT License + +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file onnxruntime/LICENSE ]] + +============================================================================== +python: opencv-python 5.1.0.95 +Licence: Apache 2.0 +Source: https://github.com/opencv/opencv-python +[[ file cv2/LICENSE-3RD-PARTY.txt: shared text T4 ]] +[[ file cv2/LICENSE.txt: shared text T5 ]] + +============================================================================== +python: opencv-python-headless 5.1.0.95 +Licence: Apache 2.0 +Source: https://github.com/opencv/opencv-python +[[ file cv2/LICENSE-3RD-PARTY.txt: shared text T4 ]] +[[ file cv2/LICENSE.txt: shared text T5 ]] + +============================================================================== +python: packaging 26.4 +Licence: Apache-2.0 OR BSD-2-Clause +Source: https://packaging.pypa.io/ +[[ begin file packaging-26.4.dist-info/licenses/LICENSE ]] +This software is made available under the terms of *either* of the licenses +found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made +under the terms of *both* these licenses. +[[ end file packaging-26.4.dist-info/licenses/LICENSE ]] +[[ file packaging-26.4.dist-info/licenses/LICENSE.APACHE: shared text T6 ]] +[[ begin file packaging-26.4.dist-info/licenses/LICENSE.BSD ]] +Copyright (c) Donald Stufft and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file packaging-26.4.dist-info/licenses/LICENSE.BSD ]] + +============================================================================== +python: pi-heif 1.4.0 +Licence: BSD-3-Clause +Source: https://github.com/bigcat88/pillow_heif +[[ begin file pi_heif-1.4.0.dist-info/licenses/LICENSE.txt ]] +Copyright (c) 2021-2023, Pillow-Heif contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the Pillow-Heif nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pi_heif-1.4.0.dist-info/licenses/LICENSE.txt ]] +[[ begin file pi_heif-1.4.0.dist-info/licenses/LICENSES_bundled.txt ]] +License for "pi-heif" binary wheels: LGPLv3, due to base library licenses. + +Binary wheels combine several license-compatible libraries. Here they are listed. + +Name: libheif +License: LGPLv3 +Files: libheif.[dylib|so|dll] + For details, see https://github.com/strukturag/libheif/tree/v1.18.1/COPYING + Source code: https://github.com/strukturag/libheif/tree/v1.18.1 + +Name: libde265 +License: LGPLv3 +Files: libde265.[dylib|so|dll] + For details, see https://github.com/strukturag/libde265/tree/v1.0.15/COPYING + Source code: https://github.com/strukturag/libde265/tree/v1.0.15 +[[ end file pi_heif-1.4.0.dist-info/licenses/LICENSES_bundled.txt ]] + +============================================================================== +python: pillow 12.3.0 +Licence: MIT-CMU +Source: https://pillow.readthedocs.io/en/stable/releasenotes/index.html +[[ begin file pillow-12.3.0.dist-info/licenses/LICENSE ]] +The Python Imaging Library (PIL) is + + Copyright © 1997-2011 by Secret Labs AB + Copyright © 1995-2011 by Fredrik Lundh and contributors + +Pillow is the friendly PIL fork. It is + + Copyright © 2010 by Jeffrey 'Alex' Clark and contributors + +Like PIL, Pillow is licensed under the open source MIT-CMU License: + +By obtaining, using, and/or copying this software and/or its associated +documentation, you agree that you have read, understood, and will comply +with the following terms and conditions: + +Permission to use, copy, modify and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies, and that +both that copyright notice and this permission notice appear in supporting +documentation, and that the name of Secret Labs AB or the author not be +used in advertising or publicity pertaining to distribution of the software +without specific, written prior permission. + +SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + +---- + +AOM + +Copyright (c) 2016, Alliance for Open Media. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +---- + +BROTLI + +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +---- + +BZIP2 + + +-------------------------------------------------------------------------- + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2019 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@acm.org +bzip2/libbzip2 version 1.0.8 of 13 July 2019 + +-------------------------------------------------------------------------- + + +---- + +DAV1D + +Copyright © 2018-2019, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---- + +FREETYPE2 + +The FreeType 2 font engine is copyrighted work and cannot be used +legally without a software license. In order to make this project +usable to a vast majority of developers, we distribute it under two +mutually exclusive open-source licenses. + +This means that *you* must choose *one* of the two licenses described +below, then obey all its terms and conditions when using FreeType 2 in +any of your projects or products. + + - The FreeType License, found in the file `docs/FTL.TXT`, which is + similar to the original BSD license *with* an advertising clause + that forces you to explicitly cite the FreeType project in your + product's documentation. All details are in the license file. + This license is suited to products which don't use the GNU General + Public License. + + Note that this license is compatible to the GNU General Public + License version 3, but not version 2. + + - The GNU General Public License version 2, found in + `docs/GPLv2.TXT` (any later version can be used also), for + programs which already use the GPL. Note that the FTL is + incompatible with GPLv2 due to its advertisement clause. + +The contributed BDF and PCF drivers come with a license similar to +that of the X Window System. It is compatible to the above two +licenses (see files `src/bdf/README` and `src/pcf/README`). The same +holds for the source code files `src/base/fthash.c` and +`include/freetype/internal/fthash.h`; they were part of the BDF driver +in earlier FreeType versions. + +The gzip module uses the zlib license (see `src/gzip/zlib.h`) which +too is compatible to the above two licenses. + +The files `src/autofit/ft-hb.c` and `src/autofit/ft-hb.h` contain code +taken almost verbatim from the HarfBuzz file `hb-ft.cc`, which uses +the 'Old MIT' license, compatible to the above two licenses. + +The MD5 checksum support (only used for debugging in development +builds) is in the public domain. + +-------------------------------------------------------------------------- + + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + https://www.freetype.org + + +--- end of FTL.TXT --- + +The following license details are part of `src/bdf/README`: + +``` +License +******* + +Copyright (C) 2001-2002 by Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*** Portions of the driver (that is, bdflib.c and bdf.h): + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2002, 2011 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Credits +******* + +This driver is based on excellent Mark Leisher's bdf library. If you +find something good in this driver you should probably thank him, not +me. +``` + +The following license details are part of `src/pcf/README`: + +``` +License +******* + +Copyright (C) 2000 by Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Credits +******* + +Keith Packard wrote the pcf driver found in XFree86. His work is at +the same time the specification and the sample implementation of the +PCF format. Undoubtedly, this driver is inspired from his work. +``` + + +---- + +HARFBUZZ + +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010-2022 Google, Inc. +Copyright © 2015-2020 Ebrahim Byagowi +Copyright © 2019,2020 Facebook, Inc. +Copyright © 2012,2015 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2011 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2005,2006,2020,2021,2022,2023 Behdad Esfahbod +Copyright © 2004,2007,2008,2009,2010,2013,2021,2022,2023 Red Hat, Inc. +Copyright © 1998-2005 David Turner and Werner Lemberg +Copyright © 2016 Igalia S.L. +Copyright © 2022 Matthias Clasen +Copyright © 2018,2021 Khaled Hosny +Copyright © 2018,2019,2020 Adobe, Inc +Copyright © 2013-2015 Alexei Podtelezhnikov + +For full copyright notices consult the individual files in the package. + + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + + +---- + +LCMS2 + +Little CMS +Copyright (c) 1998-2020 Marti Maria Saguer + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +---- + +LIBAVIF + +Copyright 2019 Joe Drago. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +Files: src/obu.c + +Copyright © 2018-2019, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +Files: third_party/iccjpeg/* + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltmain.sh). Another support script, install-sh, is copyright by X Consortium +but is also freely distributable. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent, GIF reading support has +been removed altogether, and the GIF writer has been simplified to produce +"uncompressed GIFs". This technique does not use the LZW algorithm; the +resulting GIF files are larger than usual, but are readable by all standard +GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + +------------------------------------------------------------------------------ + +Files: contrib/gdk-pixbuf/* + +Copyright 2020 Emmanuel Gil Peyrot. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +Files: android_jni/gradlew* + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ + +Files: third_party/libyuv/* + +Copyright 2011 The LibYuv Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---- + +LIBJPEG + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +---- + +LIBLZMA + +XZ Utils Licensing +================== + + Different licenses apply to different files in this package. Here + is a rough summary of which licenses apply to which parts of this + package (but check the individual files to be sure!): + + - liblzma is in the public domain. + + - xz, xzdec, and lzmadec command line tools are in the public + domain unless GNU getopt_long had to be compiled and linked + in from the lib directory. The getopt_long code is under + GNU LGPLv2.1+. + + - The scripts to grep, diff, and view compressed files have been + adapted from gzip. These scripts and their documentation are + under GNU GPLv2+. + + - All the documentation in the doc directory and most of the + XZ Utils specific documentation files in other directories + are in the public domain. + + - Translated messages are in the public domain. + + - The build system contains public domain files, and files that + are under GNU GPLv2+ or GNU GPLv3+. None of these files end up + in the binaries being built. + + - Test files and test code in the tests directory, and debugging + utilities in the debug directory are in the public domain. + + - The extra directory may contain public domain files, and files + that are under various free software licenses. + + You can do whatever you want with the files that have been put into + the public domain. If you find public domain legally problematic, + take the previous sentence as a license grant. If you still find + the lack of copyright legally problematic, you have too many + lawyers. + + As usual, this software is provided "as is", without any warranty. + + If you copy significant amounts of public domain code from XZ Utils + into your project, acknowledging this somewhere in your software is + polite (especially if it is proprietary, non-free software), but + naturally it is not legally required. Here is an example of a good + notice to put into "about box" or into documentation: + + This software includes code from XZ Utils . + + The following license texts are included in the following files: + - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 + - COPYING.GPLv2: GNU General Public License version 2 + - COPYING.GPLv3: GNU General Public License version 3 + + Note that the toolchain (compiler, linker etc.) may add some code + pieces that are copyrighted. Thus, it is possible that e.g. liblzma + binary wouldn't actually be in the public domain in its entirety + even though it contains no copyrighted code from the XZ Utils source + package. + + If you have questions, don't hesitate to ask the author(s) for more + information. + + +---- + +LIBPNG + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2022 The PNG Reference Library Authors. + * Copyright (c) 2018-2022 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. + + +---- + +LIBTIFF + +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + + +---- + +LIBWEBP + +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---- + +LIBYUV + +Copyright 2011 The LibYuv Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---- + +OPENJPEG + +* + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third + * party and contributor rights, including patent rights, and no such rights + * are granted under this license. + * + * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2014, Professor Benoit Macq + * Copyright (c) 2003-2014, Antonin Descampe + * Copyright (c) 2003-2009, Francois-Olivier Devaux + * Copyright (c) 2005, Herve Drolon, FreeImage Team + * Copyright (c) 2002-2003, Yannick Verschueren + * Copyright (c) 2001-2003, David Janssens + * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France + * Copyright (c) 2012, CS Systemes d'Information, France + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +---- + +RAQM + +The MIT License (MIT) + +Copyright © 2015 Information Technology Authority (ITA) +Copyright © 2016 Khaled Hosny + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +---- + +TCL_TK + +This software is copyrighted by the Regents of the University +of California, Sun Microsystems, Inc., Scriptics Corporation, +and other parties. The following terms apply to all files +associated with the software unless explicitly disclaimed in +individual files. + +The authors hereby grant permission to use, copy, modify, +distribute, and license this software and its documentation +for any purpose, provided that existing copyright notices are +retained in all copies and that this notice is included +verbatim in any distributions. No written agreement, license, +or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their +authors and need not follow the licensing terms described +here, provided that the new terms are clearly indicated on +the first page of each file where they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO +ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS +SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN +IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON +AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO +OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, +ENHANCEMENTS, OR MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf +of the U.S. government, the Government shall have only +"Restricted Rights" in the software and related documentation +as defined in the Federal Acquisition Regulations (FARs) in +Clause 52.227.19 (c) (2). If you are acquiring the software +on behalf of the Department of Defense, the software shall be +classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in +Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the +foregoing, the authors grant the U.S. Government and others +acting in its behalf permission to use and distribute the +software in accordance with the terms specified in this +license + + +---- + +XAU + +Copyright 1988, 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +---- + +XCB + +Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall +be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors +or their institutions shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this +Software without prior written authorization from the +authors. + + +---- + +XDMCP + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Author: Keith Packard, MIT X Consortium + + +---- + +ZLIB + + (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. + + +---- + +ZSTD + +BSD License + +For Zstandard software + +Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook, nor Meta, nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pillow-12.3.0.dist-info/licenses/LICENSE ]] + +============================================================================== +python: protobuf 7.36.2 +Licence: 3-Clause BSD License +Source: https://developers.google.com/protocol-buffers/ +[[ begin file protobuf-7.36.2.dist-info/LICENSE ]] +Copyright 2008 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. +[[ end file protobuf-7.36.2.dist-info/LICENSE ]] + +============================================================================== +python: pyclipper 1.4.0 +Licence: MIT +Source: https://github.com/fonttools/pyclipper +[[ begin file pyclipper-1.4.0.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2015 Gregor Ratajc, Lukas Treyer, Maxime Chalton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file pyclipper-1.4.0.dist-info/licenses/LICENSE ]] + +============================================================================== +python: pycparser 3.12 +Licence: BSD-3-Clause +Source: https://github.com/eliben/pycparser +[[ begin file pycparser-3.12.dist-info/licenses/LICENSE ]] +pycparser -- A C parser in Python + +Copyright (c) 2008-2027, Eli Bendersky +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the copyright holder nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pycparser-3.12.dist-info/licenses/LICENSE ]] + +============================================================================== +python: pycryptodomex 3.24.2 +Licence: BSD, Public Domain +Source: https://www.pycryptodome.org +[[ begin file pycryptodomex-3.24.2.dist-info/AUTHORS.rst ]] +Simon Arneaud +Nevins Bartolomeo +Thorsten E. Behrens +Tim Berners-Lee +Frédéric Bertolus +Ian Bicking +Joris Bontje +Antoon Bosselaers +Andrea Bottoni +Jean-Paul Calderone +Sergey Chernov +Geremy Condra +Jan Dittberner +Andrew Eland +Philippe Frycia +Peter Gutmann +Hirendra Hindocha +Nikhil Jhingan +Sebastian Kayser +Ryan Kelly +Andrew M. Kuchling +Piers Lauder +Legrandin +M.-A. Lemburg +Wim Lewis +Darsey C. Litzenberger +Richard Mitchell +Mark Moraes +Lim Chee Siang +Bryan Olson +Wallace Owen +Colin Plumb +Robey Pointer +Lorenz Quack +Sebastian Ramacher +Jeethu Rao +James P. Rutledge +Matt Schreiner +Peter Simmons +Janne Snabb +Tom St. Denis +Anders Sundman +Paul Swartz +Fabrizio Tarizzo +Kevin M. Turner +Barry A. Warsaw +Eric Young +Hannes van Niekerk +Stefan Seering +Koki Takahashi +Lauro de Lima +[[ end file pycryptodomex-3.24.2.dist-info/AUTHORS.rst ]] +[[ begin file pycryptodomex-3.24.2.dist-info/LICENSE.rst ]] +The source code in PyCryptodome is partially in the public domain +and partially released under the BSD 2-Clause license. + +In either case, there are minimal if no restrictions on the redistribution, +modification and usage of the software. + +Public domain +============= + +All code originating from PyCrypto is free and unencumbered software +released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to + +BSD license +=========== + +All direct contributions to PyCryptodome are released under the following +license. The copyright of each piece belongs to the respective author. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pycryptodomex-3.24.2.dist-info/LICENSE.rst ]] + +============================================================================== +python: pydantic 2.14.4 +Licence: MIT +Source: https://github.com/pydantic/pydantic +[[ begin file pydantic-2.14.4.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2017 to present Pydantic Services Inc. and individual contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file pydantic-2.14.4.dist-info/licenses/LICENSE ]] + +============================================================================== +python: pydantic-core 2.50.5 +Licence: MIT +Source: https://github.com/pydantic/pydantic +[[ begin file pydantic_core-2.50.5.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2022 Samuel Colvin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file pydantic_core-2.50.5.dist-info/licenses/LICENSE ]] + +============================================================================== +python: pyobjc-core 13.1 +Licence: MIT +Source: https://github.com/ronaldoussoren/pyobjc +Note: The distribution carries no licence file; its licence is given above. + +============================================================================== +python: pyobjc-framework-cocoa 13.1 +Licence: MIT +Source: https://github.com/ronaldoussoren/pyobjc +[[ file pyobjc_framework_cocoa-13.1.dist-info/licenses/LICENSE.txt: shared text T7 ]] + +============================================================================== +python: pyobjc-framework-imagecapturecore 13.1 +Licence: MIT +Source: https://github.com/ronaldoussoren/pyobjc +[[ file pyobjc_framework_imagecapturecore-13.1.dist-info/licenses/LICENSE.txt: shared text T7 ]] + +============================================================================== +python: pyobjc-framework-quartz 13.1 +Licence: MIT +Source: https://github.com/ronaldoussoren/pyobjc +[[ file pyobjc_framework_quartz-13.1.dist-info/licenses/LICENSE.txt: shared text T7 ]] + +============================================================================== +python: pypdf 7.2.0 +Licence: BSD-3-Clause +Source: https://github.com/py-pdf/pypdf/issues +[[ begin file pypdf-7.2.0.dist-info/licenses/LICENSE ]] +Copyright (c) 2006-2008, Mathieu Fenniak +Some contributions copyright (c) 2007, Ashish Kulkarni +Some contributions copyright (c) 2014, Steve Witham + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. +* The name of the author may not be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +[[ end file pypdf-7.2.0.dist-info/licenses/LICENSE ]] + +============================================================================== +python: pypdfium2 5.15.2 +Licence: BSD-3-Clause, Apache-2.0, dependency licenses +Source: https://github.com/pypdfium2-team/pypdfium2 +[[ file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/SHARED/Apache-2.0.txt: shared text T3 ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/abseil.txt ]] +#include ./SHARED/Apache-2.0.txt +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/abseil.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/agg23.txt ]] +//---------------------------------------------------------------------------- +// Anti-Grain Geometry - Version 2.3 +// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) +// +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. +// +//---------------------------------------------------------------------------- +// Contact: mcseem@antigrain.com +// mcseemagg@yahoo.com +// http://www.antigrain.com +//---------------------------------------------------------------------------- +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/agg23.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/all_except_musl/llvm-libc.txt ]] +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + +#include ../SHARED/Apache-2.0.txt + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2007-2019 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/all_except_musl/llvm-libc.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/android/catapult.txt ]] +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of catapult nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/android/catapult.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/android/cpu_features.txt ]] +#include ../SHARED/Apache-2.0.txt + +-------------------------------------------------------------------------------- +For files in the `ndk_compat` folder: +-------------------------------------------------------------------------------- + +Copyright (C) 2010 The Android Open Source Project +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/android/cpu_features.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/android/libunwind.txt ]] +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + +#include ../SHARED/Apache-2.0.txt + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== + +The libunwind library is dual licensed under both the University of Illinois +"BSD-Like" license and the MIT license. As a user of this code you may choose +to use it under either license. As a contributor, you agree to allow your code +to be used under both. + +Full text of the relevant licenses is included below. + +============================================================================== + +University of Illinois/NCSA +Open Source License + +Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT + +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== + +Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/android/libunwind.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/cibw_musl/libgcc_and_libstdc++.txt ]] +GCC RUNTIME LIBRARY EXCEPTION + +Version 3.1, 31 March 2009 + +Copyright (C) 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This GCC Runtime Library Exception ("Exception") is an additional +permission under section 7 of the GNU General Public License, version +3 ("GPLv3"). It applies to a given file (the "Runtime Library") that +bears a notice placed by the copyright holder of the file stating that +the file is governed by GPLv3 along with this Exception. + +When you use GCC to compile a program, GCC may combine portions of +certain GCC header files and runtime libraries with the compiled +program. The purpose of this Exception is to allow compilation of +non-GPL (including proprietary) programs to use, in this way, the +header files and runtime libraries covered by this Exception. + +0. Definitions. + +A file is an "Independent Module" if it either requires the Runtime +Library for execution after a Compilation Process, or makes use of an +interface provided by the Runtime Library, but is not otherwise based +on the Runtime Library. + +"GCC" means a version of the GNU Compiler Collection, with or without +modifications, governed by version 3 (or a specified later version) of +the GNU General Public License (GPL) with the option of using any +subsequent versions published by the FSF. + +"GPL-compatible Software" is software whose conditions of propagation, +modification and use would permit combination with GCC in accord with +the license of GCC. + +"Target Code" refers to output from any compiler for a real or virtual +target processor architecture, in executable form or suitable for +input to an assembler, loader, linker and/or execution +phase. Notwithstanding that, Target Code does not include data in any +format that is used as a compiler intermediate representation, or used +for producing a compiler intermediate representation. + +The "Compilation Process" transforms code entirely represented in +non-intermediate languages designed for human-written code, and/or in +Java Virtual Machine byte code, into Target Code. Thus, for example, +use of source code generators and preprocessors need not be considered +part of the Compilation Process, since the Compilation Process can be +understood as starting with the output of the generators or +preprocessors. + +A Compilation Process is "Eligible" if it is done using GCC, alone or +with other GPL-compatible software, or if it is done without using any +work based on GCC. For example, using non-GPL-compatible Software to +optimize any GCC intermediate representations would not qualify as an +Eligible Compilation Process. + +1. Grant of Additional Permission. + +You have permission to propagate a work of Target Code formed by +combining the Runtime Library with Independent Modules, even if such +propagation would otherwise violate the terms of GPLv3, provided that +all Target Code was generated by Eligible Compilation Processes. You +may then convey such a combination under terms of your choice, +consistent with the licensing of the Independent Modules. + +2. No Weakening of GCC Copyleft. + +The availability of this Exception does not imply any general +presumption that third-party software is unaffected by the copyleft +requirements of the license of GCC. + +-------------------------------------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/cibw_musl/libgcc_and_libstdc++.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/dragonbox-Apache2-LLVM.txt ]] +#include ./SHARED/Apache-2.0.txt + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/dragonbox-Apache2-LLVM.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/dragonbox-Boost.txt ]] +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/dragonbox-Boost.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/fast_float.txt ]] +MIT License + +Copyright (c) 2021 The fast_float authors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/fast_float.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/freetype.txt ]] + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright � The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + http://www.freetype.org + + +--- end of FTL.TXT --- +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/freetype.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/harfbuzz.txt ]] +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010-2022 Google, Inc. +Copyright © 2015-2020 Ebrahim Byagowi +Copyright © 2019,2020 Facebook, Inc. +Copyright © 2012,2015 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2011 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2005,2006,2020,2021,2022,2023 Behdad Esfahbod +Copyright © 2004,2007,2008,2009,2010,2013,2021,2022,2023 Red Hat, Inc. +Copyright © 1998-2005 David Turner and Werner Lemberg +Copyright © 2016 Igalia S.L. +Copyright © 2022 Matthias Clasen +Copyright © 2018,2021 Khaled Hosny +Copyright © 2018,2019,2020 Adobe, Inc +Copyright © 2013-2015 Alexei Podtelezhnikov + +For full copyright notices consult the individual files in the package. + + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/harfbuzz.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/highway.txt ]] +#include ./SHARED/Apache-2.0.txt +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/highway.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/icu.txt ]] +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 2016-2023 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. + +---------------------------------------------------------------------- + +Third-Party Software Licenses + +This section contains third-party software notices and/or additional +terms for licensed third-party software components included within ICU +libraries. + +---------------------------------------------------------------------- + +ICU License - ICU 1.8.1 to ICU 57.1 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. + +---------------------------------------------------------------------- + +Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + + # The Google Chrome software developed by Google is licensed under + # the BSD license. Other software included in this distribution is + # provided under other licenses, as set forth below. + # + # The BSD License + # http://opensource.org/licenses/bsd-license.php + # Copyright (C) 2006-2008, Google Inc. + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided with + # the distribution. + # Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + # + # The word list in cjdict.txt are generated by combining three word lists + # listed below with further processing for compound word breaking. The + # frequency is generated with an iterative training against Google web + # corpora. + # + # * Libtabe (Chinese) + # - https://sourceforge.net/project/?group_id=1519 + # - Its license terms and conditions are shown below. + # + # * IPADIC (Japanese) + # - http://chasen.aist-nara.ac.jp/chasen/distribution.html + # - Its license terms and conditions are shown below. + # + # ---------COPYING.libtabe ---- BEGIN-------------------- + # + # /* + # * Copyright (c) 1999 TaBE Project. + # * Copyright (c) 1999 Pai-Hsiang Hsiao. + # * All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the TaBE Project nor the names of its + # * contributors may be used to endorse or promote products derived + # * from this software without specific prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # /* + # * Copyright (c) 1999 Computer Systems and Communication Lab, + # * Institute of Information Science, Academia + # * Sinica. All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the Computer Systems and Communication Lab + # * nor the names of its contributors may be used to endorse or + # * promote products derived from this software without specific + # * prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + # University of Illinois + # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 + # + # ---------------COPYING.libtabe-----END-------------------------------- + # + # + # ---------------COPYING.ipadic-----BEGIN------------------------------- + # + # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science + # and Technology. All Rights Reserved. + # + # Use, reproduction, and distribution of this software is permitted. + # Any copy of this software, whether in its original form or modified, + # must include both the above copyright notice and the following + # paragraphs. + # + # Nara Institute of Science and Technology (NAIST), + # the copyright holders, disclaims all warranties with regard to this + # software, including all implied warranties of merchantability and + # fitness, in no event shall NAIST be liable for + # any special, indirect or consequential damages or any damages + # whatsoever resulting from loss of use, data or profits, whether in an + # action of contract, negligence or other tortuous action, arising out + # of or in connection with the use or performance of this software. + # + # A large portion of the dictionary entries + # originate from ICOT Free Software. The following conditions for ICOT + # Free Software applies to the current dictionary as well. + # + # Each User may also freely distribute the Program, whether in its + # original form or modified, to any third party or parties, PROVIDED + # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear + # on, or be attached to, the Program, which is distributed substantially + # in the same form as set out herein and that such intended + # distribution, if actually made, will neither violate or otherwise + # contravene any of the laws and regulations of the countries having + # jurisdiction over the User or the intended distribution itself. + # + # NO WARRANTY + # + # The program was produced on an experimental basis in the course of the + # research and development conducted during the project and is provided + # to users as so produced on an experimental basis. Accordingly, the + # program is provided without any warranty whatsoever, whether express, + # implied, statutory or otherwise. The term "warranty" used herein + # includes, but is not limited to, any warranty of the quality, + # performance, merchantability and fitness for a particular purpose of + # the program and the nonexistence of any infringement or violation of + # any right of any third party. + # + # Each user of the program will agree and understand, and be deemed to + # have agreed and understood, that there is no warranty whatsoever for + # the program and, accordingly, the entire risk arising from or + # otherwise connected with the program is assumed by the user. + # + # Therefore, neither ICOT, the copyright holder, or any other + # organization that participated in or was otherwise related to the + # development of the program and their respective officials, directors, + # officers and other employees shall be held liable for any and all + # damages, including, without limitation, general, special, incidental + # and consequential damages, arising out of or otherwise in connection + # with the use or inability to use the program or any product, material + # or result produced or otherwise obtained by using the program, + # regardless of whether they have been advised of, or otherwise had + # knowledge of, the possibility of such damages at any time during the + # project or thereafter. Each user will be deemed to have agreed to the + # foregoing by his or her commencement of use of the program. The term + # "use" as used herein includes, but is not limited to, the use, + # modification, copying and distribution of the program and the + # production of secondary products from the program. + # + # In the case where the program, whether in its original form or + # modified, was distributed or delivered to or received by a user from + # any person, organization or entity other than ICOT, unless it makes or + # grants independently of ICOT any specific warranty to the user in + # writing, such person, organization or entity, will also be exempted + # from and not be held liable to the user for any such damages as noted + # above as far as the program is concerned. + # + # ---------------COPYING.ipadic-----END---------------------------------- + +---------------------------------------------------------------------- + +Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (C) 2016 and later: Unicode, Inc. and others. + # License & terms of use: http://www.unicode.org/copyright.html + # Copyright (c) 2015 International Business Machines Corporation + # and others. All Rights Reserved. + # + # Project: https://github.com/rober42539/lao-dictionary + # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt + # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt + # (copied below) + # + # This file is derived from the above dictionary version of Nov 22, 2020 + # ---------------------------------------------------------------------- + # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in binary + # form must reproduce the above copyright notice, this list of conditions and + # the following disclaimer in the documentation and/or other materials + # provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Burmese Word Break Dictionary Data (burmesedict.txt) + + # Copyright (c) 2014 International Business Machines Corporation + # and others. All Rights Reserved. + # + # This list is part of a project hosted at: + # github.com/kanyawtech/myanmar-karen-word-lists + # + # -------------------------------------------------------------------------- + # Copyright (c) 2013, LeRoy Benjamin Sharon + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions + # are met: Redistributions of source code must retain the above + # copyright notice, this list of conditions and the following + # disclaimer. Redistributions in binary form must reproduce the + # above copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided + # with the distribution. + # + # Neither the name Myanmar Karen Word Lists, nor the names of its + # contributors may be used to endorse or promote products derived + # from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + # SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Time Zone Database + + ICU uses the public domain data and code derived from Time Zone +Database for its time zone support. The ownership of the TZ database +is explained in BCP 175: Procedure for Maintaining the Time Zone +Database section 7. + + # 7. Database Ownership + # + # The TZ database itself is not an IETF Contribution or an IETF + # document. Rather it is a pre-existing and regularly updated work + # that is in the public domain, and is intended to remain in the + # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do + # not apply to the TZ Database or contributions that individuals make + # to it. Should any claims be made and substantiated against the TZ + # Database, the organization that is providing the IANA + # Considerations defined in this RFC, under the memorandum of + # understanding with the IETF, currently ICANN, may act in accordance + # with all competent court orders. No ownership claims will be made + # by ICANN or the IETF Trust on the database or the code. Any person + # making a contribution to the database or code waives all rights to + # future claims in that contribution or in the TZ Database. + +---------------------------------------------------------------------- + +Google double-conversion + +Copyright 2006-2011, the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- + +File: aclocal.m4 (only for ICU4C) +Section: pkg.m4 - Macros to locate and utilise pkg-config. + + +Copyright © 2004 Scott James Remnant . +Copyright © 2012-2015 Dan Nicholson + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: config.guess (only for ICU4C) + + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see . + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. This Exception is an additional permission under section 7 +of the GNU General Public License, version 3 ("GPLv3"). + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: install-sh (only for ICU4C) + + +Copyright 1991 by the Massachusetts Institute of Technology + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/icu.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/lcms.txt ]] +//--------------------------------------------------------------------------------- +// +// Little Color Management System +// Copyright (c) 1998-2023 Marti Maria Saguer +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the Software +// is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//--------------------------------------------------------------------------------- +// +// Version 2.15 +// +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/lcms.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libjpeg_turbo.ijg ]] +libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project +to include only information relevant to libjpeg-turbo, to wordsmith certain +sections, and to remove impolitic language that existed in the libjpeg v8 +README. It is included only for reference. Please see README.md for +information specific to libjpeg-turbo. + + +The Independent JPEG Group's JPEG software +========================================== + +This distribution contains a release of the Independent JPEG Group's free JPEG +software. You are welcome to redistribute this software and to use it for any +purpose, subject to the conditions under LEGAL ISSUES, below. + +This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, +Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, +Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, +and other members of the Independent JPEG Group. + +IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee +(also known as JPEG, together with ITU-T SG16). + + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + doc/usage.txt Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + doc/*.1 Unix-style man pages for programs (same info as + usage.txt). + doc/wizard.txt Advanced usage instructions for JPEG wizards only. + doc/change.log Version-to-version change highlights. +Programmer and internal documentation: + doc/libjpeg.txt How to use the JPEG library in your own programs. + src/example.c Sample code for calling the JPEG library. + doc/structure.txt Overview of the JPEG library's internal structure. + doc/coderules.txt Coding style rules --- please read if you contribute + code. + +Please read at least usage.txt. Some information can also be found in the JPEG +FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find +out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + + +OVERVIEW +======== + +This package contains C software to implement JPEG image encoding, decoding, +and transcoding. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and grayscale images. JPEG's strong suit is compressing +photographic images or other types of images that have smooth color and +brightness transitions between neighboring pixels. Images with sharp lines or +other abrupt features may not compress well with JPEG, and a higher JPEG +quality may have to be used to avoid visible compression artifacts with such +images. + +JPEG is normally lossy, meaning that the output pixels are not necessarily +identical to the input pixels. However, on photographic content and other +"smooth" images, very good compression ratios can be obtained with no visible +compression artifacts, and extremely high compression ratios are possible if +you are willing to sacrifice image quality (by reducing the "quality" setting +in the compressor.) + +This software implements JPEG baseline, extended-sequential, progressive, and +lossless compression processes. Provision is made for supporting all variants +of these processes, although some uncommon parameter settings aren't +implemented yet. We have made no provision for supporting the hierarchical +processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats. These +extra functions can be compiled out of the library if not required for a +particular application. + +We have also included "jpegtran", a utility for lossless transcoding between +different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple +applications for inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +REFERENCES +========== + +We recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PDF file containing a revised version of Wallace's article is +available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best currently available description of JPEG is the textbook "JPEG Still +Image Data Compression Standard" by William B. Pennebaker and Joan L. +Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. +Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG +standards (DIS 10918-1 and draft DIS 10918-2). + +The original JPEG standard is divided into two parts, Part 1 being the actual +specification, while Part 2 covers compliance testing methods. Part 1 is +titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details, we follow the "JFIF" conventions, revision +1.02. JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and +Recommendation ITU-T T.871 (05/2011): Information technology - Digital +compression and coding of continuous-tone still images: JPEG File Interchange +Format (JFIF). It is available as a free download in PDF file format from +https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871. +A PDF file of the older JFIF 1.02 specification is available at +http://www.w3.org/Graphics/JPEG/jfif3.pdf. + +The TIFF 6.0 file format specification can be obtained from +http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation +scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious +problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression +tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note +#2 (Compression tag 7). Copies of this Note can be obtained from +http://www.ijg.org/files/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. + + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is www.ijg.org. +The most recent released version can always be found there in +directory "files". + +The JPEG FAQ (Frequently Asked Questions) article is a source of some +general information about JPEG. It is available at +http://www.faqs.org/faqs/jpeg-faq. + + +FILE FORMAT COMPATIBILITY +========================= + +This software implements ITU T.81 | ISO/IEC 10918 with some extensions from +ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES). +Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or +a subset thereof, but there are other formats containing the name "JPEG" that +are incompatible with the original JPEG standard or with JFIF (for instance, +JPEG 2000 and JPEG XR). This software therefore does not support these +formats. Indeed, one of the original reasons for developing this free software +was to help force convergence on a common, interoperable format standard for +JPEG files. + +JFIF is a minimal or "low end" representation. TIFF/JPEG (TIFF revision 6.0 as +modified by TIFF Technical Note #2) can be used for "high end" applications +that need to record a lot of additional data about an image. + + +TO DO +===== + +Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libjpeg_turbo.ijg ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libjpeg_turbo.md ]] +libjpeg-turbo Licenses +====================== + +libjpeg-turbo is covered by two compatible BSD-style open source licenses: + +- The IJG (Independent JPEG Group) License, which is listed in + [README.ijg](README.ijg) + + This license applies to the libjpeg API library and associated programs, + including any code inherited from libjpeg and any modifications to that + code. Note that the libjpeg-turbo SIMD source code bears the + [zlib License](https://opensource.org/licenses/Zlib), but in the context of + the overall libjpeg API library, the terms of the zlib License are subsumed + by the terms of the IJG License. + +- The Modified (3-clause) BSD License, which is listed below + + This license applies to the TurboJPEG API library and associated programs, as + well as the build system. Note that the TurboJPEG API library wraps the + libjpeg API library, so in the context of the overall TurboJPEG API library, + both the terms of the IJG License and the terms of the Modified (3-clause) + BSD License apply. + + +Complying with the libjpeg-turbo Licenses +========================================= + +This section provides a roll-up of the libjpeg-turbo licensing terms, to the +best of our understanding. This is not a license in and of itself. It is +intended solely for clarification. + +1. If you are distributing a modified version of the libjpeg-turbo source, + then: + + 1. You cannot alter or remove any existing copyright or license notices + from the source. + + **Origin** + - Clause 1 of the IJG License + - Clause 1 of the Modified BSD License + - Clauses 1 and 3 of the zlib License + + 2. You must add your own copyright notice to the header of each source + file you modified, so others can tell that you modified that file. (If + there is not an existing copyright header in that file, then you can + simply add a notice stating that you modified the file.) + + **Origin** + - Clause 1 of the IJG License + - Clause 2 of the zlib License + + 3. You must include the IJG README file, and you must not alter any of the + copyright or license text in that file. + + **Origin** + - Clause 1 of the IJG License + +2. If you are distributing only libjpeg-turbo binaries without the source, or + if you are distributing an application that statically links with + libjpeg-turbo, then: + + 1. Your product documentation must include a message stating: + + This software is based in part on the work of the Independent JPEG + Group. + + **Origin** + - Clause 2 of the IJG license + + 2. If your binary distribution includes or uses the TurboJPEG API, then + your product documentation must include the text of the Modified BSD + License (see below.) + + **Origin** + - Clause 2 of the Modified BSD License + +3. You cannot use the name of the IJG or The libjpeg-turbo Project or the + contributors thereof in advertising, publicity, etc. + + **Origin** + - IJG License + - Clause 3 of the Modified BSD License + +4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be + free of defects, nor do we accept any liability for undesirable + consequences resulting from your use of the software. + + **Origin** + - IJG License + - Modified BSD License + - zlib License + + +The Modified (3-clause) BSD License +=================================== + +Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.
+Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +Why Two Licenses? +================= + +The zlib License could have been used instead of the Modified (3-clause) BSD +License, and since the IJG License effectively subsumes the distribution +conditions of the zlib License, this would have effectively placed +libjpeg-turbo binary distributions under the IJG License. However, the IJG +License specifically refers to the Independent JPEG Group and does not extend +attribution and endorsement protections to other entities. Thus, it was +desirable to choose a license that granted us the same protections for new code +that were granted to the IJG for code derived from their software. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libjpeg_turbo.md ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libopenjpeg.txt ]] +/* + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third + * party and contributor rights, including patent rights, and no such rights + * are granted under this license. + * + * Copyright (c) 2005, Herve Drolon, FreeImage Team + * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR + * Copyright (c) 2012, CS Systemes d'Information, France + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libopenjpeg.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libpng.txt ]] +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2019 The PNG Reference Library Authors. + * Copyright (c) 2018-2019 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libpng.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libtiff.txt ]] +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/libtiff.txt ]] +[[ file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pbin_and_sbuild/brotli.txt: shared text T2 ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pbin_and_sbuild/libyuv.txt ]] +Copyright 2011 The LibYuv Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pbin_and_sbuild/libyuv.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pbin_musl/musl.txt ]] +musl as a whole is licensed under the following standard MIT license: + +---------------------------------------------------------------------- +Copyright © 2005-2020 Rich Felker, et al. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +---------------------------------------------------------------------- + +Authors/contributors include: + +A. Wilcox +Ada Worcester +Alex Dowad +Alex Suykov +Alexander Monakov +Andre McCurdy +Andrew Kelley +Anthony G. Basile +Aric Belsito +Arvid Picciani +Bartosz Brachaczek +Benjamin Peterson +Bobby Bingham +Boris Brezillon +Brent Cook +Chris Spiegel +Clément Vasseur +Daniel Micay +Daniel Sabogal +Daurnimator +David Carlier +David Edelsohn +Denys Vlasenko +Dmitry Ivanov +Dmitry V. Levin +Drew DeVault +Emil Renner Berthing +Fangrui Song +Felix Fietkau +Felix Janda +Gianluca Anzolin +Hauke Mehrtens +He X +Hiltjo Posthuma +Isaac Dunham +Jaydeep Patil +Jens Gustedt +Jeremy Huntwork +Jo-Philipp Wich +Joakim Sindholt +John Spencer +Julien Ramseier +Justin Cormack +Kaarle Ritvanen +Khem Raj +Kylie McClain +Leah Neukirchen +Luca Barbato +Luka Perkov +Lynn Ochs +M Farkas-Dyck (Strake) +Mahesh Bodapati +Markus Wichmann +Masanori Ogino +Michael Clark +Michael Forney +Mikhail Kremnyov +Natanael Copa +Nicholas J. Kain +orc +Pascal Cuoq +Patrick Oppenlander +Petr Hosek +Petr Skocik +Pierre Carrier +Reini Urban +Rich Felker +Richard Pennington +Ryan Fairfax +Samuel Holland +Segev Finer +Shiz +sin +Solar Designer +Stefan Kristiansson +Stefan O'Rear +Szabolcs Nagy +Timo Teräs +Trutz Behn +Will Dietz +William Haddon +William Pitcock + +Portions of this software are derived from third-party works licensed +under terms compatible with the above MIT license: + +The TRE regular expression implementation (src/regex/reg* and +src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed +under a 2-clause BSD license (license text in the source files). The +included version has been heavily modified by Rich Felker in 2012, in +the interests of size, simplicity, and namespace cleanliness. + +Much of the math library code (src/math/* and src/complex/*) is +Copyright © 1993,2004 Sun Microsystems or +Copyright © 2003-2011 David Schultz or +Copyright © 2003-2009 Steven G. Kargl or +Copyright © 2003-2009 Bruce D. Evans or +Copyright © 2008 Stephen L. Moshier or +Copyright © 2017-2018 Arm Limited +and labelled as such in comments in the individual source files. All +have been licensed under extremely permissive terms. + +The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008 +The Android Open Source Project and is licensed under a two-clause BSD +license. It was taken from Bionic libc, used on Android. + +The AArch64 memcpy and memset code (src/string/aarch64/*) are +Copyright © 1999-2019, Arm Limited. + +The implementation of DES for crypt (src/crypt/crypt_des.c) is +Copyright © 1994 David Burren. It is licensed under a BSD license. + +The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was +originally written by Solar Designer and placed into the public +domain. The code also comes with a fallback permissive license for use +in jurisdictions that may not recognize the public domain. + +The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011 +Lynn Ochs and is licensed under an MIT-style license. + +The x86_64 port was written by Nicholas J. Kain and is licensed under +the standard MIT terms. + +The mips and microblaze ports were originally written by Richard +Pennington for use in the ellcc project. The original code was adapted +by Rich Felker for build system and code conventions during upstream +integration. It is licensed under the standard MIT terms. + +The mips64 port was contributed by Imagination Technologies and is +licensed under the standard MIT terms. + +The powerpc port was also originally written by Richard Pennington, +and later supplemented and integrated by John Spencer. It is licensed +under the standard MIT terms. + +All other files which have no copyright comments are original works +produced specifically for use as part of this library, written either +by Rich Felker, the main author of the library, or by one or more +contibutors listed above. Details on authorship of individual files +can be found in the git version control history of the project. The +omission of copyright and license comments in each file is in the +interest of source tree size. + +In addition, permission is hereby granted for all public header files +(include/* and arch/*/bits/*) and crt files intended to be linked into +applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit +the copyright notice and permission notice otherwise required by the +license, and to use these files without any requirement of +attribution. These files include substantial contributions from: + +Bobby Bingham +John Spencer +Nicholas J. Kain +Rich Felker +Richard Pennington +Stefan Kristiansson +Szabolcs Nagy + +all of whom have explicitly granted such permission. + +This file previously contained text expressing a belief that most of +the files covered by the above exception were sufficiently trivial not +to be subject to copyright, resulting in confusion over whether it +negated the permissions granted in the license. In the spirit of +permissive licensing, and of not having licensing issues being an +obstacle to adoption, that text has been removed. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pbin_musl/musl.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pdfium-binaries.txt ]] +Copyright 2014-2026 Benoit Blanchon + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +This package also includes third-party software. See the licenses/ directory for their respective licenses. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pdfium-binaries.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pdfium.txt ]] +// Copyright 2014 The PDFium Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include ./SHARED/Apache-2.0.txt +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/pdfium.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/simdutf.txt ]] +Copyright 2021 The simdutf authors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/simdutf.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/bigint.txt ]] + + C++ Big Integer Library + (see ChangeLog for version) + + http://mattmccutchen.net/bigint/ + + Written and maintained by Matt McCutchen + +You can use this library in a C++ program to do arithmetic on integers of size +limited only by your computer's memory. The library provides BigUnsigned and +BigInteger classes that represent nonnegative integers and signed integers, +respectively. Most of the C++ arithmetic operators are overloaded for these +classes, so big-integer calculations are as easy as: + + #include "BigIntegerLibrary.hh" + + BigInteger a = 65536; + cout << (a * a * a * a * a * a * a * a); + + (prints 340282366920938463463374607431768211456) + +The code in `sample.cc' demonstrates the most important features of the library. +To get started quickly, read the code and explanations in that file and run it. +If you want more detail or a feature not shown in `sample.cc', consult the +consult the actual header and source files, which are thoroughly commented. + +This library emphasizes ease of use and clarity of implementation over speed; +some users will prefer GMP (http://swox.com/gmp/), which is faster. The code is +intended to be reasonably portable across computers and modern C++ compilers; in +particular, it uses whatever word size the computer provides (32-bit, 64-bit, or +otherwise). + +Compiling programs that use the library +--------------------------------------- +The library consists of a folder full of C++ header files (`.hh') and source +files (`.cc'). Your own programs should `#include' the necessary header files +and link with the source files. A makefile that builds the sample program +(`sample.cc') is included; you can adapt it to replace the sample with your own +program. + +Alternatively, you can use your own build system or IDE. In that case, you must +put the library header files where the compiler will find them and arrange to +have your program linked with the library source files; otherwise, you will get +errors about missing header files or "undefined references". To learn how to do +this, consult the documentation for the build system or IDE; don't bother asking +me. Adding all the library files to your project will work in many IDEs but may +not be the most desirable approach. + +Resources +--------- +The library's Web site (above) provides links to released versions, the current +development version, and a mailing list for release announcements, questions, +bug reports, and other discussion of the library. I would be delighted to hear +from you if you like this library and/or find a good use for it. + +Bugs and enhancements +--------------------- +The library has been tested by me and others but is by no means bug-free. If +you find a bug, please report it, whether it comes in the form of compiling +trouble, a mathematically inaccurate result, or a memory-management blooper +(since I use Java, these are altogether too common in my C++). I generally fix +all reported bugs. You are also welcome to request enhancements, but I am +unlikely to do substantial amounts of work on enhancements at this point. + +Legal +----- +I, Matt McCutchen, the sole author of the original Big Integer Library, waive my +copyright to it, placing it in the public domain. The library comes with +absolutely no warranty. + +~~~~ +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/bigint.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/fdlibm.txt ]] +Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunSoft, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/fdlibm.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/fp16.txt ]] +The MIT License (MIT) + +Copyright (c) 2017 Facebook Inc. +Copyright (c) 2017 Georgia Institute of Technology +Copyright 2019 Google LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/fp16.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/inspector_protocol.txt ]] +// Copyright 2016 The Chromium Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/inspector_protocol.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/strongtalk.txt ]] +Copyright (c) 1994-2006 Sun Microsystems Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistribution in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of Sun Microsystems or the names of contributors may +be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/strongtalk.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/v8.txt ]] +Copyright 2006-2011, the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/v8_xfa/v8.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/zlib.txt ]] +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.3.1, January 22nd, 2024 + + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 + (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). +*/ +[[ end file pypdfium2-5.15.2.dist-info/licenses/BUILD_LICENSES/zlib.txt ]] +[[ file pypdfium2-5.15.2.dist-info/licenses/LICENSES/Apache-2.0.txt: shared text T8 ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/LICENSES/BSD-3-Clause.txt ]] +Copyright (c) . + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file pypdfium2-5.15.2.dist-info/licenses/LICENSES/BSD-3-Clause.txt ]] +[[ begin file pypdfium2-5.15.2.dist-info/licenses/LICENSES/CC-BY-4.0.txt ]] +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. +[[ end file pypdfium2-5.15.2.dist-info/licenses/LICENSES/CC-BY-4.0.txt ]] + +============================================================================== +python: python-multipart 0.0.34 +Licence: Apache-2.0 +Source: https://github.com/Kludex/python-multipart +[[ file python_multipart-0.0.34.dist-info/licenses/LICENSE.txt: shared text T8 ]] + +============================================================================== +python: pyyaml 6.0.4 +Licence: MIT +Source: https://pyyaml.org/ +[[ begin file pyyaml-6.0.4.dist-info/licenses/LICENSE ]] +Copyright (c) 2017-2021 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file pyyaml-6.0.4.dist-info/licenses/LICENSE ]] + +============================================================================== +python: pyzipper 0.4.0 +Licence: MIT +Source: https://github.com/danifus/pyzipper +[[ begin file pyzipper-0.4.0.dist-info/licenses/AUTHORS.rst ]] +======= +Credits +======= + +Development Lead +---------------- + +* Daniel Hillier + +Contributors +------------ + +* Sebastian Weigand +[[ end file pyzipper-0.4.0.dist-info/licenses/AUTHORS.rst ]] +[[ begin file pyzipper-0.4.0.dist-info/licenses/LICENSE ]] +MIT License + +Copyright (c) 2017 Daniel Hillier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file pyzipper-0.4.0.dist-info/licenses/LICENSE ]] +[[ begin file pyzipper-0.4.0.dist-info/licenses/LICENSE.python ]] +pyzipper is licensed under the MIT license; see the file LICENSE for details. + +pyzipper is forked from the Python standard library and its tests, which are +licensed under the Python license, a permissive open source license. The +copyright and license is included below for compliance with Python's terms. + +---------------------------------------------------------------------- + +Copyright (c) 2001-present Python Software Foundation; All Rights Reserved + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001 Python Software Foundation; All Rights Reserved" +are retained in Python alone or in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +[[ end file pyzipper-0.4.0.dist-info/licenses/LICENSE.python ]] + +============================================================================== +python: rapidocr-onnxruntime 1.2.3 +Licence: Apache-2.0 +Source: https://github.com/RapidAI/RapidOCR +Note: The distribution carries no licence file; its licence is given above. + +============================================================================== +python: rawpy 0.27.1 +Licence: MIT +Source: https://github.com/letmaik/rawpy +[[ begin file rawpy-0.27.1.dist-info/licenses/LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2014 Maik Riechert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file rawpy-0.27.1.dist-info/licenses/LICENSE ]] +[[ begin file rawpy-0.27.1.dist-info/licenses/LICENSE.LibRaw ]] + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS +[[ end file rawpy-0.27.1.dist-info/licenses/LICENSE.LibRaw ]] + +============================================================================== +python: resvg-py 0.5.0 +Licence: see the licence text +Source: https://resvg-py.readthedocs.io/ +[[ begin file resvg_py-0.5.0.dist-info/licenses/LICENSE ]] +Copyright (C) 2024, baseplate-admin + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file resvg_py-0.5.0.dist-info/licenses/LICENSE ]] + +============================================================================== +python: shapely 2.2.0 +Licence: BSD-3-Clause +Source: https://shapely.readthedocs.io/ +[[ begin file shapely-2.2.0.dist-info/licenses/LICENSE.txt ]] +BSD 3-Clause License + +Copyright (c) 2007, Sean C. Gillies. 2019, Casper van der Wel. 2007-2022, Shapely Contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file shapely-2.2.0.dist-info/licenses/LICENSE.txt ]] +[[ begin file shapely-2.2.0.dist-info/licenses/LICENSE_GEOS ]] +This binary distribution of shapely also bundles the following software: + +Name: Geometry Engine Open Source (GEOS) +Files: libgeos-*.so.*, libgeos_c-*.so.*, libgeos.dylib, libgeos_c.dylib, geos-*.dll, geos_c-*.dll +Availability: https://libgeos.org +License: LGPLv2.1 + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +[[ end file shapely-2.2.0.dist-info/licenses/LICENSE_GEOS ]] + +============================================================================== +python: six 1.17.0 +Licence: MIT +Source: https://github.com/benjaminp/six +[[ begin file six-1.17.0.dist-info/LICENSE ]] +Copyright (c) 2010-2024 Benjamin Peterson + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file six-1.17.0.dist-info/LICENSE ]] + +============================================================================== +python: starlette 0.49.3 +Licence: BSD-3-Clause +Source: https://github.com/Kludex/starlette +[[ begin file starlette-0.49.3.dist-info/licenses/LICENSE.md ]] +Copyright © 2018, [Encode OSS Ltd](https://www.encode.io/). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file starlette-0.49.3.dist-info/licenses/LICENSE.md ]] + +============================================================================== +python: typing-extensions 4.16.0 +Licence: PSF-2.0 +Source: https://github.com/python/typing_extensions/issues +[[ file typing_extensions-4.16.0.dist-info/licenses/LICENSE: shared text T1 ]] + +============================================================================== +python: typing-inspection 0.4.5 +Licence: MIT +Source: https://github.com/pydantic/typing-inspection +[[ begin file typing_inspection-0.4.5.dist-info/licenses/LICENSE ]] +MIT License + +Copyright (c) Pydantic Services Inc. 2025 to present + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file typing_inspection-0.4.5.dist-info/licenses/LICENSE ]] + +============================================================================== +python: uvicorn 0.32.1 +Licence: BSD-3-Clause +Source: https://github.com/encode/uvicorn/blob/master/CHANGELOG.md +[[ begin file uvicorn-0.32.1.dist-info/licenses/LICENSE.md ]] +Copyright © 2017-present, [Encode OSS Ltd](https://www.encode.io/). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file uvicorn-0.32.1.dist-info/licenses/LICENSE.md ]] + +============================================================================== +npm: lottie-web 5.12.2 +Licence: MIT +Source: https://registry.npmjs.org/lottie-web/-/lottie-web-5.12.2.tgz +[[ begin file LICENSE.md ]] +The MIT License (MIT) + +Copyright (c) 2015 Bodymovin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE.md ]] + +============================================================================== +crate: adler2 2.0.1 +Licence: 0BSD OR MIT OR Apache-2.0 +Source: https://github.com/oyvindln/adler2 +[[ begin file LICENSE-0BSD ]] +Copyright (C) Jonas Schievink + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +[[ end file LICENSE-0BSD ]] +[[ file LICENSE-APACHE: shared text T9 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: aes 0.8.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/block-ciphers +[[ file LICENSE-APACHE: shared text T11 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018 Artyom Pavlov + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: aho-corasick 1.1.5 +Licence: Unlicense OR MIT +Source: https://github.com/BurntSushi/aho-corasick +[[ file COPYING: shared text T12 ]] +[[ file LICENSE-MIT: shared text T13 ]] +[[ file UNLICENSE: shared text T14 ]] + +============================================================================== +crate: alloc-no-stdlib 2.0.4 +Licence: BSD-3-Clause +Source: https://github.com/dropbox/rust-alloc-no-stdlib +[[ file LICENSE: shared text T15 ]] + +============================================================================== +crate: alloc-stdlib 0.2.4 +Licence: BSD-3-Clause +Source: https://github.com/dropbox/rust-alloc-no-stdlib +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: android_system_properties 0.1.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/nical/android_system_properties +[[ begin file LICENSE-APACHE ]] +Copyright 2016 Nicolas Silva + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +The MIT License (MIT) + +Copyright (c) 2013 Nicolas Silva + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: anyhow 1.0.104 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/anyhow +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-broadcast 0.7.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/smol-rs/async-broadcast +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2020 Yoshua Wuyts + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +The MIT License (MIT) + +Copyright (c) 2020 Yoshua Wuyts + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: async-channel 2.5.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-channel +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-executor 1.14.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-executor +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-fs 2.2.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-fs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-io 2.6.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-io +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-lock 3.4.2 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-lock +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-process 2.5.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-process +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-recursion 1.2.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dcchut/async-recursion +[[ file LICENSE-APACHE: shared text T18 ]] +[[ file LICENSE-MIT: shared text T19 ]] + +============================================================================== +crate: async-signal 0.2.14 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-signal +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-task 4.7.1 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/async-task +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: async-trait 0.1.92 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/async-trait +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: atk 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: atk-sys 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: atomic-waker 1.1.2 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/atomic-waker +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] +[[ file LICENSE-THIRD-PARTY: shared text T22 ]] + +============================================================================== +crate: autocfg 1.5.1 +Licence: Apache-2.0 OR MIT +Source: https://github.com/cuviper/autocfg +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018 Josh Stone + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: base64 0.21.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/marshallpierce/rust-base64 +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T23 ]] + +============================================================================== +crate: base64 0.22.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/marshallpierce/rust-base64 +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T23 ]] + +============================================================================== +crate: base64 0.23.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/marshallpierce/rust-base64 +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +The MIT License (MIT) + +Copyright (c) 2025 Alice Maz, Marshall Pierce + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: bit-set 0.8.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/contain-rs/bit-set +[[ file LICENSE-APACHE: shared text T24 ]] +[[ file LICENSE-MIT: shared text T25 ]] + +============================================================================== +crate: bit-vec 0.8.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/contain-rs/bit-vec +[[ file LICENSE-APACHE: shared text T24 ]] +[[ file LICENSE-MIT: shared text T25 ]] + +============================================================================== +crate: bitflags 1.3.2 +Licence: MIT/Apache-2.0 +Source: https://github.com/bitflags/bitflags +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: bitflags 2.13.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/bitflags/bitflags +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: block-buffer 0.10.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/utils +[[ file LICENSE-APACHE: shared text T11 ]] +[[ file LICENSE-MIT: shared text T27 ]] + +============================================================================== +crate: block-padding 0.3.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/utils +[[ file LICENSE-APACHE: shared text T11 ]] +[[ file LICENSE-MIT: shared text T27 ]] + +============================================================================== +crate: block2 0.6.2 +Licence: MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: blocking 1.7.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/blocking +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: brotli 8.0.4 +Licence: BSD-3-Clause AND MIT +Source: https://github.com/dropbox/rust-brotli +[[ file LICENSE.BSD-3-Clause: shared text T15 ]] +[[ file LICENSE.MIT: shared text T2 ]] + +============================================================================== +crate: brotli-decompressor 5.0.3 +Licence: BSD-3-Clause/MIT +Source: https://github.com/dropbox/rust-brotli-decompressor +[[ file LICENSE: shared text T15 ]] + +============================================================================== +crate: bumpalo 3.20.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/fitzgen/bumpalo +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2019 Nick Fitzgerald + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: bytemuck 1.25.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/Lokathor/bytemuck +[[ begin file LICENSE-APACHE ]] +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2019 Daniel "Lokathor" Gee. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] +[[ begin file LICENSE-ZLIB ]] +Copyright (c) 2019 Daniel "Lokathor" Gee. + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. +[[ end file LICENSE-ZLIB ]] + +============================================================================== +crate: byteorder 1.5.0 +Licence: Unlicense OR MIT +Source: https://github.com/BurntSushi/byteorder +[[ file COPYING: shared text T12 ]] +[[ file LICENSE-MIT: shared text T13 ]] +[[ file UNLICENSE: shared text T14 ]] + +============================================================================== +crate: byteorder-lite 0.1.0 +Licence: Unlicense OR MIT +Source: https://github.com/image-rs/byteorder-lite +[[ file LICENSE-MIT: shared text T13 ]] +[[ file UNLICENSE: shared text T14 ]] + +============================================================================== +crate: bytes 1.12.1 +Licence: MIT +Source: https://github.com/tokio-rs/bytes +[[ begin file LICENSE ]] +Copyright (c) 2018 Carl Lerche + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: cairo-rs 0.18.5 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: cairo-sys-rs 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: camino 1.2.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/camino-rs/camino +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: cargo-platform 0.1.9 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/cargo +[[ file LICENSE-APACHE: shared text T9 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: cargo_metadata 0.19.2 +Licence: MIT +Source: https://github.com/oli-obk/cargo_metadata +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: cargo_toml 0.22.3 +Licence: Apache-2.0 OR MIT +Source: https://gitlab.com/lib.rs/cargo_toml +[[ begin file LICENSE ]] +© Kornel Lesiński + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +---- + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: cbc 0.1.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/block-modes +[[ file LICENSE-APACHE: shared text T11 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018-2022 RustCrypto Developers +Copyright (c) 2018 Artyom Pavlov + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: cc 1.4.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/cc-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: cesu8 1.1.0 +Licence: Apache-2.0/MIT +Source: https://github.com/emk/cesu8-rs +[[ begin file COPYRIGHT-RUST.txt ]] +Short version for non-lawyers: + +The Rust Project is dual-licensed under Apache 2.0 and MIT +terms. + + +Longer version: + +The Rust Project is copyright 2014, The Rust Project +Developers (given in the file AUTHORS.txt). + +Licensed under the Apache License, Version 2.0 + or the MIT +license , +at your option. All files in the project carrying such +notice may not be copied, modified, or distributed except +according to those terms. + + +The Rust Project includes packages written by third parties. +The following third party packages are included, and carry +their own copyright notices and license terms: + +* Two header files that are part of the Valgrind + package. These files are found at src/rt/vg/valgrind.h and + src/rt/vg/memcheck.h, within this distribution. These files + are redistributed under the following terms, as noted in + them: + + for src/rt/vg/valgrind.h: + + This file is part of Valgrind, a dynamic binary + instrumentation framework. + + Copyright (C) 2000-2010 Julian Seward. All rights + reserved. + + Redistribution and use in source and binary forms, with + or without modification, are permitted provided that the + following conditions are met: + + 1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + + 2. The origin of this software must not be + misrepresented; you must not claim that you wrote the + original software. If you use this software in a + product, an acknowledgment in the product + documentation would be appreciated but is not + required. + + 3. Altered source versions must be plainly marked as + such, and must not be misrepresented as being the + original software. + + 4. The name of the author may not be used to endorse or + promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + + for src/rt/vg/memcheck.h: + + This file is part of MemCheck, a heavyweight Valgrind + tool for detecting memory errors. + + Copyright (C) 2000-2010 Julian Seward. All rights + reserved. + + Redistribution and use in source and binary forms, with + or without modification, are permitted provided that the + following conditions are met: + + 1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + + 2. The origin of this software must not be + misrepresented; you must not claim that you wrote the + original software. If you use this software in a + product, an acknowledgment in the product + documentation would be appreciated but is not + required. + + 3. Altered source versions must be plainly marked as + such, and must not be misrepresented as being the + original software. + + 4. The name of the author may not be used to endorse or + promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + +* The auxiliary file src/etc/pkg/modpath.iss contains a + library routine compiled, by Inno Setup, into the Windows + installer binary. This file is licensed under the LGPL, + version 3, but, in our legal interpretation, this does not + affect the aggregate "collected work" license of the Rust + distribution (MIT/ASL2) nor any other components of it. We + believe that the terms governing distribution of the + binary Windows installer built from modpath.iss are + therefore LGPL, but not the terms governing distribution + of any of the files installed by such an installer (such + as the Rust compiler or runtime libraries themselves). + +* The src/rt/miniz.c file, carrying an implementation of + RFC1950/RFC1951 DEFLATE, by Rich Geldreich + . All uses of this file are + permitted by the embedded "unlicense" notice + (effectively: public domain with warranty disclaimer). + +* LLVM. Code for this package is found in src/llvm. + + Copyright (c) 2003-2013 University of Illinois at + Urbana-Champaign. All rights reserved. + + Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal with the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + * Redistributions of source code must retain the + above copyright notice, this list of conditions + and the following disclaimers. + + * Redistributions in binary form must reproduce the + above copyright notice, this list of conditions + and the following disclaimers in the documentation + and/or other materials provided with the + distribution. + + * Neither the names of the LLVM Team, University of + Illinois at Urbana-Champaign, nor the names of its + contributors may be used to endorse or promote + products derived from this Software without + specific prior written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE + FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS WITH THE SOFTWARE. + +* Additional libraries included in LLVM carry separate + BSD-compatible licenses. See src/llvm/LICENSE.txt for + details. + +* compiler-rt, in src/compiler-rt is dual licensed under + LLVM's license and MIT: + + Copyright (c) 2009-2014 by the contributors listed in + CREDITS.TXT + + All rights reserved. + + Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal with the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + * Redistributions of source code must retain the + above copyright notice, this list of conditions + and the following disclaimers. + + * Redistributions in binary form must reproduce the + above copyright notice, this list of conditions + and the following disclaimers in the documentation + and/or other materials provided with the + distribution. + + * Neither the names of the LLVM Team, University of + Illinois at Urbana-Champaign, nor the names of its + contributors may be used to endorse or promote + products derived from this Software without + specific prior written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE + FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS WITH THE SOFTWARE. + + ======================================================== + + Copyright (c) 2009-2014 by the contributors listed in + CREDITS.TXT + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +* Portions of the FFI code for interacting with the native ABI + is derived from the Clay programming language, which carries + the following license. + + Copyright (C) 2008-2010 Tachyon Technologies. + All rights reserved. + + Redistribution and use in source and binary forms, with + or without modification, are permitted provided that the + following conditions are met: + + 1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + + 2. Redistributions in binary form must reproduce the + above copyright notice, this list of conditions and + the following disclaimer in the documentation and/or + other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + DEVELOPERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + +* Hoedown, the markdown parser, under src/rt/hoedown, is + licensed as follows. + + Copyright (c) 2008, Natacha Porté + Copyright (c) 2011, Vicent Martí + Copyright (c) 2013, Devin Torres and the Hoedown authors + + Permission to use, copy, modify, and distribute this + software for any purpose with or without fee is hereby + granted, provided that the above copyright notice and + this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR + DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +* libbacktrace, under src/libbacktrace: + + Copyright (C) 2012-2014 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Google. + + Redistribution and use in source and binary forms, with + or without modification, are permitted provided that the + following conditions are met: + + (1) Redistributions of source code must retain the + above copyright notice, this list of conditions and + the following disclaimer. + + (2) Redistributions in binary form must reproduce + the above copyright notice, this list of conditions + and the following disclaimer in the documentation + and/or other materials provided with the + distribution. + + (3) The name of the author may not be used to + endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. */ + +* jemalloc, under src/jemalloc: + + Copyright (C) 2002-2014 Jason Evans + . All rights reserved. + Copyright (C) 2007-2012 Mozilla Foundation. + All rights reserved. + Copyright (C) 2009-2014 Facebook, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice(s), + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice(s), + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + +* Additional copyright may be retained by contributors other + than Mozilla, the Rust Project Developers, or the parties + enumerated in this file. Such copyright can be determined + on a case-by-case basis by examining the author of each + portion of a file in the revision-control commit records + of the project, or by consulting representative comments + claiming copyright ownership for a file. + + For example, the text: + + "Copyright (c) 2011 Google Inc." + + appears in some files, and these files thereby denote + that their author and copyright-holder is Google Inc. + + In all such cases, the absence of explicit licensing text + indicates that the contributor chose to license their work + for distribution under identical terms to those Mozilla + has chosen for the collective work, enumerated at the top + of this file. The only difference is the retention of + copyright itself, held by the contributor. +[[ end file COPYRIGHT-RUST.txt ]] + +============================================================================== +crate: cfb 0.7.3 +Licence: MIT +Source: https://github.com/mdsteele/rust-cfb +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2017 Matthew D. Steele + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: cfg-expr 0.15.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/EmbarkStudios/cfg-expr +[[ file LICENSE-APACHE: shared text T24 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2019 Embark Studios + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: cfg-if 1.0.5 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/cfg-if +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: cfg_aliases 0.2.2 +Licence: MIT +Source: https://github.com/katharostech/cfg_aliases +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2020 Katharos Technology + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] +[[ begin file NOTICES.md ]] +# 3rd Party Notices + +The `cfg_aliases!` macro uses a lot of the code from [`tectonic_cfg_support::target_cfg!`] macro which is under the following license: + +[`tectonic_cfg_support::target_cfg!`]: https://github.com/tectonic-typesetting/tectonic/blob/f2439b936470ad27bdf92882064bc4702ee01899/cfg_support/src/lib.rs#L166 + + tectonic_cfg_support is licensed under the MIT License. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the “Software”), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +--- +[[ end file NOTICES.md ]] + +============================================================================== +crate: chrono 0.4.45 +Licence: MIT OR Apache-2.0 +Source: https://github.com/chronotope/chrono +[[ begin file LICENSE.txt ]] +Rust-chrono is dual-licensed under The MIT License [1] and +Apache 2.0 License [2]. Copyright (c) 2014--2026, Kang Seonghoon and +contributors. + +Nota Bene: This is same as the Rust Project's own license. + + +[1]: , which is reproduced below: + +~~~~ +The MIT License (MIT) + +Copyright (c) 2014, Kang Seonghoon. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +~~~~ + + +[2]: , which is reproduced below: + +~~~~ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +~~~~ +[[ end file LICENSE.txt ]] + +============================================================================== +crate: cipher 0.4.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/traits +[[ file LICENSE-APACHE: shared text T11 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2016-2020 RustCrypto Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: combine 4.6.8 +Licence: MIT +Source: https://github.com/Marwes/combine +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2015 Markus Westerlind + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: concurrent-queue 2.5.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/concurrent-queue +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: cookie 0.18.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/SergioBenitez/cookie-rs +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2017 Sergio Benitez +Copyright 2014 Alex Chricton + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017 Sergio Benitez +Copyright (c) 2014 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: core-foundation 0.10.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/core-foundation-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T29 ]] + +============================================================================== +crate: core-foundation-sys 0.8.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/core-foundation-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T29 ]] + +============================================================================== +crate: core-graphics 0.25.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/core-foundation-rs +[[ begin file COPYRIGHT ]] +Licensed under the Apache License, Version 2.0 or the MIT license +, at your +option. All files in the project carrying such notice may not be +copied, modified, or distributed except according to those terms. +[[ end file COPYRIGHT ]] +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T29 ]] + +============================================================================== +crate: core-graphics-types 0.2.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/core-foundation-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T29 ]] + +============================================================================== +crate: cpufeatures 0.2.17 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/utils +[[ file LICENSE-APACHE: shared text T11 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2020-2025 The RustCrypto Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: crc32fast 1.5.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/srijs/rust-crc32fast +[[ file LICENSE-APACHE: shared text T30 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2018 Sam Rijs, Alex Crichton and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: crossbeam-channel 0.5.17 +Licence: MIT OR Apache-2.0 +Source: https://github.com/crossbeam-rs/crossbeam +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T31 ]] +[[ begin file LICENSE-THIRD-PARTY ]] +=============================================================================== + +matching.go +https://creativecommons.org/licenses/by/3.0/legalcode + +Creative Commons Legal Code + +Attribution 3.0 Unported + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR + DAMAGES RESULTING FROM ITS USE. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE +COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY +COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS +AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE +TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY +BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS +CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND +CONDITIONS. + +1. Definitions + + a. "Adaptation" means a work based upon the Work, or upon the Work and + other pre-existing works, such as a translation, adaptation, + derivative work, arrangement of music or other alterations of a + literary or artistic work, or phonogram or performance and includes + cinematographic adaptations or any other form in which the Work may be + recast, transformed, or adapted including in any form recognizably + derived from the original, except that a work that constitutes a + Collection will not be considered an Adaptation for the purpose of + this License. For the avoidance of doubt, where the Work is a musical + work, performance or phonogram, the synchronization of the Work in + timed-relation with a moving image ("synching") will be considered an + Adaptation for the purpose of this License. + b. "Collection" means a collection of literary or artistic works, such as + encyclopedias and anthologies, or performances, phonograms or + broadcasts, or other works or subject matter other than works listed + in Section 1(f) below, which, by reason of the selection and + arrangement of their contents, constitute intellectual creations, in + which the Work is included in its entirety in unmodified form along + with one or more other contributions, each constituting separate and + independent works in themselves, which together are assembled into a + collective whole. A work that constitutes a Collection will not be + considered an Adaptation (as defined above) for the purposes of this + License. + c. "Distribute" means to make available to the public the original and + copies of the Work or Adaptation, as appropriate, through sale or + other transfer of ownership. + d. "Licensor" means the individual, individuals, entity or entities that + offer(s) the Work under the terms of this License. + e. "Original Author" means, in the case of a literary or artistic work, + the individual, individuals, entity or entities who created the Work + or if no individual or entity can be identified, the publisher; and in + addition (i) in the case of a performance the actors, singers, + musicians, dancers, and other persons who act, sing, deliver, declaim, + play in, interpret or otherwise perform literary or artistic works or + expressions of folklore; (ii) in the case of a phonogram the producer + being the person or legal entity who first fixes the sounds of a + performance or other sounds; and, (iii) in the case of broadcasts, the + organization that transmits the broadcast. + f. "Work" means the literary and/or artistic work offered under the terms + of this License including without limitation any production in the + literary, scientific and artistic domain, whatever may be the mode or + form of its expression including digital form, such as a book, + pamphlet and other writing; a lecture, address, sermon or other work + of the same nature; a dramatic or dramatico-musical work; a + choreographic work or entertainment in dumb show; a musical + composition with or without words; a cinematographic work to which are + assimilated works expressed by a process analogous to cinematography; + a work of drawing, painting, architecture, sculpture, engraving or + lithography; a photographic work to which are assimilated works + expressed by a process analogous to photography; a work of applied + art; an illustration, map, plan, sketch or three-dimensional work + relative to geography, topography, architecture or science; a + performance; a broadcast; a phonogram; a compilation of data to the + extent it is protected as a copyrightable work; or a work performed by + a variety or circus performer to the extent it is not otherwise + considered a literary or artistic work. + g. "You" means an individual or entity exercising rights under this + License who has not previously violated the terms of this License with + respect to the Work, or who has received express permission from the + Licensor to exercise rights under this License despite a previous + violation. + h. "Publicly Perform" means to perform public recitations of the Work and + to communicate to the public those public recitations, by any means or + process, including by wire or wireless means or public digital + performances; to make available to the public Works in such a way that + members of the public may access these Works from a place and at a + place individually chosen by them; to perform the Work to the public + by any means or process and the communication to the public of the + performances of the Work, including by public digital performance; to + broadcast and rebroadcast the Work by any means including signs, + sounds or images. + i. "Reproduce" means to make copies of the Work by any means including + without limitation by sound or visual recordings and the right of + fixation and reproducing fixations of the Work, including storage of a + protected performance or phonogram in digital form or other electronic + medium. + +2. Fair Dealing Rights. Nothing in this License is intended to reduce, +limit, or restrict any uses free from copyright or rights arising from +limitations or exceptions that are provided for in connection with the +copyright protection under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, +Licensor hereby grants You a worldwide, royalty-free, non-exclusive, +perpetual (for the duration of the applicable copyright) license to +exercise the rights in the Work as stated below: + + a. to Reproduce the Work, to incorporate the Work into one or more + Collections, and to Reproduce the Work as incorporated in the + Collections; + b. to create and Reproduce Adaptations provided that any such Adaptation, + including any translation in any medium, takes reasonable steps to + clearly label, demarcate or otherwise identify that changes were made + to the original Work. For example, a translation could be marked "The + original work was translated from English to Spanish," or a + modification could indicate "The original work has been modified."; + c. to Distribute and Publicly Perform the Work including as incorporated + in Collections; and, + d. to Distribute and Publicly Perform Adaptations. + e. For the avoidance of doubt: + + i. Non-waivable Compulsory License Schemes. In those jurisdictions in + which the right to collect royalties through any statutory or + compulsory licensing scheme cannot be waived, the Licensor + reserves the exclusive right to collect such royalties for any + exercise by You of the rights granted under this License; + ii. Waivable Compulsory License Schemes. In those jurisdictions in + which the right to collect royalties through any statutory or + compulsory licensing scheme can be waived, the Licensor waives the + exclusive right to collect such royalties for any exercise by You + of the rights granted under this License; and, + iii. Voluntary License Schemes. The Licensor waives the right to + collect royalties, whether individually or, in the event that the + Licensor is a member of a collecting society that administers + voluntary licensing schemes, via that society, from any exercise + by You of the rights granted under this License. + +The above rights may be exercised in all media and formats whether now +known or hereafter devised. The above rights include the right to make +such modifications as are technically necessary to exercise the rights in +other media and formats. Subject to Section 8(f), all rights not expressly +granted by Licensor are hereby reserved. + +4. Restrictions. The license granted in Section 3 above is expressly made +subject to and limited by the following restrictions: + + a. You may Distribute or Publicly Perform the Work only under the terms + of this License. You must include a copy of, or the Uniform Resource + Identifier (URI) for, this License with every copy of the Work You + Distribute or Publicly Perform. You may not offer or impose any terms + on the Work that restrict the terms of this License or the ability of + the recipient of the Work to exercise the rights granted to that + recipient under the terms of the License. You may not sublicense the + Work. You must keep intact all notices that refer to this License and + to the disclaimer of warranties with every copy of the Work You + Distribute or Publicly Perform. When You Distribute or Publicly + Perform the Work, You may not impose any effective technological + measures on the Work that restrict the ability of a recipient of the + Work from You to exercise the rights granted to that recipient under + the terms of the License. This Section 4(a) applies to the Work as + incorporated in a Collection, but this does not require the Collection + apart from the Work itself to be made subject to the terms of this + License. If You create a Collection, upon notice from any Licensor You + must, to the extent practicable, remove from the Collection any credit + as required by Section 4(b), as requested. If You create an + Adaptation, upon notice from any Licensor You must, to the extent + practicable, remove from the Adaptation any credit as required by + Section 4(b), as requested. + b. If You Distribute, or Publicly Perform the Work or any Adaptations or + Collections, You must, unless a request has been made pursuant to + Section 4(a), keep intact all copyright notices for the Work and + provide, reasonable to the medium or means You are utilizing: (i) the + name of the Original Author (or pseudonym, if applicable) if supplied, + and/or if the Original Author and/or Licensor designate another party + or parties (e.g., a sponsor institute, publishing entity, journal) for + attribution ("Attribution Parties") in Licensor's copyright notice, + terms of service or by other reasonable means, the name of such party + or parties; (ii) the title of the Work if supplied; (iii) to the + extent reasonably practicable, the URI, if any, that Licensor + specifies to be associated with the Work, unless such URI does not + refer to the copyright notice or licensing information for the Work; + and (iv) , consistent with Section 3(b), in the case of an Adaptation, + a credit identifying the use of the Work in the Adaptation (e.g., + "French translation of the Work by Original Author," or "Screenplay + based on original Work by Original Author"). The credit required by + this Section 4 (b) may be implemented in any reasonable manner; + provided, however, that in the case of a Adaptation or Collection, at + a minimum such credit will appear, if a credit for all contributing + authors of the Adaptation or Collection appears, then as part of these + credits and in a manner at least as prominent as the credits for the + other contributing authors. For the avoidance of doubt, You may only + use the credit required by this Section for the purpose of attribution + in the manner set out above and, by exercising Your rights under this + License, You may not implicitly or explicitly assert or imply any + connection with, sponsorship or endorsement by the Original Author, + Licensor and/or Attribution Parties, as appropriate, of You or Your + use of the Work, without the separate, express prior written + permission of the Original Author, Licensor and/or Attribution + Parties. + c. Except as otherwise agreed in writing by the Licensor or as may be + otherwise permitted by applicable law, if You Reproduce, Distribute or + Publicly Perform the Work either by itself or as part of any + Adaptations or Collections, You must not distort, mutilate, modify or + take other derogatory action in relation to the Work which would be + prejudicial to the Original Author's honor or reputation. Licensor + agrees that in those jurisdictions (e.g. Japan), in which any exercise + of the right granted in Section 3(b) of this License (the right to + make Adaptations) would be deemed to be a distortion, mutilation, + modification or other derogatory action prejudicial to the Original + Author's honor and reputation, the Licensor will waive or not assert, + as appropriate, this Section, to the fullest extent permitted by the + applicable national law, to enable You to reasonably exercise Your + right under Section 3(b) of this License (right to make Adaptations) + but not otherwise. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR +OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY +KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, +INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, +FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF +LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, +WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION +OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE +LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR +ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES +ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + a. This License and the rights granted hereunder will terminate + automatically upon any breach by You of the terms of this License. + Individuals or entities who have received Adaptations or Collections + from You under this License, however, will not have their licenses + terminated provided such individuals or entities remain in full + compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will + survive any termination of this License. + b. Subject to the above terms and conditions, the license granted here is + perpetual (for the duration of the applicable copyright in the Work). + Notwithstanding the above, Licensor reserves the right to release the + Work under different license terms or to stop distributing the Work at + any time; provided, however that any such election will not serve to + withdraw this License (or any other license that has been, or is + required to be, granted under the terms of this License), and this + License will continue in full force and effect unless terminated as + stated above. + +8. Miscellaneous + + a. Each time You Distribute or Publicly Perform the Work or a Collection, + the Licensor offers to the recipient a license to the Work on the same + terms and conditions as the license granted to You under this License. + b. Each time You Distribute or Publicly Perform an Adaptation, Licensor + offers to the recipient a license to the original Work on the same + terms and conditions as the license granted to You under this License. + c. If any provision of this License is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of + the remainder of the terms of this License, and without further action + by the parties to this agreement, such provision shall be reformed to + the minimum extent necessary to make such provision valid and + enforceable. + d. No term or provision of this License shall be deemed waived and no + breach consented to unless such waiver or consent shall be in writing + and signed by the party to be charged with such waiver or consent. + e. This License constitutes the entire agreement between the parties with + respect to the Work licensed here. There are no understandings, + agreements or representations with respect to the Work not specified + here. Licensor shall not be bound by any additional provisions that + may appear in any communication from You. This License may not be + modified without the mutual written agreement of the Licensor and You. + f. The rights granted under, and the subject matter referenced, in this + License were drafted utilizing the terminology of the Berne Convention + for the Protection of Literary and Artistic Works (as amended on + September 28, 1979), the Rome Convention of 1961, the WIPO Copyright + Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 + and the Universal Copyright Convention (as revised on July 24, 1971). + These rights and subject matter take effect in the relevant + jurisdiction in which the License terms are sought to be enforced + according to the corresponding provisions of the implementation of + those treaty provisions in the applicable national law. If the + standard suite of rights granted under applicable copyright law + includes additional rights not granted under this License, such + additional rights are deemed to be included in the License; this + License is not intended to restrict the license of any rights under + applicable law. + + +Creative Commons Notice + + Creative Commons is not a party to this License, and makes no warranty + whatsoever in connection with the Work. Creative Commons will not be + liable to You or any party on any legal theory for any damages + whatsoever, including without limitation any general, special, + incidental or consequential damages arising in connection to this + license. Notwithstanding the foregoing two (2) sentences, if Creative + Commons has expressly identified itself as the Licensor hereunder, it + shall have all rights and obligations of Licensor. + + Except for the limited purpose of indicating to the public that the + Work is licensed under the CCPL, Creative Commons does not authorize + the use by either party of the trademark "Creative Commons" or any + related trademark or logo of Creative Commons without the prior + written consent of Creative Commons. Any permitted use will be in + compliance with Creative Commons' then-current trademark usage + guidelines, as may be published on its website or otherwise made + available upon request from time to time. For the avoidance of doubt, + this trademark restriction does not form part of this License. + + Creative Commons may be contacted at https://creativecommons.org/. + +=============================================================================== + +The Go Programming Language +https://golang.org/LICENSE + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=============================================================================== + +The Rust Programming Language +https://github.com/rust-lang/rust/blob/master/LICENSE-MIT + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +=============================================================================== + +The Rust Programming Language +https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-THIRD-PARTY ]] + +============================================================================== +crate: crossbeam-utils 0.8.23 +Licence: MIT OR Apache-2.0 +Source: https://github.com/crossbeam-rs/crossbeam +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T31 ]] + +============================================================================== +crate: crypto-common 0.1.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/traits +[[ file LICENSE-APACHE: shared text T11 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2021 RustCrypto Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: cssparser 0.36.0 +Licence: MPL-2.0 +Source: https://github.com/servo/rust-cssparser +[[ file LICENSE: shared text T32 ]] + +============================================================================== +crate: cssparser-macros 0.6.1 +Licence: MPL-2.0 +Source: https://github.com/servo/rust-cssparser +[[ file LICENSE: shared text T32 ]] + +============================================================================== +crate: ctor 0.8.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/mmastrac/rust-ctor +[[ file LICENSE-APACHE: shared text T33 ]] +[[ file LICENSE-MIT: shared text T34 ]] + +============================================================================== +crate: ctor-proc-macro 0.0.7 +Licence: Apache-2.0 OR MIT +Source: https://github.com/mmastrac/rust-ctor +[[ file LICENSE-APACHE: shared text T33 ]] +[[ file LICENSE-MIT: shared text T34 ]] + +============================================================================== +crate: darling 0.20.11 +Licence: MIT +Source: https://github.com/TedDriggs/darling +[[ file LICENSE: shared text T35 ]] + +============================================================================== +crate: darling_core 0.20.11 +Licence: MIT +Source: https://github.com/TedDriggs/darling +[[ file LICENSE: shared text T35 ]] + +============================================================================== +crate: darling_macro 0.20.11 +Licence: MIT +Source: https://github.com/TedDriggs/darling +[[ file LICENSE: shared text T35 ]] + +============================================================================== +crate: dbus 0.9.12 +Licence: Apache-2.0/MIT +Source: https://github.com/diwic/dbus-rs +[[ file LICENSE-APACHE: shared text T36 ]] +[[ file LICENSE-MIT: shared text T37 ]] + +============================================================================== +crate: dbus-secret-service 4.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/brotskydotcom/dbus-secret-service.git +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T38 ]] + +============================================================================== +crate: deranged 0.5.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jhpratt/deranged +[[ begin file LICENSE-Apache ]] + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Jacob Pratt et al. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end file LICENSE-Apache ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2024 Jacob Pratt et al. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: derive_more 2.1.1 +Licence: MIT +Source: https://github.com/JelteF/derive_more +[[ file LICENSE: shared text T39 ]] + +============================================================================== +crate: derive_more-impl 2.1.1 +Licence: MIT +Source: https://github.com/JelteF/derive_more +[[ file LICENSE: shared text T39 ]] + +============================================================================== +crate: digest 0.10.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/traits +[[ file LICENSE-APACHE: shared text T11 ]] +[[ file LICENSE-MIT: shared text T40 ]] + +============================================================================== +crate: dirs 6.0.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/soc/dirs-rs +[[ file LICENSE-APACHE: shared text T41 ]] +[[ file LICENSE-MIT: shared text T42 ]] + +============================================================================== +crate: dirs-sys 0.5.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dirs-dev/dirs-sys-rs +[[ file LICENSE-APACHE: shared text T41 ]] +[[ file LICENSE-MIT: shared text T42 ]] + +============================================================================== +crate: dispatch2 0.3.1 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: displaydoc 0.2.5 +Licence: MIT OR Apache-2.0 +Source: https://github.com/yaahc/displaydoc +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: dlopen2 0.8.2 +Licence: MIT +Source: https://github.com/OpenByteDev/dlopen2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: dlopen2_derive 0.4.3 +Licence: MIT +Source: https://github.com/OpenByteDev/dlopen2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: dom_query 0.27.0 +Licence: MIT +Source: https://github.com/niklak/dom_query +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2023 Mykola Humanov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +This project contains portions of code and architectural concepts originally +derived from the "nipper" project (https://github.com/importcjj/nipper), +developed by Chen Jiaju, licensed under the MIT License and the Apache License 2.0 (dual licensed). +[[ end file LICENSE ]] + +============================================================================== +crate: dpi 0.1.2 +Licence: Apache-2.0 AND MIT +Source: https://github.com/rust-windowing/winit +[[ file LICENSE: shared text T43 ]] +[[ begin file LICENSE-LIBM-MIT ]] +rust-lang/libm as a whole is available for use under the MIT license: + +------------------------------------------------------------------------------ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ + +This Rust library contains the following copyrights: + + Copyright (c) 2018 Jorge Aparicio + +Portions of this software are derived from third-party works licensed under +terms compatible with the above MIT license: + +* musl libc https://www.musl-libc.org/. This library contains the following + copyright: + + Copyright © 2005-2020 Rich Felker, et al. + +* The CORE-MATH project https://core-math.gitlabpages.inria.fr/. CORE-MATH + routines are available under the MIT license on a per-file basis. + +The musl libc COPYRIGHT file also includes the following notice relevant to +math portions of the library: + +------------------------------------------------------------------------------ +Much of the math library code (src/math/* and src/complex/*) is +Copyright © 1993,2004 Sun Microsystems or +Copyright © 2003-2011 David Schultz or +Copyright © 2003-2009 Steven G. Kargl or +Copyright © 2003-2009 Bruce D. Evans or +Copyright © 2008 Stephen L. Moshier or +Copyright © 2017-2018 Arm Limited +and labelled as such in comments in the individual source files. All +have been licensed under extremely permissive terms. +------------------------------------------------------------------------------ +[[ end file LICENSE-LIBM-MIT ]] + +============================================================================== +crate: dtoa 1.0.11 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/dtoa +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: dtoa-short 0.3.5 +Licence: MPL-2.0 +Source: https://github.com/upsuper/dtoa-short +[[ begin file LICENSE ]] +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +[[ end file LICENSE ]] + +============================================================================== +crate: dtor 0.3.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/mmastrac/rust-ctor +[[ file LICENSE-APACHE: shared text T33 ]] +[[ file LICENSE-MIT: shared text T34 ]] + +============================================================================== +crate: dtor-proc-macro 0.0.6 +Licence: Apache-2.0 OR MIT +Source: https://github.com/mmastrac/rust-ctor +[[ file LICENSE-APACHE: shared text T33 ]] +[[ file LICENSE-MIT: shared text T34 ]] + +============================================================================== +crate: dunce 1.0.5 +Licence: CC0-1.0 OR MIT-0 OR Apache-2.0 +Source: https://gitlab.com/kornelski/dunce +[[ begin file LICENSE ]] +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. +[[ end file LICENSE ]] + +============================================================================== +crate: dyn-clone 1.0.20 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/dyn-clone +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: embed-resource 3.0.11 +Licence: MIT +Source: https://github.com/nabijaczleweli/rust-embed-resource +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2017 nabijaczleweli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: embed_plist 1.2.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/nvzqz/embed-plist-rs +[[ file LICENSE-APACHE: shared text T8 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2020 Nikolai Vazquez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: endi 1.1.1 +Licence: MIT +Source: https://github.com/zeenix/endi +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: enumflags2 0.7.12 +Licence: MIT OR Apache-2.0 +Source: https://github.com/meithecatte/enumflags2 +[[ begin file LICENSE-APACHE ]] +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + + +Copyright 2017-2023 Maik Klein, Maja Kądziołka + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017-2023 Maik Klein, Maja Kądziołka + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: enumflags2_derive 0.7.12 +Licence: MIT OR Apache-2.0 +Source: https://github.com/meithecatte/enumflags2 +[[ begin file LICENSE-APACHE ]] +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + + +Copyright [2017] [Maik Klein] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017 Maik Klein + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: equivalent 1.0.2 +Licence: Apache-2.0 OR MIT +Source: https://github.com/indexmap-rs/equivalent +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2016--2023 + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: erased-serde 0.4.10 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/erased-serde +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: errno 0.3.14 +Licence: MIT OR Apache-2.0 +Source: https://github.com/lambda-fairy/rust-errno +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2014 Chris Wong + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: event-listener 5.4.2 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/event-listener +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: event-listener-strategy 0.5.4 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/event-listener-strategy +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: fastrand 2.5.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/fastrand +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: fdeflate 0.3.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/image-rs/fdeflate +[[ file LICENSE-APACHE: shared text T6 ]] +[[ file LICENSE-MIT: shared text T44 ]] + +============================================================================== +crate: field-offset 0.3.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/Diggsey/rust-field-offset +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2016-2021 Diggory Blake, and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: find-msvc-tools 0.1.13 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/cc-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: flate2 1.1.10 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/flate2-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2014-2026 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: fnv 1.0.7 +Licence: Apache-2.0 / MIT +Source: https://github.com/servo/rust-fnv +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017 Contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: foldhash 0.2.0 +Licence: Zlib +Source: https://github.com/orlp/foldhash +[[ begin file LICENSE ]] +Copyright (c) 2024 Orson Peters + +This software is provided 'as-is', without any express or implied warranty. In +no event will the authors be held liable for any damages arising from the use of +this software. + +Permission is granted to anyone to use this software for any purpose, including +commercial applications, and to alter it and redistribute it freely, subject to +the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim + that you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. +[[ end file LICENSE ]] + +============================================================================== +crate: foreign-types 0.5.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/sfackler/foreign-types +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T45 ]] + +============================================================================== +crate: foreign-types-macros 0.2.4 +Licence: MIT/Apache-2.0 +Source: https://github.com/sfackler/foreign-types +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T45 ]] + +============================================================================== +crate: foreign-types-shared 0.3.1 +Licence: MIT/Apache-2.0 +Source: https://github.com/sfackler/foreign-types +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T45 ]] + +============================================================================== +crate: form_urlencoded 1.2.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/rust-url +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2013-2016 The rust-url developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: futures-channel 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: futures-core 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: futures-executor 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: futures-io 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: futures-lite 2.6.1 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/futures-lite +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] +[[ file LICENSE-THIRD-PARTY: shared text T22 ]] + +============================================================================== +crate: futures-macro 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: futures-sink 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: futures-task 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: futures-util 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/futures-rs +[[ file LICENSE-APACHE: shared text T46 ]] +[[ file LICENSE-MIT: shared text T47 ]] + +============================================================================== +crate: gdk 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gdk-pixbuf 0.18.5 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gdk-pixbuf-sys 0.18.0 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gdk-sys 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gdkwayland-sys 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gdkx11 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gdkx11-sys 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: generic-array 0.14.7 +Licence: MIT +Source: https://github.com/fizyk20/generic-array.git +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2015 Bartłomiej Kamiński + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: getrandom 0.2.17 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-random/getrandom +[[ file LICENSE-APACHE: shared text T48 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018-2024 The rust-random Project Developers +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: getrandom 0.3.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-random/getrandom +[[ file LICENSE-APACHE: shared text T48 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018-2025 The rust-random Project Developers +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: getrandom 0.4.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-random/getrandom +[[ file LICENSE-APACHE: shared text T48 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018-2026 The rust-random Project Developers +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: gio 0.18.4 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gio-sys 0.18.1 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: glib 0.18.5 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: glib-macros 0.18.5 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: glib-sys 0.18.1 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: glob 0.3.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/glob +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: gobject-sys 0.18.0 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gtk 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gtk-sys 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: gtk3-macros 0.18.2 +Licence: MIT +Source: https://github.com/gtk-rs/gtk3-rs +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: hashbrown 0.12.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/hashbrown +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T49 ]] + +============================================================================== +crate: hashbrown 0.17.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/hashbrown +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T49 ]] + +============================================================================== +crate: heck 0.4.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/withoutboats/heck +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T50 ]] + +============================================================================== +crate: heck 0.5.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/withoutboats/heck +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T50 ]] + +============================================================================== +crate: hermit-abi 0.5.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/hermit-os/hermit-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: hex 0.4.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/KokaKiwi/rust-hex +[[ file LICENSE-APACHE: shared text T30 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2013-2014 The Rust Project Developers. +Copyright (c) 2015-2020 The rust-hex Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: hkdf 0.12.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/KDFs/ +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2015-2018 Vlad Filippov +Copyright (c) 2018-2021 RustCrypto Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: hmac 0.12.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/MACs +[[ file LICENSE-APACHE: shared text T11 ]] +[[ file LICENSE-MIT: shared text T40 ]] + +============================================================================== +crate: html5ever 0.38.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/html5ever +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T51 ]] + +============================================================================== +crate: http 1.5.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/hyperium/http +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2017 http-rs authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017 http-rs authors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: http-body 1.1.0 +Licence: MIT +Source: https://github.com/hyperium/http-body +[[ file LICENSE: shared text T52 ]] + +============================================================================== +crate: http-body-util 0.1.5 +Licence: MIT +Source: https://github.com/hyperium/http-body +[[ file LICENSE: shared text T52 ]] + +============================================================================== +crate: httparse 1.10.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/seanmonstar/httparse +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2015-2025 Sean McArthur + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: hyper 1.11.1 +Licence: MIT +Source: https://github.com/hyperium/hyper +[[ begin file LICENSE ]] +Copyright (c) 2014-2026 Sean McArthur + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: hyper-util 0.1.20 +Licence: MIT +Source: https://github.com/hyperium/hyper-util +[[ begin file LICENSE ]] +Copyright (c) 2023-2025 Sean McArthur + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: iana-time-zone 0.1.65 +Licence: MIT OR Apache-2.0 +Source: https://github.com/strawlab/iana-time-zone +[[ file LICENSE-APACHE: shared text T53 ]] +[[ file LICENSE-MIT: shared text T54 ]] + +============================================================================== +crate: iana-time-zone-haiku 0.1.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/strawlab/iana-time-zone +[[ file LICENSE-APACHE: shared text T53 ]] +[[ file LICENSE-MIT: shared text T54 ]] + +============================================================================== +crate: ico 0.5.0 +Licence: MIT +Source: https://github.com/mdsteele/rust-ico +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2018 Matthew D. Steele + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: icu_collections 2.3.0 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: icu_locale_core 2.3.0 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: icu_normalizer 2.3.0 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: icu_normalizer_data 2.3.0 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: icu_properties 2.3.0 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: icu_properties_data 2.3.0 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: icu_provider 2.3.1 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: ident_case 1.0.1 +Licence: MIT/Apache-2.0 +Source: https://github.com/TedDriggs/ident_case +[[ begin file LICENSE ]] +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: idna 1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/rust-url/ +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T56 ]] + +============================================================================== +crate: idna_adapter 1.2.2 +Licence: Apache-2.0 OR MIT +Source: https://github.com/hsivonen/idna_adapter +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) The rust-url developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: image 0.25.10 +Licence: MIT OR Apache-2.0 +Source: https://github.com/image-rs/image +[[ file LICENSE-APACHE: shared text T6 ]] +[[ file LICENSE-MIT: shared text T44 ]] + +============================================================================== +crate: indexmap 1.9.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/bluss/indexmap +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T57 ]] + +============================================================================== +crate: indexmap 2.14.2 +Licence: Apache-2.0 OR MIT +Source: https://github.com/indexmap-rs/indexmap +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T57 ]] + +============================================================================== +crate: infer 0.19.0 +Licence: MIT +Source: https://github.com/bojand/infer +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2019 Bojan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: inout 0.1.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/utils +[[ file LICENSE-APACHE: shared text T11 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2022 The RustCrypto Project Developers +Copyright (c) 2022 Artyom Pavlov + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: ipnet 2.12.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/krisprice/ipnet +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 Juniper Networks, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright 2017 Juniper Networks, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: itoa 1.0.18 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/itoa +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: javascriptcore-rs 1.1.2 +Licence: MIT +Source: https://github.com/tauri-apps/javascriptcore-rs +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2013-2021, The Gtk-rs Project Developers. +Copyright (c) 2021, Tauri Programme within The Commons Conservancy. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: javascriptcore-rs-sys 1.1.1 +Licence: MIT +Source: https://github.com/tauri-apps/javascriptcore-rs +[[ file LICENSE: shared text T58 ]] + +============================================================================== +crate: jni 0.21.1 +Licence: MIT/Apache-2.0 +Source: https://github.com/jni-rs/jni-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +The MIT License (MIT) + +Copyright (c) 2016 Prevoty, Inc. and jni-rs contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: jni-sys 0.3.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jni-rs/jni-sys +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T59 ]] + +============================================================================== +crate: jni-sys 0.4.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jni-rs/jni-sys +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T59 ]] + +============================================================================== +crate: jni-sys-macros 0.4.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jni-rs/jni-sys +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: js-sys 0.3.105 +Licence: MIT OR Apache-2.0 +Source: https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: json-patch 3.0.1 +Licence: MIT/Apache-2.0 +Source: https://github.com/idubrov/json-patch +[[ file LICENSE-APACHE: shared text T60 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2017 Ivan Dubrov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: jsonptr 0.6.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/chanced/jsonptr +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2024 Chance Dinkins + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2022 Chance Dinkins + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: keyboard-types 0.7.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/pyfisch/keyboard-types +[[ file LICENSE-APACHE: shared text T18 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017 Pyfisch + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: keyring 3.6.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/hwchen/keyring-rs.git +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [2017] [keyring developers] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2016 keyring Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: libappindicator 0.9.0 +Licence: Apache-2.0 OR MIT +Source: https://crates.io/crates/libappindicator/0.9.0 +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2017-2021 qDot +Copyright (c) 2021 Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: libappindicator-sys 0.9.0 +Licence: Apache-2.0 OR MIT +Source: https://crates.io/crates/libappindicator-sys/0.9.0 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: libc 0.2.189 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/libc +[[ file LICENSE-APACHE: shared text T16 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: libdbus-sys 0.2.7 +Licence: Apache-2.0/MIT +Source: https://github.com/diwic/dbus-rs +[[ file LICENSE-APACHE: shared text T36 ]] +[[ file LICENSE-MIT: shared text T37 ]] + +============================================================================== +crate: libloading 0.7.4 +Licence: ISC +Source: https://github.com/nagisa/rust_libloading/ +[[ file LICENSE: shared text T61 ]] + +============================================================================== +crate: libloading 0.8.9 +Licence: ISC +Source: https://github.com/nagisa/rust_libloading/ +[[ file LICENSE: shared text T61 ]] + +============================================================================== +crate: libredox 0.1.24 +Licence: MIT +Source: https://gitlab.redox-os.org/redox-os/libredox.git +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2023 4lDO2 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: linux-raw-sys 0.12.1 +Licence: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +Source: https://github.com/sunfishcode/linux-raw-sys +[[ begin file COPYRIGHT ]] +Short version for non-lawyers: + +`linux-raw-sys` is triple-licensed under Apache 2.0 with the LLVM Exception, +Apache 2.0, and MIT terms. + + +Longer version: + +Copyrights in the `linux-raw-sys` project are retained by their contributors. +No copyright assignment is required to contribute to the `linux-raw-sys` +project. + +Some files include code derived from Rust's `libstd`; see the comments in +the code for details. + +Except as otherwise noted (below and/or in individual files), `linux-raw-sys` +is licensed under: + + - the Apache License, Version 2.0, with the LLVM Exception + or + + - the Apache License, Version 2.0 + or + , + - or the MIT license + or + , + +at your option. +[[ end file COPYRIGHT ]] +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-Apache-2.0_WITH_LLVM-exception: shared text T62 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: litemap 0.8.3 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: lock_api 0.4.14 +Licence: MIT OR Apache-2.0 +Source: https://github.com/Amanieu/parking_lot +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T63 ]] + +============================================================================== +crate: log 0.4.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/log +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: markup5ever 0.38.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/html5ever +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T51 ]] + +============================================================================== +crate: memchr 2.8.3 +Licence: Unlicense OR MIT +Source: https://github.com/BurntSushi/memchr +[[ file COPYING: shared text T12 ]] +[[ file LICENSE-MIT: shared text T13 ]] +[[ file UNLICENSE: shared text T14 ]] + +============================================================================== +crate: memoffset 0.9.1 +Licence: MIT +Source: https://github.com/Gilnaa/memoffset +[[ begin file LICENSE ]] +Copyright (c) 2017 Gilad Naaman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: mime 0.3.17 +Licence: MIT OR Apache-2.0 +Source: https://github.com/hyperium/mime +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2014 Sean McArthur + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: miniz_oxide 0.8.9 +Licence: MIT OR Zlib OR Apache-2.0 +Source: https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide +[[ file LICENSE: shared text T64 ]] +[[ file LICENSE-APACHE.md: shared text T6 ]] +[[ file LICENSE-MIT.md: shared text T65 ]] +[[ file LICENSE-ZLIB.md: shared text T66 ]] + +============================================================================== +crate: miniz_oxide 0.9.1 +Licence: MIT OR Zlib OR Apache-2.0 +Source: https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide +[[ file LICENSE: shared text T64 ]] +[[ file LICENSE-APACHE.md: shared text T6 ]] +[[ file LICENSE-MIT.md: shared text T65 ]] +[[ file LICENSE-ZLIB.md: shared text T66 ]] + +============================================================================== +crate: mio 1.2.3 +Licence: MIT +Source: https://github.com/tokio-rs/mio +[[ begin file LICENSE ]] +Copyright (c) 2014 Carl Lerche and other MIO contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: moxcms 0.8.1 +Licence: BSD-3-Clause OR Apache-2.0 +Source: https://github.com/awxkee/moxcms.git +[[ file LICENSE-APACHE.md: shared text T67 ]] +[[ file LICENSE.md: shared text T68 ]] + +============================================================================== +crate: muda 0.19.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/muda +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T69 ]] +[[ begin file LICENSE.spdx ]] +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: muda +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2020-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Menu Utilities for Desktop Applications. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2022-12-05T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/muda +PackageDownloadLocation: git+https://github.com/tauri-apps/muda.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/muda.git +Creator: Person: Daniel Thompson-Yvetot +[[ end file LICENSE.spdx ]] + +============================================================================== +crate: ndk 0.9.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-mobile/ndk +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: ndk-sys 0.6.0+11769913 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-mobile/ndk +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: new_debug_unreachable 1.0.6 +Licence: MIT +Source: https://github.com/mbrubeck/rust-debug-unreachable +[[ begin file LICENSE-MIT ]] +Copyright (c) 2015 Jonathan Reem + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: nix 0.29.0 +Licence: MIT +Source: https://github.com/nix-rust/nix +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2015 Carl Lerche + nix-rust Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: num 0.4.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-num/num +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: num-bigint 0.4.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-num/num-bigint +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: num-complex 0.4.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-num/num-complex +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: num-conv 0.2.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jhpratt/num-conv +[[ file LICENSE-Apache: shared text T6 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) Jacob Pratt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: num-integer 0.1.47 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-num/num-integer +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: num-iter 0.1.46 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-num/num-iter +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: num-rational 0.4.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-num/num-rational +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: num-traits 0.2.19 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-num/num-traits +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: num_enum 0.7.6 +Licence: BSD-3-Clause OR MIT OR Apache-2.0 +Source: https://github.com/illicitonion/num_enum +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-BSD: shared text T70 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: num_enum_derive 0.7.6 +Licence: BSD-3-Clause OR MIT OR Apache-2.0 +Source: https://github.com/illicitonion/num_enum +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-BSD: shared text T70 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: objc2 0.6.4 +Licence: MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-app-kit 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-cloud-kit 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-core-data 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-core-foundation 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-core-graphics 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-core-image 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-core-location 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-core-text 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-core-video 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-encode 4.1.0 +Licence: MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-exception-helper 0.1.1 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-foundation 0.3.2 +Licence: MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-io-surface 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-local-authentication 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-quartz-core 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-security 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-ui-kit 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-user-notifications 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: objc2-web-kit 0.3.2 +Licence: Zlib OR Apache-2.0 OR MIT +Source: https://github.com/madsmtm/objc2 +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: once_cell 1.21.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/matklad/once_cell +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: option-ext 0.2.0 +Licence: MPL-2.0 +Source: https://github.com/soc/option-ext.git +[[ begin file LICENSE.txt ]] +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +[[ end file LICENSE.txt ]] + +============================================================================== +crate: ordered-stream 0.2.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/danieldg/ordered-stream +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: pango 0.18.3 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file COPYRIGHT: shared text T20 ]] +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: pango-sys 0.18.0 +Licence: MIT +Source: https://github.com/gtk-rs/gtk-rs-core +[[ file LICENSE: shared text T21 ]] + +============================================================================== +crate: parking 2.2.1 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/parking +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] +[[ begin file LICENSE-THIRD-PARTY ]] +=============================================================================== + +Copyright 2014-2020 The Rust Project Developers + +Licensed under the Apache License, Version 2.0 or the MIT license +, at your +option. All files in the project carrying such notice may not be +copied, modified, or distributed except according to those terms. +[[ end file LICENSE-THIRD-PARTY ]] + +============================================================================== +crate: parking_lot 0.12.5 +Licence: MIT OR Apache-2.0 +Source: https://github.com/Amanieu/parking_lot +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T63 ]] + +============================================================================== +crate: parking_lot_core 0.9.12 +Licence: MIT OR Apache-2.0 +Source: https://github.com/Amanieu/parking_lot +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T63 ]] + +============================================================================== +crate: percent-encoding 2.3.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/rust-url/ +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T56 ]] + +============================================================================== +crate: phf 0.13.1 +Licence: MIT +Source: https://github.com/rust-phf/rust-phf +[[ file LICENSE: shared text T71 ]] + +============================================================================== +crate: phf_codegen 0.13.1 +Licence: MIT +Source: https://github.com/rust-phf/rust-phf +[[ file LICENSE: shared text T71 ]] + +============================================================================== +crate: phf_generator 0.13.1 +Licence: MIT +Source: https://github.com/rust-phf/rust-phf +[[ file LICENSE: shared text T71 ]] + +============================================================================== +crate: phf_macros 0.13.1 +Licence: MIT +Source: https://github.com/rust-phf/rust-phf +[[ file LICENSE: shared text T71 ]] + +============================================================================== +crate: phf_shared 0.13.1 +Licence: MIT +Source: https://github.com/rust-phf/rust-phf +[[ file LICENSE: shared text T71 ]] + +============================================================================== +crate: pin-project-lite 0.2.17 +Licence: Apache-2.0 OR MIT +Source: https://github.com/taiki-e/pin-project-lite +[[ file LICENSE-APACHE: shared text T6 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: piper 0.2.5 +Licence: MIT OR Apache-2.0 +Source: https://github.com/smol-rs/piper +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: pkg-config 0.3.34 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/pkg-config-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: plist 1.10.1 +Licence: MIT +Source: https://github.com/ebarnard/rust-plist/ +[[ begin file LICENCE ]] +Copyright (c) 2015 Edward Barnard + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENCE ]] + +============================================================================== +crate: png 0.17.16 +Licence: MIT OR Apache-2.0 +Source: https://github.com/image-rs/image-png +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T72 ]] + +============================================================================== +crate: png 0.18.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/image-rs/image-png +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T72 ]] + +============================================================================== +crate: polling 3.11.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/smol-rs/polling +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: potential_utf 0.1.6 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: powerfmt 0.2.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jhpratt/powerfmt +[[ begin file LICENSE-Apache ]] + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Jacob Pratt et al. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end file LICENSE-Apache ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2023 Jacob Pratt et al. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: ppv-lite86 0.2.21 +Licence: MIT OR Apache-2.0 +Source: https://github.com/cryptocorrosion/cryptocorrosion +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2019 The CryptoCorrosion Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2019 The CryptoCorrosion Contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: precomputed-hash 0.1.1 +Licence: MIT +Source: https://github.com/emilio/precomputed-hash +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2017 Emilio Cobos Álvarez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: proc-macro-crate 1.3.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/bkchr/proc-macro-crate +[[ file LICENSE-APACHE: shared text T9 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: proc-macro-crate 2.0.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/bkchr/proc-macro-crate +[[ file LICENSE-APACHE: shared text T9 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: proc-macro-crate 3.5.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/bkchr/proc-macro-crate +[[ file LICENSE-APACHE: shared text T9 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: proc-macro-error 1.0.4 +Licence: MIT OR Apache-2.0 +Source: https://gitlab.com/CreepySkeleton/proc-macro-error +[[ file LICENSE-APACHE: shared text T73 ]] +[[ file LICENSE-MIT: shared text T74 ]] + +============================================================================== +crate: proc-macro-error-attr 1.0.4 +Licence: MIT OR Apache-2.0 +Source: https://gitlab.com/CreepySkeleton/proc-macro-error +[[ file LICENSE-APACHE: shared text T73 ]] +[[ file LICENSE-MIT: shared text T74 ]] + +============================================================================== +crate: proc-macro2 1.0.107 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/proc-macro2 +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: pxfm 0.1.30 +Licence: BSD-3-Clause OR Apache-2.0 +Source: https://github.com/awxkee/pxfm +[[ file LICENSE-APACHE.md: shared text T67 ]] +[[ file LICENSE.md: shared text T68 ]] + +============================================================================== +crate: quick-xml 0.42.0 +Licence: MIT +Source: https://github.com/tafia/quick-xml +[[ begin file LICENSE-MIT.md ]] +The MIT License (MIT) + +Copyright (c) 2016 Johann Tuffe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE-MIT.md ]] + +============================================================================== +crate: quote 1.0.47 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/quote +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: r-efi 5.3.0 +Licence: MIT OR Apache-2.0 OR LGPL-2.1-or-later +Source: https://github.com/r-efi/r-efi +[[ begin file AUTHORS ]] +LICENSE: + This project is triple-licensed under the MIT License, the Apache + License, Version 2.0, and the GNU Lesser General Public License, + Version 2.1+. + +AUTHORS-MIT: + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +AUTHORS-ASL: + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +AUTHORS-LGPL: + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; If not, see . + +COPYRIGHT: (ordered alphabetically) + Copyright (C) 2017-2023 Red Hat, Inc. + Copyright (C) 2019-2023 Microsoft Corporation + Copyright (C) 2022-2023 David Rheinsberg + +AUTHORS: (ordered alphabetically) + Alex James + Ayush Singh + Boris-Chengbiao Zhou + Bret Barkelew + Christopher Zurcher + David Rheinsberg + Dmitry Mostovenko + Hiroki Tokunaga + Joe Richey + John Schock + Michael Kubacki + Oliver Smith-Denny + Richard Wiedenhöft + Rob Bradford , + Tom Gundersen + Trevor Gross +[[ end file AUTHORS ]] + +============================================================================== +crate: r-efi 6.0.0 +Licence: MIT OR Apache-2.0 OR LGPL-2.1-or-later +Source: https://github.com/r-efi/r-efi +[[ begin file AUTHORS ]] +LICENSE: + This project is triple-licensed under the MIT License, the Apache + License, Version 2.0, and the GNU Lesser General Public License, + Version 2.1+. + +AUTHORS-MIT: + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +AUTHORS-ASL: + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +AUTHORS-LGPL: + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; If not, see . + +COPYRIGHT: (ordered alphabetically) + Copyright (C) 2017-2023 Red Hat, Inc. + Copyright (C) 2019-2023 Microsoft Corporation + Copyright (C) 2022-2023 David Rheinsberg + +AUTHORS: (ordered alphabetically) + Alan Egerton + Alex James + Ayush Singh + Boris-Chengbiao Zhou + Bret Barkelew + Christopher Zurcher + David Rheinsberg + Dmitry Mostovenko + Hiroki Tokunaga + Joe Richey + John Schock + Michael Kubacki + Oliver Smith-Denny + Richard Wiedenhöft + Rob Bradford , + Tom Gundersen + Trevor Gross +[[ end file AUTHORS ]] + +============================================================================== +crate: rand 0.8.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-random/rand +[[ file COPYRIGHT: shared text T75 ]] +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS +[[ end file LICENSE-APACHE ]] +[[ file LICENSE-MIT: shared text T76 ]] + +============================================================================== +crate: rand_chacha 0.3.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-random/rand +[[ file COPYRIGHT: shared text T75 ]] +[[ file LICENSE-APACHE: shared text T48 ]] +[[ file LICENSE-MIT: shared text T76 ]] + +============================================================================== +crate: rand_core 0.6.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-random/rand +[[ file COPYRIGHT: shared text T75 ]] +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. +[[ end file LICENSE-APACHE ]] +[[ file LICENSE-MIT: shared text T76 ]] + +============================================================================== +crate: raw-window-handle 0.6.2 +Licence: MIT OR Apache-2.0 OR Zlib +Source: https://github.com/rust-windowing/raw-window-handle +[[ file LICENSE-APACHE.md: shared text T6 ]] +[[ begin file LICENSE-MIT.md ]] +MIT License + +Copyright (c) 2019 Osspial + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT.md ]] +[[ begin file LICENSE-ZLIB.md ]] +Copyright (c) 2020 Osspial + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. +[[ end file LICENSE-ZLIB.md ]] + +============================================================================== +crate: redox_syscall 0.5.18 +Licence: MIT +Source: https://gitlab.redox-os.org/redox-os/syscall +[[ begin file LICENSE ]] +Copyright (c) 2017 Redox OS Developers + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: redox_users 0.5.3 +Licence: MIT +Source: https://gitlab.redox-os.org/redox-os/users +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2017 Jose Narvaez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: ref-cast 1.0.27 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/ref-cast +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: ref-cast-impl 1.0.27 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/ref-cast +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: regex 1.13.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/regex +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: regex-automata 0.4.18 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/regex +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: regex-syntax 0.8.11 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/regex +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T26 ]] + +============================================================================== +crate: reqwest 0.13.5 +Licence: MIT OR Apache-2.0 +Source: https://github.com/seanmonstar/reqwest +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2016 Sean McArthur + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2016-2026 Sean McArthur + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: rfd 0.16.0 +Licence: MIT +Source: https://github.com/PolyMeilex/rfd +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2022 Bartłomiej Maryńczak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: ring 0.17.14 +Licence: Apache-2.0 AND ISC +Source: https://github.com/briansmith/ring +[[ begin file LICENSE ]] +*ring* uses an "ISC" license, like BoringSSL used to use, for new code +files. See LICENSE-other-bits for the text of that license. + +See LICENSE-BoringSSL for code that was sourced from BoringSSL under the +Apache 2.0 license. Some code that was sourced from BoringSSL under the ISC +license. In each case, the license info is at the top of the file. + +See src/polyfill/once_cell/LICENSE-APACHE and src/polyfill/once_cell/LICENSE-MIT +for the license to code that was sourced from the once_cell project. +[[ end file LICENSE ]] +[[ begin file LICENSE-BoringSSL ]] + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +Licenses for support code +------------------------- + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +BoringSSL uses the Chromium test infrastructure to run a continuous build, +trybots etc. The scripts which manage this, and the script for generating build +metadata, are under the Chromium license. Distributing code linked against +BoringSSL does not trigger this license. + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file LICENSE-BoringSSL ]] +[[ begin file LICENSE-other-bits ]] +Copyright 2015-2025 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +[[ end file LICENSE-other-bits ]] + +============================================================================== +crate: rustc-hash 2.1.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/rust-lang/rustc-hash +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS +[[ end file LICENSE-APACHE ]] +[[ file LICENSE-MIT: shared text T19 ]] + +============================================================================== +crate: rustc_version 0.4.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/djc/rustc-version-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T63 ]] + +============================================================================== +crate: rustix 1.1.5 +Licence: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +Source: https://github.com/bytecodealliance/rustix +[[ begin file COPYRIGHT ]] +Short version for non-lawyers: + +`rustix` is triple-licensed under Apache 2.0 with the LLVM Exception, +Apache 2.0, and MIT terms. + + +Longer version: + +Copyrights in the `rustix` project are retained by their contributors. +No copyright assignment is required to contribute to the `rustix` +project. + +Some files include code derived from Rust's `libstd`; see the comments in +the code for details. + +Except as otherwise noted (below and/or in individual files), `rustix` +is licensed under: + + - the Apache License, Version 2.0, with the LLVM Exception + or + + - the Apache License, Version 2.0 + or + , + - or the MIT license + or + , + +at your option. +[[ end file COPYRIGHT ]] +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-Apache-2.0_WITH_LLVM-exception: shared text T62 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: rustls 0.23.45 +Licence: Apache-2.0 OR ISC OR MIT +Source: https://github.com/rustls/rustls +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-ISC ]] +ISC License (ISC) +Copyright (c) 2016, Joseph Birr-Pixton + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +[[ end file LICENSE-ISC ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2016 Joseph Birr-Pixton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: rustls-pki-types 1.15.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rustls/pki-types +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2023 Dirkjan Ochtman + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2023 Dirkjan Ochtman + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: rustls-webpki 0.103.15 +Licence: ISC +Source: https://github.com/rustls/webpki +[[ begin file LICENSE ]] +Except as otherwise noted, this project is licensed under the following +(ISC-style) terms: + +Copyright 2015 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The files under third-party/chromium are licensed as described in +third-party/chromium/LICENSE. +[[ end file LICENSE ]] + +============================================================================== +crate: rustversion 1.0.23 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/rustversion +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: same-file 1.0.6 +Licence: Unlicense/MIT +Source: https://github.com/BurntSushi/same-file +[[ file COPYING: shared text T12 ]] +[[ file LICENSE-MIT: shared text T77 ]] +[[ file UNLICENSE: shared text T14 ]] + +============================================================================== +crate: schemars 0.8.22 +Licence: MIT +Source: https://github.com/GREsau/schemars +[[ file LICENSE: shared text T78 ]] + +============================================================================== +crate: schemars 0.9.0 +Licence: MIT +Source: https://github.com/GREsau/schemars +[[ file LICENSE: shared text T78 ]] + +============================================================================== +crate: schemars 1.2.2 +Licence: MIT +Source: https://github.com/GREsau/schemars +[[ file LICENSE: shared text T78 ]] + +============================================================================== +crate: schemars_derive 0.8.22 +Licence: MIT +Source: https://github.com/GREsau/schemars +[[ file LICENSE: shared text T78 ]] + +============================================================================== +crate: scopeguard 1.2.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/bluss/scopeguard +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2016-2019 Ulrik Sverdrup "bluss" and scopeguard developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: secret-service 4.0.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/hwchen/secret-service-rs.git +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T38 ]] + +============================================================================== +crate: security-framework 3.7.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/kornelski/rust-security-framework +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T79 ]] + +============================================================================== +crate: security-framework-sys 2.17.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/kornelski/rust-security-framework +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T79 ]] + +============================================================================== +crate: selectors 0.36.1 +Licence: MPL-2.0 +Source: https://github.com/servo/stylo +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: semver 1.0.28 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/semver +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde 1.0.229 +Licence: MIT OR Apache-2.0 +Source: https://github.com/serde-rs/serde +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde-untagged 0.1.9 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/serde-untagged +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde_core 1.0.229 +Licence: MIT OR Apache-2.0 +Source: https://github.com/serde-rs/serde +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde_derive 1.0.229 +Licence: MIT OR Apache-2.0 +Source: https://github.com/serde-rs/serde +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde_derive_internals 0.29.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/serde-rs/serde +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde_json 1.0.151 +Licence: MIT OR Apache-2.0 +Source: https://github.com/serde-rs/json +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde_repr 0.1.21 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/serde-repr +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: serde_spanned 0.6.9 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: serde_spanned 1.1.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: serde_with 3.14.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jonasbb/serde_with/ +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T81 ]] + +============================================================================== +crate: serde_with_macros 3.14.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/jonasbb/serde_with/ +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T81 ]] + +============================================================================== +crate: serialize-to-javascript 0.1.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/chippers/serialize-to-javascript +[[ file LICENSE-APACHE: shared text T82 ]] +[[ file LICENSE-MIT: shared text T83 ]] + +============================================================================== +crate: serialize-to-javascript-impl 0.1.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/chippers/serialize-to-javascript +[[ file LICENSE-APACHE: shared text T82 ]] +[[ file LICENSE-MIT: shared text T83 ]] + +============================================================================== +crate: servo_arc 0.4.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/stylo +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: sha1 0.10.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/hashes +[[ file LICENSE-APACHE: shared text T11 ]] +[[ file LICENSE-MIT: shared text T84 ]] + +============================================================================== +crate: sha2 0.10.9 +Licence: MIT OR Apache-2.0 +Source: https://github.com/RustCrypto/hashes +[[ file LICENSE-APACHE: shared text T11 ]] +[[ file LICENSE-MIT: shared text T84 ]] + +============================================================================== +crate: shlex 2.0.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/comex/rust-shlex +[[ begin file LICENSE-APACHE ]] +Copyright 2015 Nicholas Allegra (comex). + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +The MIT License (MIT) + +Copyright (c) 2015 Nicholas Allegra (comex). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: signal-hook-registry 1.4.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/vorner/signal-hook +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017 tokio-jsonrpc developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: simd-adler32 0.3.10 +Licence: MIT +Source: https://github.com/mcountryman/simd-adler32 +[[ begin file LICENSE.md ]] +MIT License + +Copyright (c) [2021] [Marvin Countryman] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE.md ]] + +============================================================================== +crate: siphasher 1.0.3 +Licence: MIT/Apache-2.0 +Source: https://github.com/jedisct1/rust-siphash +[[ begin file COPYING ]] +Copyright 2012-2016 The Rust Project Developers. +Copyright 2016-2026 Frank Denis. + +Licensed under the Apache License, Version 2.0 or the MIT license +, at your +option. +[[ end file COPYING ]] + +============================================================================== +crate: slab 0.4.12 +Licence: MIT +Source: https://github.com/tokio-rs/slab +[[ begin file LICENSE ]] +Copyright (c) 2019 Carl Lerche + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: smallvec 1.16.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/rust-smallvec +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018 The Servo Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: socket2 0.6.5 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-lang/socket2 +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: softbuffer 0.4.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/rust-windowing/softbuffer +[[ begin file LICENSE-APACHE ]] +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2022 Kirill Chibisov + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright 2022 Kirill Chibisov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: soup3 0.5.0 +Licence: MIT +Source: https://gitlab.gnome.org/World/Rust/soup3-rs +[[ file LICENSE: shared text T58 ]] + +============================================================================== +crate: soup3-sys 0.5.0 +Licence: MIT +Source: https://gitlab.gnome.org/World/Rust/soup3-rs +[[ file LICENSE: shared text T58 ]] + +============================================================================== +crate: stable_deref_trait 1.2.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/storyyeller/stable_deref_trait +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2017 Robert Grosse + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: static_assertions 1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/nvzqz/static-assertions-rs +[[ file LICENSE-APACHE: shared text T8 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2017 Nikolai Vazquez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: string_cache 0.9.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/string-cache +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T29 ]] + +============================================================================== +crate: string_cache_codegen 0.6.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/string-cache +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T29 ]] + +============================================================================== +crate: strsim 0.11.1 +Licence: MIT +Source: https://github.com/rapidfuzz/strsim-rs +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2015 Danny Guo +Copyright (c) 2016 Titus Wormer +Copyright (c) 2018 Akash Kurdekar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: subtle 2.6.1 +Licence: BSD-3-Clause +Source: https://github.com/dalek-cryptography/subtle +[[ begin file LICENSE ]] +Copyright (c) 2016-2017 Isis Agora Lovecruft, Henry de Valence. All rights reserved. +Copyright (c) 2016-2024 Isis Agora Lovecruft. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end file LICENSE ]] + +============================================================================== +crate: swift-rs 1.0.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/Brendonovich/swift-rs +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 The swift-rs developers + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2023 The swift-rs Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: syn 1.0.109 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/syn +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: syn 2.0.119 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/syn +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: syn 3.0.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/syn +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: sync_wrapper 1.0.2 +Licence: Apache-2.0 +Source: https://github.com/Actyx/sync_wrapper +[[ file LICENSE: shared text T6 ]] + +============================================================================== +crate: synstructure 0.13.2 +Licence: MIT +Source: https://github.com/mystor/synstructure +[[ begin file LICENSE ]] +Copyright 2016 Nika Layzell + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: system-deps 6.2.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/gdesmott/system-deps +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: tao 0.35.3 +Licence: Apache-2.0 +Source: https://github.com/tauri-apps/tao +[[ file LICENSE: shared text T43 ]] +[[ begin file LICENSE.spdx ]] +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tao +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageCopyrightText: 2021-2023, The Tauri Programme in the Commons Conservancy +PackageSummary: Tao is the official, rust-based window manager for Wry. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2020-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tao +PackageDownloadLocation: git+https://github.com/tauri-apps/tao.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tao.git +Creator: Person: Daniel Thompson-Yvetot +[[ end file LICENSE.spdx ]] + +============================================================================== +crate: tao-macros 0.1.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/tauri-apps/tao +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2022 - Present Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] +[[ begin file LICENSE.spdx ]] +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tao-macros +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2020-2023, The Tauri Programme in the Commons Conservancy +PackageSummary: tao-macros is part of Tao, the official, rust-based window manager for Wry. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2020-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tao +PackageDownloadLocation: git+https://github.com/tauri-apps/tao.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tao.git +Creator: Person: Daniel Thompson-Yvetot +[[ end file LICENSE.spdx ]] + +============================================================================== +crate: target-lexicon 0.12.16 +Licence: Apache-2.0 WITH LLVM-exception +Source: https://github.com/bytecodealliance/target-lexicon +[[ file LICENSE: shared text T62 ]] + +============================================================================== +crate: tauri 2.11.5 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +[[ file LICENSE_APACHE-2.0: shared text T6 ]] +[[ file LICENSE_MIT: shared text T85 ]] + +============================================================================== +crate: tauri-build 2.6.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +[[ file LICENSE_APACHE-2.0: shared text T6 ]] +[[ file LICENSE_MIT: shared text T85 ]] + +============================================================================== +crate: tauri-codegen 2.6.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +[[ file LICENSE_APACHE-2.0: shared text T6 ]] +[[ file LICENSE_MIT: shared text T85 ]] + +============================================================================== +crate: tauri-macros 2.6.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +[[ file LICENSE_APACHE-2.0: shared text T6 ]] +[[ file LICENSE_MIT: shared text T85 ]] + +============================================================================== +crate: tauri-plugin 2.6.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: tauri-plugin-dialog 2.7.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/plugins-workspace +[[ file LICENSE.spdx: shared text T86 ]] +[[ file LICENSE_APACHE-2.0: shared text T87 ]] +[[ file LICENSE_MIT: shared text T88 ]] + +============================================================================== +crate: tauri-plugin-fs 2.5.2 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/plugins-workspace +[[ file LICENSE.spdx: shared text T86 ]] +[[ file LICENSE_APACHE-2.0: shared text T87 ]] +[[ file LICENSE_MIT: shared text T88 ]] + +============================================================================== +crate: tauri-runtime 2.11.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +[[ file LICENSE_APACHE-2.0: shared text T6 ]] +[[ file LICENSE_MIT: shared text T85 ]] + +============================================================================== +crate: tauri-runtime-wry 2.11.4 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +[[ file LICENSE_APACHE-2.0: shared text T6 ]] +[[ file LICENSE_MIT: shared text T85 ]] + +============================================================================== +crate: tauri-utils 2.9.3 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri +[[ file LICENSE_APACHE-2.0: shared text T6 ]] +[[ file LICENSE_MIT: shared text T85 ]] + +============================================================================== +crate: tauri-winres 0.3.6 +Licence: MIT +Source: https://github.com/tauri-apps/winres +[[ begin file LICENSE ]] +The MIT License (MIT) + +Copyright (c) 2023 - Present Tauri Apps Contributors +Copyright (c) 2016 Max Resch + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: tempfile 3.27.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/Stebalien/tempfile +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2015 Steven Allen + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: tendril 0.5.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/html5ever +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2015 Keegan McAllister + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: thiserror 1.0.69 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/thiserror +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: thiserror 2.0.20 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/thiserror +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: thiserror-impl 1.0.69 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/thiserror +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: thiserror-impl 2.0.20 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/thiserror +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: time 0.3.55 +Licence: MIT OR Apache-2.0 +Source: https://github.com/time-rs/time +[[ file LICENSE-Apache: shared text T6 ]] +[[ file LICENSE-MIT: shared text T89 ]] + +============================================================================== +crate: time-core 0.1.9 +Licence: MIT OR Apache-2.0 +Source: https://github.com/time-rs/time +[[ file LICENSE-Apache: shared text T6 ]] +[[ file LICENSE-MIT: shared text T89 ]] + +============================================================================== +crate: time-macros 0.2.32 +Licence: MIT OR Apache-2.0 +Source: https://github.com/time-rs/time +[[ file LICENSE-Apache: shared text T6 ]] +[[ file LICENSE-MIT: shared text T89 ]] + +============================================================================== +crate: tinystr 0.8.4 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: tokio 1.53.1 +Licence: MIT +Source: https://github.com/tokio-rs/tokio +[[ file LICENSE: shared text T90 ]] + +============================================================================== +crate: tokio-util 0.7.19 +Licence: MIT +Source: https://github.com/tokio-rs/tokio +[[ file LICENSE: shared text T90 ]] + +============================================================================== +crate: toml 0.8.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml 0.9.12+spec-1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml 1.1.6+spec-1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml_datetime 0.6.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: toml_datetime 0.7.5+spec-1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml_datetime 1.1.1+spec-1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml_edit 0.19.15 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml_edit 0.20.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml_edit 0.25.15+spec-1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml_parser 1.1.3+spec-1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: toml_writer 1.1.2+spec-1.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/toml-rs/toml +[[ file LICENSE-APACHE: shared text T30 ]] +[[ file LICENSE-MIT: shared text T80 ]] + +============================================================================== +crate: tower 0.5.3 +Licence: MIT +Source: https://github.com/tower-rs/tower +[[ file LICENSE: shared text T91 ]] + +============================================================================== +crate: tower-http 0.6.11 +Licence: MIT +Source: https://github.com/tower-rs/tower-http +[[ begin file LICENSE ]] +Copyright (c) 2019-2021 Tower Contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: tower-layer 0.3.3 +Licence: MIT +Source: https://github.com/tower-rs/tower +[[ file LICENSE: shared text T91 ]] + +============================================================================== +crate: tower-service 0.3.3 +Licence: MIT +Source: https://github.com/tower-rs/tower +[[ file LICENSE: shared text T91 ]] + +============================================================================== +crate: tracing 0.1.44 +Licence: MIT +Source: https://github.com/tokio-rs/tracing +[[ file LICENSE: shared text T92 ]] + +============================================================================== +crate: tracing-attributes 0.1.31 +Licence: MIT +Source: https://github.com/tokio-rs/tracing +[[ file LICENSE: shared text T92 ]] + +============================================================================== +crate: tracing-core 0.1.36 +Licence: MIT +Source: https://github.com/tokio-rs/tracing +[[ file LICENSE: shared text T92 ]] + +============================================================================== +crate: tray-icon 0.24.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/tauri-apps/tray-icon +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T69 ]] +[[ begin file LICENSE.spdx ]] +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tray-icon +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2020-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Create tray icons for desktop applications. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2022-12-05T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tray-icon +PackageDownloadLocation: git+https://github.com/tauri-apps/tray-icon.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tray-icon.git +Creator: Person: Daniel Thompson-Yvetot +[[ end file LICENSE.spdx ]] + +============================================================================== +crate: try-lock 0.2.5 +Licence: MIT +Source: https://github.com/seanmonstar/try-lock +[[ begin file LICENSE ]] +Copyright (c) 2018-2023 Sean McArthur +Copyright (c) 2016 Alex Crichton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: typeid 1.0.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/dtolnay/typeid +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: typenum 1.20.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/paholg/typenum +[[ begin file LICENSE ]] +MIT OR Apache-2.0 +[[ end file LICENSE ]] +[[ begin file LICENSE-APACHE ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2014 Paho Lurie-Gregg + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end file LICENSE-APACHE ]] +[[ begin file LICENSE-MIT ]] +The MIT License (MIT) + +Copyright (c) 2014 Paho Lurie-Gregg + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: uds_windows 1.2.1 +Licence: MIT +Source: https://github.com/haraldh/rust_uds_windows +[[ begin file LICENSE ]] + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE +[[ end file LICENSE ]] + +============================================================================== +crate: unic-char-property 0.9.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/open-i18n/rust-unic/ +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: unic-char-range 0.9.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/open-i18n/rust-unic/ +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: unic-common 0.9.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/open-i18n/rust-unic/ +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: unic-ucd-ident 0.9.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/open-i18n/rust-unic/ +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: unic-ucd-version 0.9.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/open-i18n/rust-unic/ +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: unicode-ident 1.0.26 +Licence: (MIT OR Apache-2.0) AND Unicode-3.0 +Source: https://github.com/dtolnay/unicode-ident +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] +[[ begin file LICENSE-UNICODE ]] +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2023 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. +[[ end file LICENSE-UNICODE ]] + +============================================================================== +crate: unicode-segmentation 1.13.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/unicode-rs/unicode-segmentation +[[ begin file COPYRIGHT ]] +Licensed under the Apache License, Version 2.0 + or the MIT +license , +at your option. All files in the project carrying such +notice may not be copied, modified, or distributed except +according to those terms. +[[ end file COPYRIGHT ]] +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T50 ]] + +============================================================================== +crate: untrusted 0.9.0 +Licence: ISC +Source: https://github.com/briansmith/untrusted +[[ begin file LICENSE.txt ]] +// Copyright 2015-2016 Brian Smith. +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +[[ end file LICENSE.txt ]] + +============================================================================== +crate: ureq 2.12.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/algesten/ureq +[[ file LICENSE-APACHE: shared text T82 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2019 Martin Algesten + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: url 2.5.8 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/rust-url +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T56 ]] + +============================================================================== +crate: urlpattern 0.3.0 +Licence: MIT +Source: https://github.com/denoland/rust-urlpattern +[[ begin file LICENSE ]] +MIT License + +Copyright (c) 2021 the Deno authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: utf8_iter 1.0.4 +Licence: Apache-2.0 OR MIT +Source: https://github.com/hsivonen/utf8_iter +[[ begin file COPYRIGHT ]] +Copyright Mozilla Foundation + +Licensed under the Apache License (Version 2.0), or the MIT license, +(the "Licenses") at your option. You may not use this file except in +compliance with one of the Licenses. You may obtain copies of the +Licenses at: + + https://www.apache.org/licenses/LICENSE-2.0 + https://opensource.org/licenses/MIT + +Unless required by applicable law or agreed to in writing, software +distributed under the Licenses is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the Licenses for the specific language governing permissions and +limitations under the Licenses. + +-- + +Test code is dedicated to the Public Domain when so designated (see +the individual files for PD/CC0-dedicated sections). + +-- + +The implementation for Utf8CharIndices was adapted from the +CharIndices implementation of the Rust standard library at revision +ab32548539ec38a939c1b58599249f3b54130026 +(https://github.com/rust-lang/rust/blob/ab32548539ec38a939c1b58599249f3b54130026/library/core/src/str/iter.rs). + +Excerpt from https://github.com/rust-lang/rust/blob/ab32548539ec38a939c1b58599249f3b54130026/COPYRIGHT , +which refers to +https://github.com/rust-lang/rust/blob/ab32548539ec38a939c1b58599249f3b54130026/LICENSE-APACHE +and +https://github.com/rust-lang/rust/blob/ab32548539ec38a939c1b58599249f3b54130026/LICENSE-MIT +: + +For full authorship information, see the version control history or +https://thanks.rust-lang.org + +Except as otherwise noted (below and/or in individual files), Rust is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. +[[ end file COPYRIGHT ]] +[[ file LICENSE-APACHE: shared text T8 ]] +[[ begin file LICENSE-MIT ]] +Copyright Mozilla Foundation + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: uuid 1.26.1 +Licence: Apache-2.0 OR MIT +Source: https://github.com/uuid-rs/uuid +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2014 The Rust Project Developers +Copyright (c) 2018 Ashley Mannix, Christopher Armstrong, Dylan DPC, Hunar Roop Kahlon + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: version-compare 0.2.1 +Licence: MIT +Source: https://gitlab.com/timvisee/version-compare +[[ begin file LICENSE ]] +Copyright (c) 2017 Tim Visée + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: version_check 0.9.5 +Licence: MIT/Apache-2.0 +Source: https://github.com/SergioBenitez/version_check +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +The MIT License (MIT) +Copyright (c) 2017-2018 Sergio Benitez + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: vswhom 0.1.0 +Licence: MIT +Source: https://github.com/nabijaczleweli/vswhom.rs +[[ file LICENSE: shared text T93 ]] + +============================================================================== +crate: vswhom-sys 0.1.3 +Licence: MIT +Source: https://github.com/nabijaczleweli/vswhom-sys.rs +[[ file LICENSE: shared text T93 ]] + +============================================================================== +crate: walkdir 2.5.0 +Licence: Unlicense/MIT +Source: https://github.com/BurntSushi/walkdir +[[ file COPYING: shared text T12 ]] +[[ file LICENSE-MIT: shared text T13 ]] +[[ file UNLICENSE: shared text T14 ]] + +============================================================================== +crate: want 0.3.1 +Licence: MIT +Source: https://github.com/seanmonstar/want +[[ begin file LICENSE ]] +Copyright (c) 2018-2019 Sean McArthur + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: wasi 0.11.1+wasi-snapshot-preview1 +Licence: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +Source: https://github.com/bytecodealliance/wasi +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-Apache-2.0_WITH_LLVM-exception: shared text T62 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: wasip2 1.0.4+wasi-0.2.12 +Licence: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +Source: https://github.com/bytecodealliance/wasi-rs +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-Apache-2.0_WITH_LLVM-exception: shared text T62 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: wasm-bindgen 0.2.128 +Licence: MIT OR Apache-2.0 +Source: https://github.com/wasm-bindgen/wasm-bindgen +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: wasm-bindgen-futures 0.4.78 +Licence: MIT OR Apache-2.0 +Source: https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/futures +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: wasm-bindgen-macro 0.2.128 +Licence: MIT OR Apache-2.0 +Source: https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: wasm-bindgen-macro-support 0.2.128 +Licence: MIT OR Apache-2.0 +Source: https://github.com/wasm-bindgen/wasm-bindgen/tree/main/crates/macro-support +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: wasm-bindgen-shared 0.2.128 +Licence: MIT OR Apache-2.0 +Source: https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: wasm-streams 0.5.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/MattiasBuelens/wasm-streams/ +[[ file LICENSE-APACHE: shared text T16 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: web-sys 0.3.105 +Licence: MIT OR Apache-2.0 +Source: https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/web-sys +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T28 ]] + +============================================================================== +crate: web_atoms 0.2.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/servo/html5ever +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-MIT: shared text T51 ]] + +============================================================================== +crate: webkit2gtk 2.0.2 +Licence: MIT +Source: https://github.com/tauri-apps/webkit2gtk-rs +[[ begin file LICENSE ]] +Copyright (c) 2016 Boucher, Antoni +Copyright (c) 2017-2021, The Gtk-rs Project Developers. +Copyright (c) 2021, Tauri Programme within The Commons Conservancy + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: webkit2gtk-sys 2.0.2 +Licence: MIT +Source: https://github.com/tauri-apps/webkit2gtk-rs +[[ begin file LICENSE ]] +Copyright (c) 2016 Boucher, Antoni + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: webpki-roots 0.26.11 +Licence: CDLA-Permissive-2.0 +Source: https://github.com/rustls/webpki-roots +[[ file LICENSE: shared text T94 ]] + +============================================================================== +crate: webpki-roots 1.0.9 +Licence: CDLA-Permissive-2.0 +Source: https://github.com/rustls/webpki-roots +[[ file LICENSE: shared text T94 ]] + +============================================================================== +crate: webview2-com 0.38.2 +Licence: MIT +Source: https://github.com/wravery/webview2-rs +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: webview2-com-macros 0.8.1 +Licence: MIT +Source: https://github.com/wravery/webview2-rs +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: webview2-com-sys 0.38.2 +Licence: MIT +Source: https://github.com/wravery/webview2-rs +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: winapi 0.3.9 +Licence: MIT/Apache-2.0 +Source: https://github.com/retep998/winapi-rs +[[ file LICENSE-APACHE: shared text T60 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2015-2018 The winapi-rs Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: winapi-i686-pc-windows-gnu 0.4.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/retep998/winapi-rs +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: winapi-util 0.1.11 +Licence: Unlicense OR MIT +Source: https://github.com/BurntSushi/winapi-util +[[ file COPYING: shared text T12 ]] +[[ file LICENSE-MIT: shared text T77 ]] +[[ file UNLICENSE: shared text T14 ]] + +============================================================================== +crate: winapi-x86_64-pc-windows-gnu 0.4.0 +Licence: MIT/Apache-2.0 +Source: https://github.com/retep998/winapi-rs +Note: The published crate carries no licence file; its SPDX licence and repository are given above. + +============================================================================== +crate: window-vibrancy 0.6.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/tauri-plugin-vibrancy +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2020-2022 Tauri Programme within The Commons Conservancy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] +[[ begin file LICENSE.spdx ]] +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: window-vibrancy +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2020-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Make your windows vibrant. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2020-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/window-vibrancy +PackageDownloadLocation: git+https://github.com/tauri-apps/window-vibrancy.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/window-vibrancy.git +Creator: Person: Daniel Thompson-Yvetot +[[ end file LICENSE.spdx ]] + +============================================================================== +crate: windows 0.61.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-collections 0.2.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-core 0.61.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-future 0.2.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-implement 0.60.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-interface 0.59.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-link 0.1.3 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-link 0.2.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-numerics 0.2.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-result 0.3.4 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-strings 0.4.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-sys 0.45.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-sys 0.52.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-sys 0.59.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-sys 0.60.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-sys 0.61.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-targets 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-targets 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-targets 0.53.5 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-threading 0.1.0 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows-version 0.1.7 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_aarch64_gnullvm 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_aarch64_gnullvm 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_aarch64_gnullvm 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_aarch64_msvc 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_aarch64_msvc 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_aarch64_msvc 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_gnu 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_gnu 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_gnu 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_gnullvm 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_gnullvm 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_msvc 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_msvc 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_i686_msvc 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_gnu 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_gnu 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_gnu 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_gnullvm 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_gnullvm 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_gnullvm 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_msvc 0.42.2 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_msvc 0.52.6 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: windows_x86_64_msvc 0.53.1 +Licence: MIT OR Apache-2.0 +Source: https://github.com/microsoft/windows-rs +[[ file license-apache-2.0: shared text T95 ]] +[[ file license-mit: shared text T96 ]] + +============================================================================== +crate: winnow 0.5.40 +Licence: MIT +Source: https://github.com/winnow-rs/winnow +[[ file LICENSE-MIT: shared text T97 ]] + +============================================================================== +crate: winnow 0.7.15 +Licence: MIT +Source: https://github.com/winnow-rs/winnow +[[ file LICENSE-MIT: shared text T97 ]] + +============================================================================== +crate: winnow 1.0.4 +Licence: MIT +Source: https://github.com/winnow-rs/winnow +[[ file LICENSE-MIT: shared text T97 ]] + +============================================================================== +crate: winreg 0.55.0 +Licence: MIT +Source: https://github.com/gentoo90/winreg-rs +[[ begin file LICENSE ]] +Copyright (c) 2015 Igor Shaula + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end file LICENSE ]] + +============================================================================== +crate: wit-bindgen 0.57.1 +Licence: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +Source: https://github.com/bytecodealliance/wit-bindgen +[[ file LICENSE-APACHE: shared text T17 ]] +[[ file LICENSE-Apache-2.0_WITH_LLVM-exception: shared text T62 ]] +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: writeable 0.6.4 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: wry 0.55.1 +Licence: Apache-2.0 OR MIT +Source: https://github.com/tauri-apps/wry +[[ file LICENSE-APACHE: shared text T17 ]] +[[ begin file LICENSE-MIT ]] +MIT License + +Copyright (c) 2020-2023 Ngo Iok Ui & Tauri Programme within The Commons Conservancy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end file LICENSE-MIT ]] +[[ begin file LICENSE.spdx ]] +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: wry +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2020-2023, The Tauri Programme in the Commons Conservancy +PackageSummary: Wry is the official, rust-based webview +windowing service for Tauri. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2020-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/wry +PackageDownloadLocation: git+https://github.com/tauri-apps/wry.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/wry.git +Creator: Person: Daniel Thompson-Yvetot +[[ end file LICENSE.spdx ]] + +============================================================================== +crate: x11 2.21.0 +Licence: MIT +Source: https://github.com/AltF02/x11-rs.git +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: x11-dl 2.21.0 +Licence: MIT +Source: https://github.com/AltF02/x11-rs.git +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: xdg-home 1.3.0 +Licence: MIT +Source: https://github.com/zeenix/xdg-home +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: yoke 0.8.3 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: yoke-derive 0.8.2 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: zbus 4.4.0 +Licence: MIT +Source: https://github.com/dbus2/zbus/ +[[ file LICENSE: shared text T98 ]] + +============================================================================== +crate: zbus_macros 4.4.0 +Licence: MIT +Source: https://github.com/dbus2/zbus/ +[[ file LICENSE: shared text T98 ]] + +============================================================================== +crate: zbus_names 3.0.0 +Licence: MIT +Source: https://github.com/dbus2/zbus/ +[[ file LICENSE: shared text T10 ]] + +============================================================================== +crate: zerocopy 0.8.63 +Licence: BSD-2-Clause OR Apache-2.0 OR MIT +Source: https://github.com/google/zerocopy +[[ file LICENSE-APACHE: shared text T99 ]] +[[ file LICENSE-BSD: shared text T100 ]] +[[ file LICENSE-MIT: shared text T101 ]] + +============================================================================== +crate: zerocopy-derive 0.8.63 +Licence: BSD-2-Clause OR Apache-2.0 OR MIT +Source: https://github.com/google/zerocopy +[[ file LICENSE-APACHE: shared text T99 ]] +[[ file LICENSE-BSD: shared text T100 ]] +[[ file LICENSE-MIT: shared text T101 ]] + +============================================================================== +crate: zerofrom 0.1.8 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: zerofrom-derive 0.1.7 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: zeroize 1.9.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/RustCrypto/utils +[[ file LICENSE-APACHE: shared text T8 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2018-2026 The RustCrypto Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: zeroize_derive 1.5.0 +Licence: Apache-2.0 OR MIT +Source: https://github.com/RustCrypto/utils +[[ file LICENSE-APACHE: shared text T8 ]] +[[ begin file LICENSE-MIT ]] +Copyright (c) 2019-2026 The RustCrypto Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end file LICENSE-MIT ]] + +============================================================================== +crate: zerotrie 0.2.5 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: zerovec 0.11.8 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: zerovec-derive 0.11.6 +Licence: Unicode-3.0 +Source: https://github.com/unicode-org/icu4x +[[ file LICENSE: shared text T55 ]] + +============================================================================== +crate: zlib-rs 0.6.8 +Licence: Zlib +Source: https://github.com/trifectatechfoundation/zlib-rs +[[ begin file LICENSE ]] +(C) 2024 Trifecta Tech Foundation + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. +[[ end file LICENSE ]] + +============================================================================== +crate: zmij 1.0.23 +Licence: MIT +Source: https://github.com/dtolnay/zmij +[[ file LICENSE-MIT: shared text T10 ]] + +============================================================================== +crate: zvariant 4.2.0 +Licence: MIT +Source: https://github.com/dbus2/zbus/ +[[ file LICENSE: shared text T98 ]] + +============================================================================== +crate: zvariant_derive 4.2.0 +Licence: MIT +Source: https://github.com/dbus2/zbus/ +[[ file LICENSE: shared text T98 ]] + +============================================================================== +crate: zvariant_utils 2.1.0 +Licence: MIT +Source: https://github.com/dbus2/zbus/ +[[ file LICENSE: shared text T10 ]] + +============================================================================== +binary: ffmpeg 7.1.5-2 +Licence: LGPL-2.1-or-later +Source: https://github.com/nodemode-dev/formai-binaries/releases/tag/ffmpeg-7.1.5-2 +Note: Not bundled. When no ffmpeg is on PATH the engine downloads this LGPL build (--disable-gpl --disable-nonfree; libopus and libvpx BSD-3-Clause) from https://github.com/nodemode-dev/formai-binaries/releases/tag/ffmpeg-7.1.5-2. That release carries its own THIRD-PARTY-NOTICES.txt, the LGPL-2.1 licence text and the source code; the LGPL-2.1 text is also at https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt. An ffmpeg already on PATH is used instead and keeps its own licence. + +============================================================================== +Shared licence texts + +[[ begin shared text T1 ]] +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +[[ end shared text T1 ]] + +[[ begin shared text T2 ]] +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end shared text T2 ]] + +[[ begin shared text T3 ]] + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T3 ]] + +[[ begin shared text T4 ]] +OpenCV library is redistributed within opencv-python package. +This license applies to OpenCV binary in the directory cv2/. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ +libvpx is redistributed within all opencv-python Linux packages. +This license applies to libvpx binary in the directory cv2/. + +Copyright (c) 2010, The WebM Project authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google, nor the WebM Project, nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +FFmpeg is redistributed within all opencv-python packages. + +Libbluray, libgnutls, libnettle, libhogweed, libintl, libmp3lame, libp11, +librtmp, libsoxr and libtasn1 are redistributed within all opencv-python macOS packages. + +This license applies to the above library binaries in the directory cv2/. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + +------------------------------------------------------------------------------ +Qt 5 is redistributed within non-headless opencv-python Linux and macOS packages. +libgmp is redistributed within opencv-python macOS packages. +libidn2 is redistributed within opencv-python macOS packages. +libunistring is redistributed within opencv-python macOS packages. +This license applies to the above binaries in the directory cv2/. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + +------------------------------------------------------------------------------ +bzip2 is redistributed within all opencv-python Linux packages. +This license applies to libbz2 binary in the directory cv2/. + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2010 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@bzip.org +bzip2/libbzip2 version 1.0.6 of 6 September 2010 + +------------------------------------------------------------------------------ +libcrypto and libssl are redistributed within all opencv-python Linux and macOS packages. +libopencore-amrnb and libopencore-amrwb are redistributed within all opencv-python Linux and macOS packages. +This license applies to above binaries in the directory cv2/. + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a double license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are adhered to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the routines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publicly available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +------------------------------------------------------------------------------ +libfontconfig is redistributed within all opencv-python macOS packages. +This license applies to libfontconfig binary in the directory cv2/. + +Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard +Copyright © 2005 Patrick Lam +Copyright © 2009 Roozbeh Pournader +Copyright © 2008,2009 Red Hat, Inc. +Copyright © 2008 Danilo Šegan +Copyright © 2012 Google, Inc. + + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of the author(s) not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. The authors make no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +------------------------------------------------------------------------------ +libfreetype is redistributed within opencv-python Linux and macOS packages. +This license applies to libfreetype binary in the directory cv2/. + + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + https://www.freetype.org + +------------------------------------------------------------------------------ +libpng is redistributed within all opencv-python Linux and macOS packages. +This license applies to libpng binary in the directory cv2/. + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2019 The PNG Reference Library Authors. + * Copyright (c) 2018-2019 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. + +------------------------------------------------------------------------------ +libz is redistributed within all opencv-python Linux packages. +This license applies to libz binary in the directory cv2/. + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +------------------------------------------------------------------------------ +libdav1d is redistributed within opencv-python macOS packages. +This license applies to libdav1d binary in the directory cv2/. + +Copyright © 2018-2019, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libffi is redistributed within opencv-python macOS packages. +This license applies to libffi binary in the directory cv2/. + +libffi - Copyright (c) 1996-2020 Anthony Green, Red Hat, Inc and others. +See source files for details. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------ +libogg is redistributed within opencv-python macOS packages. +This license applies to libogg binary in the directory cv2/. + +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libopenjp2 is redistributed within opencv-python macOS packages. +This license applies to libopenjp2 binary in the directory cv2/. + +The copyright in this software is being made available under the 2-clauses +BSD License, included below. This software may be subject to other third +party and contributor rights, including patent rights, and no such rights +are granted under this license. + +Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium +Copyright (c) 2002-2014, Professor Benoit Macq +Copyright (c) 2003-2014, Antonin Descampe +Copyright (c) 2003-2009, Francois-Olivier Devaux +Copyright (c) 2005, Herve Drolon, FreeImage Team +Copyright (c) 2002-2003, Yannick Verschueren +Copyright (c) 2001-2003, David Janssens +Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France +Copyright (c) 2012, CS Systemes d'Information, France + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libopus is redistributed within opencv-python macOS packages. +This license applies to libopus binary in the directory cv2/. + +Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, + Jean-Marc Valin, Timothy B. Terriberry, + CSIRO, Gregory Maxwell, Mark Borgerding, + Erik de Castro Lopo + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Opus is subject to the royalty-free patent licenses which are +specified at: + +Xiph.Org Foundation: +https://datatracker.ietf.org/ipr/1524/ + +Microsoft Corporation: +https://datatracker.ietf.org/ipr/1914/ + +Broadcom Corporation: +https://datatracker.ietf.org/ipr/1526/ + +------------------------------------------------------------------------------ +librav1e is redistributed within opencv-python macOS packages. +This license applies to librav1e binary in the directory cv2/. + +BSD 2-Clause License + +Copyright (c) 2017-2020, the rav1e contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libsnappy is redistributed within opencv-python macOS packages. +This license applies to libsnappy binary in the directory cv2/. + +Copyright 2011, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libspeex is redistributed within opencv-python macOS packages. +This license applies to libspeex binary in the directory cv2/. + +Copyright 2002-2008 Xiph.org Foundation +Copyright 2002-2008 Jean-Marc Valin +Copyright 2005-2007 Analog Devices Inc. +Copyright 2005-2008 Commonwealth Scientific and Industrial Research + Organisation (CSIRO) +Copyright 1993, 2002, 2006 David Rowe +Copyright 2003 EpicGames +Copyright 1992-1994 Jutta Degener, Carsten Bormann + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libsrt is redistributed within opencv-python macOS packages. +This license applies to libsrt binary in the directory cv2/. + +/* + * + * Copyright (c) 2001-2017 Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + + Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +------------------------------------------------------------------------------ +libtheoradec and libtheoraenc are redistributed within opencv-python macOS packages. +This license applies to libtheoradec and libtheoraenc binaries in the directory cv2/. + + Copyright (C) 2002-2009 Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libwebp and libwebpmux are redistributed within all opencv-python packages. +This license applies to libwebp and libwebpmux binaries in the directory cv2/. + +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libvorbis and libvorbisenc are redistributed within opencv-python macOS packages. +This license applies to libvorbis and libvorbisenc binaries in the directory cv2/. + +Copyright (c) 2002-2020 Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +Libxcb utility libraries are redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb related binaries in the directory cv2/. + +Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall +be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors +or their institutions shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this +Software without prior written authorization from the +authors. + +------------------------------------------------------------------------------ +Libxcb-image is redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb-image binary in the directory cv2/. + +Copyright © 2007-2008 Bart Massey +Copyright © 2008 Julien Danjou +Copyright © 2008 Keith Packard + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or +their institutions shall not be used in advertising or otherwise to +promote the sale, use or other dealings in this Software without +prior written authorization from the authors. + +------------------------------------------------------------------------------ +Libxcb-util is redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb-util binary in the directory cv2/. + +Copyright © 2008 Bart Massey +Copyright © 2008 Ian Osgood +Copyright © 2008 Jamey Sharp +Copyright © 2008 Josh Triplett +Copyright © 2008-2009 Julien Danjou + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or +their institutions shall not be used in advertising or otherwise to +promote the sale, use or other dealings in this Software without +prior written authorization from the authors. + +------------------------------------------------------------------------------ +Libxcb-render-util is redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb-render-util binary in the directory cv2/. + +Copyright © 2000 Keith Packard + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Keith Packard not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Keith Packard makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +Copyright © 2006 Jamey Sharp. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or their +institutions shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the authors. + +Copyright © 2006 Ian Osgood + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or their +institutions shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the authors. + +------------------------------------------------------------------------------ +Libxcb-icccm is redistributed within opencv-python non-headless Linux packages. +This license applies to Libxcb-icccm binary in the directory cv2/. + +Copyright © 2008-2011 Arnaud Fontaine +Copyright © 2007-2008 Vincent Torri + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or +their institutions shall not be used in advertising or otherwise to +promote the sale, use or other dealings in this Software without +prior written authorization from the authors. + +------------------------------------------------------------------------------ +libXau is redistributed within opencv-python non-headless Linux packages. +This license applies to libXau binary in the directory cv2/. + +Copyright 1988, 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +------------------------------------------------------------------------------ +Vulkan headers are redistributed within all opencv-python packages. +This license applies to Vulkan headers in the directory 3rdparty/include/vulkan. + +Copyright (c) 2015-2018 The Khronos Group Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +------------------------------------------------------------------------------ +Libjpeg-turbo is redistributed within all opencv-python packages as build option. + +libjpeg-turbo Licenses +====================== + +libjpeg-turbo is covered by three compatible BSD-style open source licenses: + +- The IJG (Independent JPEG Group) License, which is listed in + [README.ijg](README.ijg) + + This license applies to the libjpeg API library and associated programs + (any code inherited from libjpeg, and any modifications to that code.) + +- The Modified (3-clause) BSD License, which is listed below + + This license covers the TurboJPEG API library and associated programs, as + well as the build system. + +- The [zlib License](https://opensource.org/licenses/Zlib) + + This license is a subset of the other two, and it covers the libjpeg-turbo + SIMD extensions. + + +Complying with the libjpeg-turbo Licenses +========================================= + +This section provides a roll-up of the libjpeg-turbo licensing terms, to the +best of our understanding. + +1. If you are distributing a modified version of the libjpeg-turbo source, + then: + + 1. You cannot alter or remove any existing copyright or license notices + from the source. + + **Origin** + - Clause 1 of the IJG License + - Clause 1 of the Modified BSD License + - Clauses 1 and 3 of the zlib License + + 2. You must add your own copyright notice to the header of each source + file you modified, so others can tell that you modified that file (if + there is not an existing copyright header in that file, then you can + simply add a notice stating that you modified the file.) + + **Origin** + - Clause 1 of the IJG License + - Clause 2 of the zlib License + + 3. You must include the IJG README file, and you must not alter any of the + copyright or license text in that file. + + **Origin** + - Clause 1 of the IJG License + +2. If you are distributing only libjpeg-turbo binaries without the source, or + if you are distributing an application that statically links with + libjpeg-turbo, then: + + 1. Your product documentation must include a message stating: + + This software is based in part on the work of the Independent JPEG + Group. + + **Origin** + - Clause 2 of the IJG license + + 2. If your binary distribution includes or uses the TurboJPEG API, then + your product documentation must include the text of the Modified BSD + License (see below.) + + **Origin** + - Clause 2 of the Modified BSD License + +3. You cannot use the name of the IJG or The libjpeg-turbo Project or the + contributors thereof in advertising, publicity, etc. + + **Origin** + - IJG License + - Clause 3 of the Modified BSD License + +4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be + free of defects, nor do we accept any liability for undesirable + consequences resulting from your use of the software. + + **Origin** + - IJG License + - Modified BSD License + - zlib License + + +The Modified (3-clause) BSD License +=================================== + +Copyright (C)2009-2022 D. R. Commander. All Rights Reserved.
+Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +Why Three Licenses? +=================== + +The zlib License could have been used instead of the Modified (3-clause) BSD +License, and since the IJG License effectively subsumes the distribution +conditions of the zlib License, this would have effectively placed +libjpeg-turbo binary distributions under the IJG License. However, the IJG +License specifically refers to the Independent JPEG Group and does not extend +attribution and endorsement protections to other entities. Thus, it was +desirable to choose a license that granted us the same protections for new code +that were granted to the IJG for code derived from their software. + +------------------------------------------------------------------------------ +Libspng is redistributed within all opencv-python packages as build option. + +BSD 2-Clause License + +Copyright (c) 2018-2022, Randy +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +QUIRC library is redistributed within all opencv-python packages. + +quirc -- QR-code recognition library +Copyright (C) 2010-2012 Daniel Beer + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all +copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +------------------------------------------------------------------------------ +Flatbuffers library is redistributed within all opencv-python packages. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ +Protobuf library is redistributed within all opencv-python packages. + +Copyright 2008 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + +------------------------------------------------------------------------------ +OpenJPEG library is redistributed within all opencv-python packages. + +/* + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third + * party and contributor rights, including patent rights, and no such rights + * are granted under this license. + * + * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2014, Professor Benoit Macq + * Copyright (c) 2003-2014, Antonin Descampe + * Copyright (c) 2003-2009, Francois-Olivier Devaux + * Copyright (c) 2005, Herve Drolon, FreeImage Team + * Copyright (c) 2002-2003, Yannick Verschueren + * Copyright (c) 2001-2003, David Janssens + * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France + * Copyright (c) 2012, CS Systemes d'Information, France + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +------------------------------------------------------------------------------ +TIFF library is redistributed within all opencv-python packages. + +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + +------------------------------------------------------------------------------ +Intel(R) IPP ICV library statically linked within x86 and x86_64 opencv-python packages. + +Intel(R) Integrated Performance Primitives 2021 Update 10 + +Intel Simplified Software License (Version October 2022) + +Intel(R) Integrated Performance Primitives (Intel(R) IPP) : Copyright (C) 1997 Intel Corporation + +Use and Redistribution. You may use and redistribute the software, which is +provided in binary form only, (the "Software"), without modification, +provided the following conditions are met: + +* Redistributions must reproduce the above copyright notice and these + terms of use in the Software and in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel nor the names of its suppliers may be used to + endorse or promote products derived from this Software without specific + prior written permission. +* No reverse engineering, decompilation, or disassembly of the Software is + permitted, nor any modification or alteration of the Software or its operation + at any time, including during execution. + +No other licenses. Except as provided in the preceding section, Intel grants no +licenses or other rights by implication, estoppel or otherwise to, patent, +copyright, trademark, trade name, service mark or other intellectual property +licenses or rights of Intel. + +Third party software. "Third Party Software" means the files (if any) listed +in the "third-party-software.txt" or other similarly-named text file that may +be included with the Software. Third Party Software, even if included with the +distribution of the Software, may be governed by separate license terms, including +without limitation, third party license terms, open source software notices and +terms, and/or other Intel software license terms. These separate license terms +solely govern Your use of the Third Party Software. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE +DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS +WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE +THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND +ATTORNEYS' FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT +INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE. + +LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +No support. Intel may make changes to the Software, at any time without notice, +and is not obligated to support, update or provide training for the Software. + +Termination. Your right to use the Software is terminated in the event of your +breach of this license. + +Feedback. Should you provide Intel with comments, modifications, corrections, +enhancements or other input ("Feedback") related to the Software, Intel will be +free to use, disclose, reproduce, license or otherwise distribute or exploit the +Feedback in its sole discretion without any obligations or restrictions of any +kind, including without limitation, intellectual property rights or licensing +obligations. + +Compliance with laws. You agree to comply with all relevant laws and regulations +governing your use, transfer, import or export (or prohibition thereof) of the +Software. + +Governing law. All disputes will be governed by the laws of the United States of +America and the State of Delaware without reference to conflict of law +principles and subject to the exclusive jurisdiction of the state or federal +courts sitting in the State of Delaware, and each party agrees that it submits +to the personal jurisdiction and venue of those courts and waives any +objections. THE UNITED NATIONS CONVENTION ON CONTRACTS FOR THE INTERNATIONAL +SALE OF GOODS (1980) IS SPECIFICALLY EXCLUDED AND WILL NOT APPLY TO THE SOFTWARE. + +------------------------------------------------------------------------------ +Orbbec SDK distributed with arm64 MacOS packages. + +MIT License + +Copyright (c) 2023 OrbbecDeveloper + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +------------------------------------------------------------------------------ + +libavif library and it's dependnecies are redistributed within all opencv-python packages. + +Copyright 2019 Joe Drago. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +Files: src/obu.c + +Copyright © 2018-2019, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +Files: third_party/iccjpeg/* + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltmain.sh). Another support script, install-sh, is copyright by X Consortium +but is also freely distributable. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent, GIF reading support has +been removed altogether, and the GIF writer has been simplified to produce +"uncompressed GIFs". This technique does not use the LZW algorithm; the +resulting GIF files are larger than usual, but are readable by all standard +GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + +------------------------------------------------------------------------------ + +Files: contrib/gdk-pixbuf/* + +Copyright 2020 Emmanuel Gil Peyrot. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +Files: android_jni/gradlew* + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ + +Files: third_party/libyuv/* + +Copyright 2011 The LibYuv Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +aom library and it's dependnecies are redistributed within all opencv-python packages. + +Copyright (c) 2016, Alliance for Open Media. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +KAZE Features library is redistributed within all opencv-python packages. + +Copyright (c) 2012, Pablo Fernández Alcantarilla +All Rights Reserved + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the copyright holders nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +AKAZE Features library is redistributed within all opencv-python packages. + +Copyright (c) 2014, Pablo Fernandez Alcantarilla, Jesus Nuevo +All Rights Reserved + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the copyright holders nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +dav1d library is redistributed within all opencv-python Linux packages. + +Copyright © 2018-2025, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ + +MLAS library is redistributed within all opencv-python packages. + +MIT License + +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +------------------------------------------------------------------------------ + +CLapack library is redistributed within opencv-python packages for Windows. + +Copyright (c) 1992-2017 The University of Tennessee and The University + of Tennessee Research Foundation. All rights + reserved. +Copyright (c) 2000-2017 The University of California Berkeley. All + rights reserved. +Copyright (c) 2006-2017 The University of Colorado Denver. All rights + reserved. + +$COPYRIGHT$ + +Additional copyrights may follow + +$HEADER$ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer listed + in this license in the documentation and/or other materials + provided with the distribution. + +- Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +The copyright holders provide no reassurances that the source code +provided does not infringe any patent, copyright, or any other +intellectual property rights of third parties. The copyright holders +disclaim any liability to any recipient for claims brought against +recipient by any third party for infringement of that parties +intellectual property rights. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end shared text T4 ]] + +[[ begin shared text T5 ]] +MIT License + +Copyright (c) Olli-Pekka Heinisuo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T5 ]] + +[[ begin shared text T6 ]] + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS +[[ end shared text T6 ]] + +[[ begin shared text T7 ]] +(This is the MIT license, note that libffi-src is a separate product with its own license) + +Copyright 2002, 2003 - Bill Bumgarner, Ronald Oussoren, Steve Majewski, Lele Gaifax, et.al. +Copyright 2003-2025 - Ronald Oussoren + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end shared text T7 ]] + +[[ begin shared text T8 ]] + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T8 ]] + +[[ begin shared text T9 ]] + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/LICENSE-2.0 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T9 ]] + +[[ begin shared text T10 ]] +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T10 ]] + +[[ begin shared text T11 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T11 ]] + +[[ begin shared text T12 ]] +This project is dual-licensed under the Unlicense and MIT licenses. + +You may use this code under the terms of either license. +[[ end shared text T12 ]] + +[[ begin shared text T13 ]] +The MIT License (MIT) + +Copyright (c) 2015 Andrew Gallant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end shared text T13 ]] + +[[ begin shared text T14 ]] +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +[[ end shared text T14 ]] + +[[ begin shared text T15 ]] +Copyright (c) 2016 Dropbox, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end shared text T15 ]] + +[[ begin shared text T16 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS +[[ end shared text T16 ]] + +[[ begin shared text T17 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T17 ]] + +[[ begin shared text T18 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T18 ]] + +[[ begin shared text T19 ]] +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T19 ]] + +[[ begin shared text T20 ]] +The gtk-rs Project is licensed under the MIT license, see the LICENSE file or +. + +Copyrights in the gtk-rs Project project are retained by their contributors. +No copyright assignment is required to contribute to the gtk-rs Project +project. + +For full authorship information, see the version control history. + +This project provides interoperability with various GNOME libraries but +doesn't distribute any parts of them. Distributing compiled libraries and +executables that link to those libraries may be subject to terms of the GNU +LGPL or other licenses. For more information check the license of each GNOME +library. +[[ end shared text T20 ]] + +[[ begin shared text T21 ]] +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T21 ]] + +[[ begin shared text T22 ]] +=============================================================================== + +Copyright (c) 2016 Alex Crichton +Copyright (c) 2017 The Tokio Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=============================================================================== + +Copyright (c) 2016 Alex Crichton +Copyright (c) 2017 The Tokio Authors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T22 ]] + +[[ begin shared text T23 ]] +The MIT License (MIT) + +Copyright (c) 2015 Alice Maz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end shared text T23 ]] + +[[ begin shared text T24 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T24 ]] + +[[ begin shared text T25 ]] +Copyright (c) 2023 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T25 ]] + +[[ begin shared text T26 ]] +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T26 ]] + +[[ begin shared text T27 ]] +Copyright (c) 2018-2019 The RustCrypto Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T27 ]] + +[[ begin shared text T28 ]] +Copyright (c) 2014 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T28 ]] + +[[ begin shared text T29 ]] +Copyright (c) 2012-2013 Mozilla Foundation + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T29 ]] + +[[ begin shared text T30 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T30 ]] + +[[ begin shared text T31 ]] +The MIT License (MIT) + +Copyright (c) 2019 The Crossbeam Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T31 ]] + +[[ begin shared text T32 ]] +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +[[ end shared text T32 ]] + +[[ begin shared text T33 ]] +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T33 ]] + +[[ begin shared text T34 ]] +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end shared text T34 ]] + +[[ begin shared text T35 ]] +MIT License + +Copyright (c) 2017 Ted Driggs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T35 ]] + +[[ begin shared text T36 ]] +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014-2018 David Henningsson and other contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T36 ]] + +[[ begin shared text T37 ]] +Copyright (c) 2014-2018 David Henningsson and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T37 ]] + +[[ begin shared text T38 ]] +Copyright (c) 2016 secret-service Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T38 ]] + +[[ begin shared text T39 ]] +The MIT License (MIT) + +Copyright (c) 2016 Jelte Fennema + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T39 ]] + +[[ begin shared text T40 ]] +Copyright (c) 2017 Artyom Pavlov + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T40 ]] + +[[ begin shared text T41 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. +[[ end shared text T41 ]] + +[[ begin shared text T42 ]] +Copyright (c) 2018-2019 dirs-rs contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T42 ]] + +[[ begin shared text T43 ]] +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T43 ]] + +[[ begin shared text T44 ]] +MIT License + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T44 ]] + +[[ begin shared text T45 ]] +Copyright (c) 2017 The foreign-types Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T45 ]] + +[[ begin shared text T46 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright (c) 2016 Alex Crichton +Copyright (c) 2017 The Tokio Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T46 ]] + +[[ begin shared text T47 ]] +Copyright (c) 2016 Alex Crichton +Copyright (c) 2017 The Tokio Authors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T47 ]] + +[[ begin shared text T48 ]] + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T48 ]] + +[[ begin shared text T49 ]] +Copyright (c) 2016 Amanieu d'Antras + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T49 ]] + +[[ begin shared text T50 ]] +Copyright (c) 2015 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T50 ]] + +[[ begin shared text T51 ]] +Copyright (c) 2014 The html5ever Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T51 ]] + +[[ begin shared text T52 ]] +Copyright (c) 2019-2026 Sean McArthur & Hyper Contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T52 ]] + +[[ begin shared text T53 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2020 Andrew Straw + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T53 ]] + +[[ begin shared text T54 ]] +Copyright (c) 2020 Andrew D. Straw + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T54 ]] + +[[ begin shared text T55 ]] +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 2020-2024 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. + +SPDX-License-Identifier: Unicode-3.0 + +— + +Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. +ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. +[[ end shared text T55 ]] + +[[ begin shared text T56 ]] +Copyright (c) 2013-2025 The rust-url developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T56 ]] + +[[ begin shared text T57 ]] +Copyright (c) 2016--2017 + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T57 ]] + +[[ begin shared text T58 ]] +The MIT License (MIT) + +Copyright (c) 2013-2017, The Gtk-rs Project Developers. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T58 ]] + +[[ begin shared text T59 ]] +Copyright (c) 2015 The rust-jni-sys Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T59 ]] + +[[ begin shared text T60 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T60 ]] + +[[ begin shared text T61 ]] +Copyright © 2015, Simonas Kazlauskas + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without +fee is hereby granted, provided that the above copyright notice and this permission notice appear +in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +[[ end shared text T61 ]] + +[[ begin shared text T62 ]] + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. +[[ end shared text T62 ]] + +[[ begin shared text T63 ]] +Copyright (c) 2016 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T63 ]] + +[[ begin shared text T64 ]] +MIT License + +Copyright 2013-2014 RAD Game Tools and Valve Software +Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC +Copyright (c) 2017 Frommi +Copyright (c) 2017-2024 oyvindln + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T64 ]] + +[[ begin shared text T65 ]] +MIT License + +Copyright 2013-2014 RAD Game Tools and Valve Software +Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC +Copyright (c) 2017 Frommi +Copyright (c) 2017-2024 oyvindln + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T65 ]] + +[[ begin shared text T66 ]] +Copyright 2013-2014 RAD Game Tools and Valve Software +Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC +Copyright (c) 2020 Frommi +Copyright (c) 2017-2024 oyvindln + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. +[[ end shared text T66 ]] + +[[ begin shared text T67 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Radzivon Bartoshyk + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T67 ]] + +[[ begin shared text T68 ]] +Copyright (c) Radzivon Bartoshyk. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end shared text T68 ]] + +[[ begin shared text T69 ]] +MIT License + +Copyright (c) 2022-2022 Tauri Programme within The Commons Conservancy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T69 ]] + +[[ begin shared text T70 ]] +Copyright (c) 2018, Daniel Wagner-Hall +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of num_enum nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end shared text T70 ]] + +[[ begin shared text T71 ]] +The MIT License (MIT) + +Copyright (c) 2014-2022 Steven Fackler, Yuki Okushi + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end shared text T71 ]] + +[[ begin shared text T72 ]] +Copyright (c) 2015 nwin + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T72 ]] + +[[ begin shared text T73 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2019-2020 CreepySkeleton + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +[[ end shared text T73 ]] + +[[ begin shared text T74 ]] +MIT License + +Copyright (c) 2019-2020 CreepySkeleton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T74 ]] + +[[ begin shared text T75 ]] +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. +[[ end shared text T75 ]] + +[[ begin shared text T76 ]] +Copyright 2018 Developers of the Rand project +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T76 ]] + +[[ begin shared text T77 ]] +The MIT License (MIT) + +Copyright (c) 2017 Andrew Gallant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +[[ end shared text T77 ]] + +[[ begin shared text T78 ]] +MIT License + +Copyright (c) 2019 Graham Esau + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T78 ]] + +[[ begin shared text T79 ]] +The MIT License (MIT) + +Copyright (c) 2015 Steven Fackler + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end shared text T79 ]] + +[[ begin shared text T80 ]] +Copyright (c) Individual contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T80 ]] + +[[ begin shared text T81 ]] +Copyright (c) 2015 + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T81 ]] + +[[ begin shared text T82 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T82 ]] + +[[ begin shared text T83 ]] +MIT License + +Copyright (c) 2021 Chip Reed + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T83 ]] + +[[ begin shared text T84 ]] +Copyright (c) 2006-2009 Graydon Hoare +Copyright (c) 2009-2013 Mozilla Foundation +Copyright (c) 2016 Artyom Pavlov + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T84 ]] + +[[ begin shared text T85 ]] +MIT License + +Copyright (c) 2017 - Present Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T85 ]] + +[[ begin shared text T86 ]] +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tauri +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Tauri is a rust project that enables developers to make secure +and small desktop applications using a web frontend. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2019-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tauri +PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git +Creator: Person: Daniel Thompson-Yvetot +[[ end shared text T86 ]] + +[[ begin shared text T87 ]] + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS +[[ end shared text T87 ]] + +[[ begin shared text T88 ]] +MIT License + +Copyright (c) 2017 - Present Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T88 ]] + +[[ begin shared text T89 ]] +Copyright (c) Jacob Pratt et al. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T89 ]] + +[[ begin shared text T90 ]] +MIT License + +Copyright (c) Tokio Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T90 ]] + +[[ begin shared text T91 ]] +Copyright (c) 2019 Tower Contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T91 ]] + +[[ begin shared text T92 ]] +Copyright (c) 2019 Tokio Contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T92 ]] + +[[ begin shared text T93 ]] +The MIT License (MIT) + +Copyright (c) 2019 nabijaczleweli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +[[ end shared text T93 ]] + +[[ begin shared text T94 ]] +# Community Data License Agreement - Permissive - Version 2.0 + +This is the Community Data License Agreement - Permissive, Version +2.0 (the "agreement"). Data Provider(s) and Data Recipient(s) agree +as follows: + +## 1. Provision of the Data + +1.1. A Data Recipient may use, modify, and share the Data made +available by Data Provider(s) under this agreement if that Data +Recipient follows the terms of this agreement. + +1.2. This agreement does not impose any restriction on a Data +Recipient's use, modification, or sharing of any portions of the +Data that are in the public domain or that may be used, modified, +or shared under any other legal exception or limitation. + +## 2. Conditions for Sharing Data + +2.1. A Data Recipient may share Data, with or without modifications, so +long as the Data Recipient makes available the text of this agreement +with the shared Data. + +## 3. No Restrictions on Results + +3.1. This agreement does not impose any restriction or obligations +with respect to the use, modification, or sharing of Results. + +## 4. No Warranty; Limitation of Liability + +4.1. All Data Recipients receive the Data subject to the following +terms: + +THE DATA IS PROVIDED ON AN "AS IS" BASIS, WITHOUT REPRESENTATIONS, +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED +INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +NO DATA PROVIDER SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE DATA OR RESULTS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +## 5. Definitions + +5.1. "Data" means the material received by a Data Recipient under +this agreement. + +5.2. "Data Provider" means any person who is the source of Data +provided under this agreement and in reliance on a Data Recipient's +agreement to its terms. + +5.3. "Data Recipient" means any person who receives Data directly +or indirectly from a Data Provider and agrees to the terms of this +agreement. + +5.4. "Results" means any outcome obtained by computational analysis +of Data, including for example machine learning models and models' +insights. +[[ end shared text T94 ]] + +[[ begin shared text T95 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) Microsoft Corporation. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T95 ]] + +[[ begin shared text T96 ]] + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE +[[ end shared text T96 ]] + +[[ begin shared text T97 ]] +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +[[ end shared text T97 ]] + +[[ begin shared text T98 ]] +Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T98 ]] + +[[ begin shared text T99 ]] + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 The Fuchsia Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +[[ end shared text T99 ]] + +[[ begin shared text T100 ]] +Copyright 2019 The Fuchsia Authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +[[ end shared text T100 ]] + +[[ begin shared text T101 ]] +Copyright 2023 The Fuchsia Authors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +[[ end shared text T101 ]] diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index b22ae4e..c5603d9 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,16 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### setup/notices.py, setup/notices_crates.py, routers/system.py · THIRD-PARTY-NOTICES.txt +- refers-to: setup/notices.py (new) requirement_roots, python_closure, python_sections, runtime_section, npm_production, npm_sections, crate_sections, ffmpeg_section, render, parse, generate, check; setup/notices_crates.py (new) locked_crates, cargo_metadata, describe; config.notices_path; routers/system.py /notices; tauri.conf.json bundle.resources; setup/build_macos_app, build_linux_app, build_windows_app.bat --add-data; .github/workflows/ci.yml test job; tests/test_notices.py +- kind: feat +- logged: after v1.32.4 · 2026-11-29 + +LICENSES.md says what each component is and why it is there; THIRD-PARTY-NOTICES.txt at the repository root now holds the full licence texts (copyright lines, conditions and disclaimers) of what ships. `python3 setup/notices.py` writes it from four sources. Python: the names in requirements.txt and requirements_macos.txt and everything they require (markers evaluated with packaging when it is installed, extras left out), each with every licence, copying, notice or authors file its installed distribution lists, the files under a licenses folder included (pypdfium2 and opencv carry their bundled libraries' texts that way), plus the interpreter's own LICENSE.txt for the frozen runtime. A requirement not installed where the file is written keeps its section from the previous file and is named on stderr, so writing it on Linux does not drop the macOS-only packages. JavaScript: the packages package-lock.json does not mark dev, with the licence files from node_modules (npm ci first). Rust: every crate Cargo.lock reaches from formdam-desktop, which is all three platforms and the build dependencies, with the licence, repository and source folder from `cargo metadata --locked` (CARGO and CARGO_HOME are honoured; --offline passes --offline) or, when cargo cannot answer, from the crate's Cargo.toml in the registry cache; a crate whose package carries no licence file, or whose source is not in the cache, is listed with its SPDX licence and repository and a note saying which. Binaries: the ffmpeg build the engine downloads is referenced by its formai-binaries release, which carries its own notices, the LGPL-2.1 text and the source. Identical texts (the Apache-2.0 text most crates carry) are printed once at the end and referred to by number. Written twice in the same environment the file is byte-identical. + +`python3 setup/notices.py --check` (CI, in the test job after the frontend tests) fails when a pinned requirement's version differs from the listed one, an installed shipped Python package has no section, the npm or crate list differs from the lock files in either direction, or the ffmpeg release differs from ffmpeg_record.RELEASE. It needs no cargo and no network. Unpinned Python packages are checked by name only, so a new numpy release does not fail CI; regenerate before a release. The script turns off bytecode writing so it leaves no __pycache__ in setup/, which test_build_tree_clean reads. + +The file ships beside LICENSES.md in every installer (bundle.resources) and is frozen into the engine (--add-data), which serves it as text from /api/notices (404 when a build lacks it, capped at 16 MiB) for Settings. + ### services/pdfcopy.py, pdfstrip.py · the rebuild copies only known kinds and refuses the rest - refers-to: pdfcopy (new) Copier content, resources, copy, dictionary, array, stream, image, samples, recode, sniff, the key allowlists FONT, DESCRIPTOR, FONT_PROGRAM, FORM, PATTERN, SHADING, FUNCTION, IMAGE, PLAIN; pdfstrip _rebuild, _copy_page, verify, _check_stream; tests/test_formats_extra.py raw_image and the raw sample, inline image, unknown stream and key allowlist tests - kind: fix diff --git a/backend/app/config.py b/backend/app/config.py index 205da54..0622669 100644 --- a/backend/app/config.py +++ b/backend/app/config.py @@ -29,6 +29,14 @@ def env(name: str, default: str) -> str: return default +NOTICES_NAME = "THIRD-PARTY-NOTICES.txt" + + +def notices_path() -> str: + bundled = os.path.join(getattr(sys, "_MEIPASS", ""), NOTICES_NAME) + return bundled if getattr(sys, "frozen", False) else os.path.join(REPO_ROOT, NOTICES_NAME) + + def library_root() -> str: return os.path.abspath(env("LIBRARY", os.path.join(REPO_ROOT, "library"))) diff --git a/backend/app/routers/system.py b/backend/app/routers/system.py index 7ffe8cc..b63924b 100644 --- a/backend/app/routers/system.py +++ b/backend/app/routers/system.py @@ -1,10 +1,11 @@ import json from fastapi import APIRouter, HTTPException, Query +from fastapi.responses import PlainTextResponse from pydantic import BaseModel from .. import jobs -from ..config import VERSION, db_path, library_root, models_dir +from ..config import VERSION, db_path, library_root, models_dir, notices_path from ..db import q1, setting_get, setting_set, ex from ..services import fsbrowse, native_picker, ocrsvc @@ -21,6 +22,21 @@ def health(): } +NOTICES_CAP = 16 * 1024 * 1024 + + +@router.get("/notices", response_class=PlainTextResponse) +def notices(): + try: + with open(notices_path(), "r", encoding="utf-8") as handle: + text = handle.read(NOTICES_CAP + 1) + except OSError: + raise HTTPException(404, detail="The third-party notices are not in this build") + if len(text) > NOTICES_CAP: + raise HTTPException(500, detail="The third-party notices file is larger than expected") + return PlainTextResponse(text, headers={"Cache-Control": "no-store"}) + + @router.get("/fs/roots") def fs_roots(): return {"roots": fsbrowse.list_roots()} diff --git a/backend/tests/test_notices.py b/backend/tests/test_notices.py new file mode 100644 index 0000000..90101c7 --- /dev/null +++ b/backend/tests/test_notices.py @@ -0,0 +1,15 @@ +from tests.conftest import HEADERS + + +def test_engine_serves_the_bundled_third_party_notices(client): + res = client.get("/api/notices", headers=HEADERS) + assert res.status_code == 200 and res.headers["content-type"].startswith("text/plain") + for line in ("python: pypdf 7.2.0", "npm: lottie-web 5.12.2", "crate: tauri ", "binary: ffmpeg "): + assert line in res.text + + +def test_missing_notices_are_reported_not_invented(client, tmp_path, monkeypatch): + from app.routers import system + + monkeypatch.setattr(system, "notices_path", lambda: str(tmp_path / "none.txt")) + assert client.get("/api/notices", headers=HEADERS).status_code == 404 diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 92416db..e2a10db 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### ui/components/notices.ts · Third-party notices in Settings +- refers-to: notices.ts (new) thirdPartyNotices; settings.ts App pane, Licences and notices; styles/app.css .settings-notices-text +- kind: feat +- logged: after v1.32.4 · 2026-11-29 + +Settings > App > About formDAM > Licences and notices now holds a second disclosure, Third-party notices, which shows THIRD-PARTY-NOTICES.txt as the engine serves it (/api/notices). The text is fetched the first time the section opens, not with Settings, because it is about 1.6 MB. The box has a fixed 320 px height from the start and scrolls inside itself, so the arrival of the text moves nothing (zero layout shift); a failed fetch says so in the same box and is retried on the next opening. Colours and borders use the glass and text tokens. + ### ui/components/assetbodies.ts · pages and the turntable - refers-to: assetbodies.ts pdfBody, excerptBody, modelBody, drawMesh; assetkinds.ts documentFacts, modelFacts, rotatePoint; library.ts, sidebar.ts, store.ts, organize.ts, pages.ts Documents and 3D Models; styles/assets.css - kind: feat diff --git a/frontend/src/styles/app.css b/frontend/src/styles/app.css index 01e78f2..78f1edd 100644 --- a/frontend/src/styles/app.css +++ b/frontend/src/styles/app.css @@ -643,6 +643,8 @@ html.vibrancy #app { background: var(--vib-body, rgba(10,6,3,0.46)); } .settings-pane .settings-hint { max-width: 560px; line-height: 1.5; margin: 6px 0 2px; } .settings-notices { max-width: 560px; margin-top: 6px; } .settings-notices summary { cursor: pointer; font-size: 12.5px; color: var(--text); } +.settings-notices .settings-notices { margin-top: 10px; } +.settings-notices-text { height: 320px; margin: 8px 0 0; padding: 10px 12px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 ui-monospace, monospace; color: var(--text-muted); background: var(--glass-bg-2); border: 1px solid var(--glass-border); border-radius: 8px; } .settings-pane .preset-row { display: flex; gap: 8px; margin: 4px 0 14px; } .settings-pane .swatch-row { display: flex; gap: 10px; margin: 6px 0 4px; } .settings-pane .modal-actions { margin-top: 20px; } diff --git a/frontend/src/ui/components/notices.ts b/frontend/src/ui/components/notices.ts new file mode 100644 index 0000000..b620ab2 --- /dev/null +++ b/frontend/src/ui/components/notices.ts @@ -0,0 +1,24 @@ +import { h } from "../dom.js"; + +async function noticesText(): Promise { + const res = await fetch("/api/notices", { headers: { "x-dam-local": "1" } }); + if (!res.ok) throw new Error(res.statusText); + return res.text(); +} + +export function thirdPartyNotices(): HTMLElement { + const text = h("pre", { class: "settings-notices-text", tabindex: 0 }, "Loading the notices..."); + const section = h("details", { class: "settings-notices" }, h("summary", {}, "Third-party notices"), text); + let asked = false; + section.addEventListener("toggle", () => { + if (!(section as HTMLDetailsElement).open || asked) return; + asked = true; + noticesText() + .then((body) => { text.textContent = body; }) + .catch(() => { + asked = false; + text.textContent = "The notices could not be loaded. THIRD-PARTY-NOTICES.txt beside the app holds the same text."; + }); + }); + return section; +} diff --git a/frontend/src/ui/components/settings.ts b/frontend/src/ui/components/settings.ts index fee2aa6..2ea68f5 100644 --- a/frontend/src/ui/components/settings.ts +++ b/frontend/src/ui/components/settings.ts @@ -9,6 +9,7 @@ import { iconEl, type IconName } from "../icons.js"; import { openModal, textField } from "../modal.js"; import { toast } from "../toast.js"; import { privacyPane } from "./privacy.js"; +import { thirdPartyNotices } from "./notices.js"; export type BackgroundControl = { enable: () => void; disable: () => void; update: (bg: { radius: number; glow: number; bloom: number }) => void }; @@ -445,7 +446,8 @@ export function openSettings(): void { h("p", { class: "settings-hint" }, "Open-source, local-first photo library and asset manager. Apache-2.0 licence; every component and its licence is listed in LICENSES.md."), h("details", { class: "settings-notices" }, h("summary", {}, "Licences and notices"), - h("p", { class: "settings-hint" }, "This product includes DNG technology under license by Adobe Systems Incorporated.")), + h("p", { class: "settings-hint" }, "This product includes DNG technology under license by Adobe Systems Incorporated."), + thirdPartyNotices()), ] }, { key: "library", label: "Library", icon: "library", nodes: [libraryInfo] }, { key: "vault", label: "Vault & Keychain", icon: "lock", nodes: [keychainWrap] }, diff --git a/setup/build_linux_app b/setup/build_linux_app index 09b898f..e2e0c66 100755 --- a/setup/build_linux_app +++ b/setup/build_linux_app @@ -95,6 +95,7 @@ pyinstaller --clean --noconfirm --onedir --name formdam-backend \ --add-data "models:models" \ --add-data "app/data:app/data" \ --add-data "../frontend/package.json:." \ + --add-data "../THIRD-PARTY-NOTICES.txt:." \ desktop_entry.py ./dist/formdam-backend/formdam-backend --selfcheck deactivate diff --git a/setup/build_macos_app b/setup/build_macos_app index 8996b72..4fc2de9 100755 --- a/setup/build_macos_app +++ b/setup/build_macos_app @@ -90,6 +90,7 @@ pyinstaller --clean --noconfirm --onedir --name formdam-backend \ --add-data "models:models" \ --add-data "app/data:app/data" \ --add-data "../frontend/package.json:." \ + --add-data "../THIRD-PARTY-NOTICES.txt:." \ desktop_entry.py gpl="$(find dist/formdam-backend \( -iname 'libx264*' -o -iname 'libx265*' -o -iname 'librubberband*' -o -iname 'libvidstab*' -o -iname 'libpostproc*' \) | head -1)" [ -z "$gpl" ] || { echo "GPL FFmpeg library in the engine: $gpl. Reinstall opencv from source without FFmpeg: PIP_NO_BINARY=opencv-python,opencv-python-headless CMAKE_ARGS=-DWITH_FFMPEG=OFF pip install --force-reinstall -r requirements_macos.txt"; exit 1; } diff --git a/setup/build_windows_app.bat b/setup/build_windows_app.bat index 082cfab..18fbcd0 100644 --- a/setup/build_windows_app.bat +++ b/setup/build_windows_app.bat @@ -66,6 +66,7 @@ pyinstaller --clean --noconfirm --onedir %WINDOWED% --name formdam-backend ^ --add-data "models;models" ^ --add-data "app\data;app\data" ^ --add-data "..\frontend\package.json;." ^ + --add-data "..\THIRD-PARTY-NOTICES.txt;." ^ desktop_entry.py || exit /b 1 dist\formdam-backend\formdam-backend.exe --selfcheck || exit /b 1 call deactivate diff --git a/setup/notices.py b/setup/notices.py new file mode 100644 index 0000000..dc46e35 --- /dev/null +++ b/setup/notices.py @@ -0,0 +1,335 @@ +import argparse +import hashlib +import importlib.metadata as md +import json +import os +import platform +import re +import sys +import sysconfig +from typing import Dict, List, Optional, Set, Tuple + +sys.dont_write_bytecode = True + +import notices_crates # noqa: E402 + +REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +OUT = os.path.join(REPO, "THIRD-PARTY-NOTICES.txt") +REQUIREMENTS = ("backend/requirements.txt", "backend/requirements_macos.txt") +RULE = "=" * 78 +THIN = "-" * 78 +HEADER_LINE = re.compile(r"^(python|npm|crate|runtime|binary): (\S+) (\S+)$") +LICENCE_NAME = re.compile(r"^(licen[cs]e|copying|notice|authors|copyright)", re.IGNORECASE) +LICENCE_DIR = re.compile(r"(^|/)licen[cs]es?/", re.IGNORECASE) +CODE_SUFFIXES = (".py", ".pyc", ".pyi", ".so", ".dylib", ".pyd", ".dll") +FFMPEG_RELEASES = "https://github.com/nodemode-dev/formai-binaries/releases/tag/ffmpeg-{release}" +LGPL_URL = "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt" +INTRO = """formDAM third-party notices + +formDAM is Apache-2.0 (see LICENSE and NOTICE.md). This file holds the licence +texts of the third-party software that ships with it: the Python packages frozen +into the engine, the JavaScript packages built into the window, the Rust crates +compiled into the desktop shell, and the binaries the app downloads. LICENSES.md +is the human ledger with the reason each component is there. + +Generated by setup/notices.py from the installed packages, the lock files and +the cargo registry; regenerate it with `python3 setup/notices.py` and check it +with `python3 setup/notices.py --check`. Licence texts that are identical across +components are printed once, at the end, and referred to by number. +""" + + +CRATE_NOTES = { + "no-files": "The published crate carries no licence file; its SPDX licence and repository are given above.", + "missing": ("Its source was not available in the local cargo registry where this file was generated, so its " + "licence files are not included; the SPDX licence and repository above are from crates.io."), +} + + +class Section: + def __init__(self, kind: str, name: str, version: str, licence: str, source: str, + files: List[Tuple[str, str]], note: str = "") -> None: + self.kind, self.name, self.version = kind, name, version + self.licence, self.source, self.files, self.note = licence, source, files, note + + +def norm(name: str) -> str: + return re.sub(r"[-_.]+", "-", name).lower() + + +def requirement_roots() -> Dict[str, Optional[str]]: + roots: Dict[str, Optional[str]] = {} + for rel in REQUIREMENTS: + with open(os.path.join(REPO, rel), encoding="utf-8") as handle: + for line in handle: + match = re.match(r"\s*([A-Za-z0-9._-]+)\s*(==\s*([^\s;#]+))?", line.split("#", 1)[0]) + if match: + roots[norm(match.group(1))] = match.group(3) + return roots + + +def _wanted(requirement: str) -> Optional[str]: + spec, _, marker = requirement.partition(";") + if "extra" in marker: + return None + if marker.strip(): + try: + from packaging.markers import Marker + + if not Marker(marker.strip()).evaluate(): + return None + except Exception: + pass + match = re.match(r"\s*([A-Za-z0-9._-]+)", spec) + return norm(match.group(1)) if match else None + + +def python_closure(roots: Dict[str, Optional[str]]) -> Dict[str, md.Distribution]: + found: Dict[str, md.Distribution] = {} + queue = list(roots) + while queue: + name = queue.pop() + if name in found: + continue + try: + dist = md.distribution(name) + except md.PackageNotFoundError: + continue + found[name] = dist + queue.extend(dep for dep in map(_wanted, dist.requires or []) if dep and dep not in found) + return found + + +def _python_files(dist: md.Distribution) -> List[Tuple[str, str]]: + picked, seen = [], set() + for path in sorted(dist.files or [], key=str): + text = str(path).replace("\\", "/") + base = text.rsplit("/", 1)[-1] + if text.endswith(CODE_SUFFIXES) or not (LICENCE_NAME.match(base) or LICENCE_DIR.search(text)): + continue + try: + body = dist.locate_file(path).read_text(encoding="utf-8", errors="replace") + except OSError: + continue + digest = hashlib.sha256(body.encode()).hexdigest() + if digest not in seen: + seen.add(digest) + picked.append((text, body)) + return picked + + +def _python_licence(dist: md.Distribution) -> str: + meta = dist.metadata + for value in (meta.get("License-Expression"), meta.get("License")): + if value and len(value) < 120 and "\n" not in value.strip(): + return value.strip() + classifiers = [c.rsplit("::", 1)[-1].strip() for c in meta.get_all("Classifier") or [] if c.startswith("License ::")] + return ", ".join(classifiers) or "see the licence text" + + +def _python_source(dist: md.Distribution) -> str: + meta = dist.metadata + urls = [u.split(",", 1)[-1].strip() for u in meta.get_all("Project-URL") or []] + return meta.get("Home-page") or (urls[0] if urls else f"https://pypi.org/project/{dist.metadata['Name']}/") + + +def python_sections(closure: Dict[str, md.Distribution]) -> List[Section]: + sections = [] + for name, dist in sorted(closure.items()): + files = _python_files(dist) + note = "" if files else "The distribution carries no licence file; its licence is given above." + sections.append(Section("python", name, dist.version, _python_licence(dist), _python_source(dist), files, note)) + return sections + + +def runtime_section() -> Section: + path = os.path.join(sysconfig.get_paths()["stdlib"], "LICENSE.txt") + files = [("LICENSE.txt", open(path, encoding="utf-8").read())] if os.path.isfile(path) else [] + note = "" if files else "The interpreter's LICENSE.txt was not available where this file was generated." + return Section("runtime", "python", platform.python_version(), "PSF-2.0", "https://www.python.org/", files, note) + + +def npm_production(lock_path: str) -> List[Tuple[str, dict]]: + with open(lock_path, encoding="utf-8") as handle: + packages = json.load(handle)["packages"] + return sorted((path.split("node_modules/")[-1], meta) for path, meta in packages.items() + if path.startswith("node_modules/") and not meta.get("dev") and not meta.get("devOptional")) + + +def npm_sections() -> List[Section]: + sections = [] + for name, meta in npm_production(os.path.join(REPO, "frontend", "package-lock.json")): + folder = os.path.join(REPO, "frontend", "node_modules", name) + files = [] + if os.path.isdir(folder): + for base in sorted(os.listdir(folder)): + if LICENCE_NAME.match(base) and os.path.isfile(os.path.join(folder, base)): + files.append((base, open(os.path.join(folder, base), encoding="utf-8", errors="replace").read())) + note = "" if files else "Its licence file was not available where this file was generated (run npm ci first)." + sections.append(Section("npm", name, meta["version"], meta.get("license", "unknown here"), + meta.get("resolved", f"https://www.npmjs.com/package/{name}"), files, note)) + return sections + + +def crate_sections(offline: bool) -> List[Section]: + tauri = os.path.join(REPO, "src-tauri") + metadata = notices_crates.cargo_metadata(tauri, offline) + sections = [] + for crate in notices_crates.locked_crates(tauri): + info = notices_crates.describe(crate, metadata) + note = CRATE_NOTES.get(info["state"], "") + sections.append(Section("crate", crate[0], crate[1], info["licence"], info["source"], info["files"], note)) + return sections + + +def ffmpeg_section() -> Section: + sys.path.insert(0, os.path.join(REPO, "backend")) + from app.ffmpeg_record import RELEASE + + url = FFMPEG_RELEASES.format(release=RELEASE) + note = (f"Not bundled. When no ffmpeg is on PATH the engine downloads this LGPL build (--disable-gpl --disable-nonfree; " + f"libopus and libvpx BSD-3-Clause) from {url}. That release carries its own THIRD-PARTY-NOTICES.txt, the " + f"LGPL-2.1 licence text and the source code; the LGPL-2.1 text is also at {LGPL_URL}. An ffmpeg already on " + "PATH is used instead and keeps its own licence.") + return Section("binary", "ffmpeg", RELEASE, "LGPL-2.1-or-later", url, [], note) + + +KIND_ORDER = {"runtime": 0, "python": 1, "npm": 2, "crate": 3, "binary": 4} +BEGIN = re.compile(r"^\[\[ begin file (.+) \]\]$") +SHARED_REF = re.compile(r"^\[\[ file (.+): shared text (T\d+) \]\]$") +SHARED_BEGIN = re.compile(r"^\[\[ begin shared text (T\d+) \]\]$") + + +def _shared_texts(sections: List[Section]) -> Dict[str, str]: + counts: Dict[str, int] = {} + for section in sections: + for _name, body in section.files: + counts[body] = counts.get(body, 0) + 1 + ids: Dict[str, str] = {} + for section in sections: + for _name, body in section.files: + if counts[body] > 1 and body not in ids: + ids[body] = f"T{len(ids) + 1}" + return ids + + +def render(sections: List[Section]) -> str: + ordered = sorted(sections, key=lambda s: (KIND_ORDER[s.kind], s.name, s.version)) + shared = _shared_texts(ordered) + lines = [INTRO.rstrip("\n"), ""] + for section in ordered: + lines += [RULE, f"{section.kind}: {section.name} {section.version}", f"Licence: {section.licence}", + f"Source: {section.source}"] + if section.note: + lines.append(f"Note: {section.note}") + for name, body in section.files: + if body in shared: + lines.append(f"[[ file {name}: shared text {shared[body]} ]]") + else: + lines += [f"[[ begin file {name} ]]", body.rstrip("\n"), f"[[ end file {name} ]]"] + lines.append("") + lines += [RULE, "Shared licence texts", ""] + for body, ident in shared.items(): + lines += [f"[[ begin shared text {ident} ]]", body.rstrip("\n"), f"[[ end shared text {ident} ]]", ""] + return "\n".join(lines).rstrip("\n") + "\n" + + +def _read_block(lines: List[str], start: int, end_line: str) -> Tuple[str, int]: + stop = lines.index(end_line, start) + return "\n".join(lines[start:stop]) + "\n", stop + 1 + + +def parse(text: str) -> List[Section]: + lines = text.split("\n") + shared: Dict[str, str] = {} + for at, line in enumerate(lines): + match = SHARED_BEGIN.match(line) + if match: + shared[match.group(1)] = _read_block(lines, at + 1, f"[[ end shared text {match.group(1)} ]]")[0] + sections, at = [], 0 + while at < len(lines): + head = HEADER_LINE.match(lines[at]) + if not (head and at > 0 and lines[at - 1] == RULE): + at += 1 + continue + fields: Dict[str, str] = {} + files: List[Tuple[str, str]] = [] + at += 1 + while at < len(lines) and lines[at] not in ("", RULE): + begin, ref = BEGIN.match(lines[at]), SHARED_REF.match(lines[at]) + if begin: + body, at = _read_block(lines, at + 1, f"[[ end file {begin.group(1)} ]]") + files.append((begin.group(1), body)) + continue + if ref: + files.append((ref.group(1), shared.get(ref.group(2), ""))) + elif ": " in lines[at]: + key, value = lines[at].split(": ", 1) + fields[key] = value + at += 1 + sections.append(Section(head.group(1), head.group(2), head.group(3), fields.get("Licence", ""), + fields.get("Source", ""), files, fields.get("Note", ""))) + return sections + + +def _previous() -> List[Section]: + if not os.path.isfile(OUT): + return [] + with open(OUT, encoding="utf-8") as handle: + return parse(handle.read()) + + +def generate(offline: bool) -> List[Section]: + closure = python_closure(requirement_roots()) + current = python_sections(closure) + kept = [s for s in _previous() if s.kind == "python" and s.name not in closure] + for section in kept: + print(f"kept from the previous file (not installed here): {section.name} {section.version}", file=sys.stderr) + return [runtime_section(), *current, *kept, *npm_sections(), *crate_sections(offline), ffmpeg_section()] + + +def check() -> List[str]: + if not os.path.isfile(OUT): + return [f"{os.path.relpath(OUT, REPO)} is missing"] + listed = {(s.kind, s.name, s.version) for s in _previous()} + python = {name: version for kind, name, version in listed if kind == "python"} + problems: List[str] = [] + roots = requirement_roots() + for name, pin in roots.items(): + if pin and python.get(name) != pin: + problems.append(f"python {name} {pin} is pinned but the notices list {python.get(name)}") + for name, dist in python_closure(roots).items(): + if name not in python: + problems.append(f"python {name} {dist.version} ships but has no notice") + problems += _compare("npm", {(n, m["version"]) for n, m in npm_production(os.path.join(REPO, "frontend", "package-lock.json"))}, listed) + problems += _compare("crate", set(notices_crates.locked_crates(os.path.join(REPO, "src-tauri"))), listed) + problems += _compare("binary", {("ffmpeg", ffmpeg_section().version)}, listed) + if not any(kind == "runtime" for kind, _name, _version in listed): + problems.append("the Python runtime has no notice") + return problems + + +def _compare(kind: str, expected: Set[Tuple[str, str]], listed: Set[Tuple[str, str, str]]) -> List[str]: + have = {(name, version) for k, name, version in listed if k == kind} + return ([f"{kind} {n} {v} ships but has no notice" for n, v in sorted(expected - have)] + + [f"{kind} {n} {v} has a notice but no longer ships" for n, v in sorted(have - expected)]) + + +def main() -> int: + parser = argparse.ArgumentParser(description="Write or check THIRD-PARTY-NOTICES.txt") + parser.add_argument("--check", action="store_true", help="fail when the file does not cover what ships") + parser.add_argument("--offline", action="store_true", help="pass --offline to cargo metadata") + args = parser.parse_args() + if args.check: + problems = check() + print("\n".join(problems) or "third-party notices cover everything that ships") + return 1 if problems else 0 + text = render(generate(args.offline)) + with open(OUT, "w", encoding="utf-8", newline="\n") as handle: + handle.write(text) + print(f"wrote {os.path.relpath(OUT, REPO)} ({len(text) // 1024} KiB)") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/setup/notices_crates.py b/setup/notices_crates.py new file mode 100644 index 0000000..4aa6873 --- /dev/null +++ b/setup/notices_crates.py @@ -0,0 +1,86 @@ +import glob +import json +import os +import subprocess +import tomllib +from typing import Dict, List, Optional, Tuple + +ROOT_CRATE = "formdam-desktop" +LICENCE_PREFIXES = ("LICENSE", "LICENCE", "COPYING", "NOTICE", "COPYRIGHT", "UNLICENSE", "AUTHORS") +Crate = Tuple[str, str] + + +def locked_crates(tauri_dir: str) -> List[Crate]: + with open(os.path.join(tauri_dir, "Cargo.lock"), "rb") as handle: + packages = tomllib.load(handle)["package"] + versions: Dict[str, List[str]] = {} + for package in packages: + versions.setdefault(package["name"], []).append(package["version"]) + by_key = {(p["name"], p["version"]): p for p in packages} + root = next(p for p in packages if p["name"] == ROOT_CRATE) + seen, queue = set(), [(root["name"], root["version"])] + while queue: + key = queue.pop() + for spec in by_key[key].get("dependencies", []): + dep = _dependency(spec, versions) + if dep not in seen: + seen.add(dep) + queue.append(dep) + return sorted(crate for crate in seen if "source" in by_key[crate]) + + +def _dependency(spec: str, versions: Dict[str, List[str]]) -> Crate: + parts = spec.split(" ") + if len(parts) >= 2: + return parts[0], parts[1] + return parts[0], versions[parts[0]][0] + + +def cargo_metadata(tauri_dir: str, offline: bool) -> Dict[Crate, dict]: + cargo = os.environ.get("CARGO", "cargo") + command = [cargo, "metadata", "--format-version", "1", "--locked"] + (["--offline"] if offline else []) + try: + done = subprocess.run(command, cwd=tauri_dir, capture_output=True, text=True, check=True, timeout=900) + except (OSError, subprocess.SubprocessError): + return {} + return {(p["name"], p["version"]): p for p in json.loads(done.stdout)["packages"]} + + +def _registry_manifest(crate: Crate) -> Optional[str]: + home = os.environ.get("CARGO_HOME", os.path.join(os.path.expanduser("~"), ".cargo")) + found = glob.glob(os.path.join(home, "registry", "src", "*", f"{crate[0]}-{crate[1]}", "Cargo.toml")) + return found[0] if found else None + + +def _from_manifest(path: str) -> dict: + with open(path, "rb") as handle: + package = tomllib.load(handle).get("package", {}) + return {"license": package.get("license"), "license_file": package.get("license-file"), + "repository": package.get("repository"), "manifest_path": path} + + +def describe(crate: Crate, metadata: Dict[Crate, dict]) -> dict: + meta = metadata.get(crate) + if meta is None: + manifest = _registry_manifest(crate) + meta = _from_manifest(manifest) if manifest else {} + folder = os.path.dirname(meta["manifest_path"]) if meta.get("manifest_path") else None + files = _licence_files(folder, meta.get("license_file")) if folder and os.path.isdir(folder) else [] + return { + "licence": meta.get("license") or ("see licence file" if meta.get("license_file") else "unknown here"), + "source": meta.get("repository") or f"https://crates.io/crates/{crate[0]}/{crate[1]}", + "files": files, + "state": "files" if files else ("no-files" if folder and os.path.isdir(folder) else "missing"), + } + + +def _licence_files(folder: str, named: Optional[str]) -> List[Tuple[str, str]]: + names = sorted(name for name in os.listdir(folder) if name.upper().startswith(LICENCE_PREFIXES) + and os.path.isfile(os.path.join(folder, name))) + if named and named not in names and os.path.isfile(os.path.join(folder, named)): + names.append(named) + files = [] + for name in names: + with open(os.path.join(folder, name), "r", encoding="utf-8", errors="replace") as handle: + files.append((name, handle.read())) + return files diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 1abbb61..b46739d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -45,7 +45,8 @@ "binaries/formdam-backend": "formdam-backend", "../LICENSE": "LICENSE", "../NOTICE.md": "NOTICE.md", - "../LICENSES.md": "LICENSES.md" + "../LICENSES.md": "LICENSES.md", + "../THIRD-PARTY-NOTICES.txt": "THIRD-PARTY-NOTICES.txt" } } } From 77c49761809616a97394957108086d17ac46502a Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:03:24 -0500 Subject: [PATCH 26/35] fix: PDF rebuild checks Type 3 glyphs and indexed colour tables 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. --- backend/HASHOUT_LOG.md | 7 +++ backend/app/services/pdfcopy.py | 82 +++++++++++++++++++++++------ backend/tests/test_formats_extra.py | 53 +++++++++++++++++++ 3 files changed, 126 insertions(+), 16 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index c5603d9..eca0a29 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/pdfcopy.py · Type 3 glyphs, indexed colour tables, nothing from the source reused +- refers-to: pdfcopy Copier.glyphs, Copier.indexed, fresh, _child_role; tests/test_formats_extra.py type3_font, indexed_image and their tests +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +A Type 3 font's /CharProcs (read only from a real /Font dictionary) keeps an entry only when it resolves to a stream, which is copied as a content stream (parsed, inline images refused, sniffed); an entry that is anything else refuses the PDF. An /Indexed colour space must have four entries, a highest index that resolves to an integer from 0 to 255 (written as a new number, never as a reference into the source), a base space whose component count is known and a table at least (index + 1) times that long, which is cut to that length, searched and written as a new byte string. No object from the source document reaches the writer unchanged: names, numbers, reals, booleans, null and strings are rebuilt from their values (strings searched on the way), arrays, dictionaries and streams are copied by the copier, and any other kind of object refuses the PDF. + ### setup/notices.py, setup/notices_crates.py, routers/system.py · THIRD-PARTY-NOTICES.txt - refers-to: setup/notices.py (new) requirement_roots, python_closure, python_sections, runtime_section, npm_production, npm_sections, crate_sections, ffmpeg_section, render, parse, generate, check; setup/notices_crates.py (new) locked_crates, cargo_metadata, describe; config.notices_path; routers/system.py /notices; tauri.conf.json bundle.resources; setup/build_macos_app, build_linux_app, build_windows_app.bat --add-data; .github/workflows/ci.yml test job; tests/test_notices.py - kind: feat diff --git a/backend/app/services/pdfcopy.py b/backend/app/services/pdfcopy.py index 6ffab89..27266af 100644 --- a/backend/app/services/pdfcopy.py +++ b/backend/app/services/pdfcopy.py @@ -109,13 +109,13 @@ def copy(self, value: Any, role: Optional[str] = None) -> Any: return self.dictionary(value, role) if isinstance(value, ArrayObject): return self.array(value) - if isinstance(value, (str, bytes)): - sniff(value if isinstance(value, bytes) else value.encode("utf-8", "ignore")) - return value + return fresh(value) def dictionary(self, value: Any, role: Optional[str] = None, skip: FrozenSet[str] = frozenset()) -> Any: from pypdf.generic import DictionaryObject, NameObject + if role == "charprocs": + return self.glyphs(value) allowed = _allowed(value, role) out = DictionaryObject() for key in value: @@ -123,22 +123,53 @@ def dictionary(self, value: Any, role: Optional[str] = None, skip: FrozenSet[str out[NameObject(key)] = self.copy(value.raw_get(key), _child_role(value, key, role)) return out + def glyphs(self, value: Any) -> Any: + from pypdf.generic import DictionaryObject, NameObject, StreamObject + + out = DictionaryObject() + for key in value: + target = value.raw_get(key) + if not isinstance(target.get_object(), StreamObject): + raise refused("a Type 3 font has a glyph that is not a content stream") + out[NameObject(str(key))] = self.copy(target, "content") + return out + def array(self, value: Any) -> Any: - from pypdf.generic import ArrayObject, ByteStringObject, NameObject + from pypdf.generic import ArrayObject, NameObject - if value and value[0] == "/ICCBased": + head = value[0].get_object() if value else None + if head == "/ICCBased": return NameObject(DEVICE_BY_N.get(int(value[1].get_object().get("/N", 3)), "/DeviceRGB")) - if value and value[0] == "/Indexed" and len(value) == 4: - lookup = value[3].get_object() - table = lookup.get_data() if hasattr(lookup, "get_data") else bytes(lookup) - sniff(table) - return ArrayObject([NameObject("/Indexed"), self.copy(value[1]), value[2], ByteStringObject(table)]) + if head == "/Indexed": + return self.indexed(value) return ArrayObject(self.copy(item) for item in value) + def indexed(self, value: Any) -> Any: + from pypdf.generic import ArrayObject, ByteStringObject, NameObject, NumberObject, StreamObject, TextStringObject + + if len(value) != 4: + raise refused("an indexed colour space is malformed") + top = value[2].get_object() + if isinstance(top, bool) or not isinstance(top, int) or not 0 <= int(top) <= 255: + raise refused("an indexed colour space has an impossible size") + comps = _components(value[1]) + lookup = value[3].get_object() + if isinstance(lookup, StreamObject): + table = lookup.get_data() + elif isinstance(lookup, TextStringObject): + table = lookup.original_bytes + else: + table = bytes(lookup) + if comps == 0 or len(table) < (int(top) + 1) * comps: + raise refused("an indexed colour space has a table that does not fit it") + table = table[:(int(top) + 1) * comps] + sniff(table) + return ArrayObject([NameObject("/Indexed"), self.copy(value[1]), NumberObject(int(top)), ByteStringObject(table)]) + def stream(self, value: Any, role: Optional[str]) -> Any: from pypdf.generic import NameObject - if value.get("/Subtype") == "/Image": + if role != "content" and value.get("/Subtype") == "/Image": return self.image(value) if role in FONT_PROGRAMS: data = value.get_data() @@ -212,8 +243,6 @@ def _allowed(value: Any, role: Optional[str]) -> FrozenSet[str]: return IMAGE if role == "form" or value.get("/Subtype") == "/Form": return PATTERN | FORM if "/PatternType" in value else FORM - if role == "charprocs": - return frozenset(value.keys()) kind = value.get("/Type") if kind == "/Font": return FONT @@ -231,10 +260,8 @@ def _allowed(value: Any, role: Optional[str]) -> FrozenSet[str]: def _child_role(value: Any, key: str, role: Optional[str]) -> Optional[str]: if key in FONT_PROGRAMS and value.get("/Type") == "/FontDescriptor": return key - if key == "/CharProcs": + if key == "/CharProcs" and value.get("/Type") == "/Font": return "charprocs" - if role == "charprocs": - return "content" return None @@ -249,6 +276,29 @@ def _components(space: Any) -> int: return COMPONENTS.get(str(space), 0) +def fresh(value: Any) -> Any: + from pypdf.generic import (BooleanObject, ByteStringObject, FloatObject, NameObject, NullObject, NumberObject, + TextStringObject) + + if isinstance(value, BooleanObject): + return BooleanObject(bool(value.value)) + if isinstance(value, NameObject): + return NameObject(str(value)) + if isinstance(value, NumberObject): + return NumberObject(int(value)) + if isinstance(value, FloatObject): + return FloatObject(float(value)) + if isinstance(value, NullObject): + return NullObject() + if isinstance(value, ByteStringObject): + sniff(bytes(value)) + return ByteStringObject(bytes(value)) + if isinstance(value, TextStringObject): + sniff(str(value).encode("utf-8", "ignore")) + return TextStringObject(str(value)) + raise refused("this PDF holds an object formDAM cannot rebuild") + + def filters(value: Any) -> List[str]: found = value.get("/Filter") if found is None: diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index 89b1db3..e220107 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -620,6 +620,59 @@ def font(writer, page): assert set(face) == {"/Type", "/Subtype", "/BaseFont"} and b"harbour" not in clean +def type3_font(writer, page, glyph): + from pypdf.generic import ArrayObject, DictionaryObject, NameObject, NumberObject + + face = DictionaryObject({NameObject("/Type"): NameObject("/Font"), NameObject("/Subtype"): NameObject("/Type3"), + NameObject("/FontBBox"): ArrayObject([NumberObject(0)] * 4), + NameObject("/FontMatrix"): ArrayObject([NumberObject(1)] * 6), + NameObject("/CharProcs"): DictionaryObject({NameObject("/a"): glyph})}) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/Font"): DictionaryObject({NameObject("/T3"): writer._add_object(face)})}) + page[NameObject("/Contents")] = stream_of(writer, b"BT /T3 12 Tf (a) Tj ET") + + +def test_pdf_type3_glyphs_must_be_content_streams(tmp_path): + from pypdf import PdfReader + from pypdf.generic import NameObject, NumberObject + + from app.services import filestrip + + good = pdf_with(tmp_path, lambda w, p: type3_font(w, p, stream_of(w, b"0 0 m 1 1 l S"))) + face = PdfReader(io.BytesIO(filestrip.clean_member("a.pdf", good))).pages[0]["/Resources"]["/Font"]["/T3"].get_object() + assert face["/CharProcs"]["/a"].get_object().get_data() == b"0 0 m 1 1 l S" + for glyph in (NumberObject(7), NameObject("/Nothing")): + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", pdf_with(tmp_path, lambda w, p, g=glyph: type3_font(w, p, g))) + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", pdf_with(tmp_path, lambda w, p: type3_font(w, p, stream_of(w, located_tiff())))) + + +def indexed_image(writer, page, top, table): + from pypdf.generic import ArrayObject, ByteStringObject, DictionaryObject, NameObject, NumberObject + + space = ArrayObject([NameObject("/Indexed"), NameObject("/DeviceRGB"), top, ByteStringObject(table)]) + image = stream_of(writer, bytes([0, 1, 1, 0]), Type=NameObject("/XObject"), Subtype=NameObject("/Image"), + Width=NumberObject(2), Height=NumberObject(2), ColorSpace=space, BitsPerComponent=NumberObject(8)) + page[NameObject("/Resources")] = DictionaryObject({NameObject("/XObject"): DictionaryObject({NameObject("/Im0"): image})}) + page[NameObject("/Contents")] = stream_of(writer, b"q 2 0 0 2 0 0 cm /Im0 Do Q") + + +def test_pdf_indexed_colour_tables_are_checked_and_written_fresh(tmp_path): + from pypdf import PdfReader + from pypdf.generic import IndirectObject, NumberObject + + from app.services import filestrip + + palette = bytes([255, 0, 0, 0, 0, 255]) + good = pdf_with(tmp_path, lambda w, p: indexed_image(w, p, w._add_object(NumberObject(1)), palette)) + image = PdfReader(io.BytesIO(filestrip.clean_member("a.pdf", good))).pages[0]["/Resources"]["/XObject"]["/Im0"].get_object() + space = image["/ColorSpace"] + assert not isinstance(space[2], IndirectObject) and space[2] == 1 and bytes(getattr(space[3], "original_bytes", space[3])) == palette + for top, table in ((NumberObject(300), palette * 200), (NumberObject(-1), palette), (NumberObject(5), palette)): + with pytest.raises(filestrip.LocationRemains): + filestrip.clean_member("a.pdf", pdf_with(tmp_path, lambda w, p, t=top, b=table: indexed_image(w, p, t, b))) + + def test_share_refusal_is_remembered(client, tmp_path, monkeypatch): from app.services import filestrip, gallerysvc From bfe1af8bd30d84f826b3e27e1c9e3397187ba2ff Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:12:00 -0500 Subject: [PATCH 27/35] feat: referenced originals move into the vault when protected 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. --- backend/HASHOUT_LOG.md | 13 +++++ backend/app/routers/library.py | 12 ++-- backend/app/routers/trash.py | 2 + backend/app/services/fsthumbs.py | 59 ++++++++++++++++++++ backend/app/services/vaultrefs.py | 45 +++++++++++++++ backend/app/vaultcrypt.py | 51 ++++++++++++++--- backend/tests/test_vault_referenced.py | 73 +++++++++++++++++++++++++ frontend/HASHOUT_LOG.md | 7 +++ frontend/src/ui/components/dedup.ts | 4 ++ frontend/src/ui/components/grid.ts | 12 +++- frontend/src/ui/components/selectbar.ts | 4 ++ frontend/src/ui/components/vaultmove.ts | 36 ++++++++++++ frontend/src/ui/components/viewer.ts | 5 +- frontend/tests/vaultmove.test.ts | 32 +++++++++++ 14 files changed, 340 insertions(+), 15 deletions(-) create mode 100644 backend/app/services/fsthumbs.py create mode 100644 backend/app/services/vaultrefs.py create mode 100644 backend/tests/test_vault_referenced.py create mode 100644 frontend/src/ui/components/vaultmove.ts create mode 100644 frontend/tests/vaultmove.test.ts diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index eca0a29..4ba64ea 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,18 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### vaultcrypt.py, services/vaultrefs.py, services/fsthumbs.py, routers/library.py, routers/trash.py · referenced originals go into the vault +- refers-to: vaultcrypt _referenced, _protect, _unprotect, release_original; services/vaultrefs (new) sealed_matches, remove_original, restore_path, OriginalKept; services/fsthumbs (new) folder, thumb_file, forget, owner, is_protected; routers/library.py browse_disk, _media_file, disk_thumb; routers/trash.py _purge_row; tests/test_vault_referenced.py +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +Owner decision 2026-11-29. A referenced original (catalogued in place, outside the library folder) that became hidden, deleted or private used to be copied into the library, and that copy was sealed and removed, while the file in its own folder stayed in plain form. Now the file itself is sealed: it is encrypted into the vault exactly as a library original is (same content key, chunks and sealing to the vault or album key), the encrypted copy is decrypted again and its SHA-256 and size compared with the file on disk, and only then is the plain file removed from its folder. If the comparison fails the blob is deleted and nothing is removed; if the removal fails (a read-only volume, a file in use) the vault row and blob are rolled back and the plain file stays. Either way the item is not vaulted, the flag stays set and the sweeper tries again later. vault_items.home_rel keeps the absolute path, and media.referenced stays 1. + +Restoring (unhide, restore from Recently Deleted, leaving a private album) writes the file back to that path when it is free and no other item claims it, recreating its folder if needed; otherwise beside it as "name (restored).ext", then "(restored 2)" and so on, and the item points there. Delete forever of a referenced item gives the file back the same way before the vault copy is dropped, keeping the rule that formDAM never deletes a file it was only pointed at (test_referenced_original_survives_delete_forever); when the vault key is not open (the automatic expiry of Recently Deleted runs locked) the item stays in Recently Deleted until the next unlocked purge. + +The Disk browser respects the vault. A file whose catalogue row (by path, by the library-relative path for files inside the library, or by name and size) is protected is left out of /disk/browse, and /disk/thumb, /disk/file and /disk/meta answer 404 for it, which covers a protected item whose plain file is still there because sealing did not finish. Its cached Disk thumbnails are deleted when it is sealed: fsthumbs names now start with a hash of the path so they can be found, and thumbnails cached under the old names are dropped at the first seal. + +Not handled: items sealed before this change. Their in-place originals were copied into the library and the catalogue forgot the outside path, so those files are still in plain form where they were added and nothing here can find them. + ### services/pdfcopy.py · Type 3 glyphs, indexed colour tables, nothing from the source reused - refers-to: pdfcopy Copier.glyphs, Copier.indexed, fresh, _child_role; tests/test_formats_extra.py type3_font, indexed_image and their tests - kind: fix diff --git a/backend/app/routers/library.py b/backend/app/routers/library.py index dafd40b..1af6e43 100644 --- a/backend/app/routers/library.py +++ b/backend/app/routers/library.py @@ -13,7 +13,7 @@ from .. import jobs, libraries from ..config import cache_dir, library_root, originals_dir from ..db import ex, init_db, q, q1, setting_get, setting_set -from ..services import classify, decode, libraryfs, thumbs +from ..services import classify, decode, fsthumbs, libraryfs, thumbs router = APIRouter() @@ -253,6 +253,8 @@ def browse_disk(path: str = Query("", max_length=4000)): st = entry.stat() except OSError: continue + if fsthumbs.is_protected(entry.path, entry.name, st.st_size): + continue files.append({"name": entry.name, "path": entry.path, "size": st.st_size, "mtime": st.st_mtime, "kind": kind}) for f in files[:2000]: hit = q1("SELECT id FROM media WHERE rel_path=? OR (name=? AND size=?) LIMIT 1", (f["path"], f["name"], f["size"])) @@ -317,6 +319,8 @@ def _media_file(path: str) -> str: full = os.path.abspath(os.path.expanduser(path)) if not os.path.isfile(full) or not classify.media_kind(os.path.basename(full))[0]: raise HTTPException(404, detail="Not a media file") + if fsthumbs.is_protected(full, os.path.basename(full), os.path.getsize(full)): + raise HTTPException(404, detail="Not a media file") return full @@ -324,10 +328,10 @@ def _media_file(path: str) -> str: def disk_thumb(path: str = Query(..., max_length=4000), s: int = Query(384, ge=64, le=2048)): full = _media_file(path) st = os.stat(full) - key = hashlib.sha1(f"{full}|{st.st_mtime}|{st.st_size}|{s}".encode()).hexdigest() - folder = os.path.join(cache_dir(), "fsthumbs") + out = fsthumbs.thumb_file(full, st, s) + folder = os.path.dirname(out) os.makedirs(folder, exist_ok=True) - out = os.path.join(folder, f"{key}.webp") + key = os.path.basename(out)[:-5] if not os.path.isfile(out): kind, _ = classify.media_kind(os.path.basename(full)) img = None diff --git a/backend/app/routers/trash.py b/backend/app/routers/trash.py index bf5b40a..98539ab 100644 --- a/backend/app/routers/trash.py +++ b/backend/app/routers/trash.py @@ -234,6 +234,8 @@ def _purge_row(row) -> bool: os.unlink(path) except OSError: return False + if not vaultcrypt.release_original(row["id"]): + return False vaultcrypt.purge(row["id"]) companion = q1("SELECT * FROM media WHERE live_of=?", (row["id"],)) if "live_of" in keys else None ex("DELETE FROM faces WHERE media_id=?", (row["id"],)) diff --git a/backend/app/services/fsthumbs.py b/backend/app/services/fsthumbs.py new file mode 100644 index 0000000..d057ebc --- /dev/null +++ b/backend/app/services/fsthumbs.py @@ -0,0 +1,59 @@ +import glob +import hashlib +import os +from typing import Optional + +from ..config import cache_dir, originals_dir +from ..db import q1 + + +def folder() -> str: + return os.path.join(cache_dir(), "fsthumbs") + + +def _prefix(full: str) -> str: + return hashlib.sha1(full.encode("utf-8", "surrogateescape")).hexdigest()[:16] + + +def thumb_file(full: str, st: os.stat_result, size: int) -> str: + key = hashlib.sha1(f"{full}|{st.st_mtime}|{st.st_size}|{size}".encode("utf-8", "surrogateescape")).hexdigest() + return os.path.join(folder(), f"{_prefix(full)}_{key}.webp") + + +def forget(full: str) -> None: + base = folder() + stale = glob.glob(os.path.join(glob.escape(base), f"{_prefix(full)}_*")) + stale += [path for path in glob.glob(os.path.join(glob.escape(base), "*")) if "_" not in os.path.basename(path)] + for path in stale: + try: + os.unlink(path) + except OSError: + pass + + +def _inside(full: str, library: str) -> bool: + try: + return os.path.isabs(full) and os.path.commonpath([library, full]) == library + except ValueError: + return False + + +def owner(full: str, name: Optional[str] = None, size: Optional[int] = None): + paths = [full] + library = originals_dir() + if _inside(full, library): + paths.append(os.path.relpath(full, library)) + for path in paths: + row = q1("SELECT * FROM media WHERE rel_path=? LIMIT 1", (path,)) + if row is not None: + return row + if name is not None and size is not None: + return q1("SELECT * FROM media WHERE name=? AND size=? LIMIT 1", (name, size)) + return None + + +def is_protected(full: str, name: Optional[str] = None, size: Optional[int] = None) -> bool: + from .. import vaultcrypt + + row = owner(full, name, size) + return row is not None and vaultcrypt.protected(row) diff --git a/backend/app/services/vaultrefs.py b/backend/app/services/vaultrefs.py new file mode 100644 index 0000000..3272134 --- /dev/null +++ b/backend/app/services/vaultrefs.py @@ -0,0 +1,45 @@ +import hashlib +import os + +CHUNK = 1 << 20 + + +class OriginalKept(RuntimeError): + pass + + +def _file_digest(path: str) -> str: + digest = hashlib.sha256() + with open(path, "rb") as handle: + for block in iter(lambda: handle.read(CHUNK), b""): + digest.update(block) + return digest.hexdigest() + + +def sealed_matches(sealed, src: str) -> bool: + digest = hashlib.sha256() + if sealed.size: + for block in sealed.iter_range(0, sealed.size - 1): + digest.update(block) + return sealed.size == os.path.getsize(src) and digest.hexdigest() == _file_digest(src) + + +def remove_original(src: str) -> None: + try: + os.remove(src) + except OSError as exc: + raise OriginalKept(f"the original at {src} could not be removed: {exc}") from exc + if os.path.exists(src): + raise OriginalKept(f"the original at {src} is still there") + + +def restore_path(original: str, taken) -> str: + if not os.path.exists(original) and not taken(original): + return original + stem, ext = os.path.splitext(original) + for n in range(1, 10000): + label = " (restored)" if n == 1 else f" (restored {n})" + candidate = f"{stem}{label}{ext}" + if not os.path.exists(candidate) and not taken(candidate): + return candidate + raise OriginalKept(f"no free name beside {original}") diff --git a/backend/app/vaultcrypt.py b/backend/app/vaultcrypt.py index aacad54..30e14c8 100644 --- a/backend/app/vaultcrypt.py +++ b/backend/app/vaultcrypt.py @@ -400,14 +400,14 @@ def _flag_webcache() -> None: pass +def _referenced(row) -> bool: + return "referenced" in row.keys() and bool(row["referenced"]) + + def _protect(row, home: str) -> None: - from .services import libraryfs, thumbs + from .services import fsthumbs, libraryfs, thumbs, vaultrefs media_id = row["id"] - if "referenced" in row.keys() and row["referenced"]: - row = libraryfs.consolidate(media_id) - if row is None: - return src = libraryfs.abs_path(row["rel_path"]) if not os.path.isfile(src): return @@ -421,6 +421,9 @@ def _protect(row, home: str) -> None: if made and os.path.isfile(made): _encrypt_file(made, _blob(blob, ".p384" if "_ph." in made or "_card_" in made else ".t384"), ck) _encrypt_file(src, _blob(blob), ck) + if _referenced(row) and not vaultrefs.sealed_matches(Sealed(_blob(blob), ck), src): + _drop(blob) + raise vaultrefs.OriginalKept("the protected copy of a referenced original did not match it") meta = json.dumps({"ocr": row["ocr_text"], "face_state": row["face_state"]}).encode() nonce = os.urandom(12) ex( @@ -428,8 +431,17 @@ def _protect(row, home: str) -> None: (media_id, blob, _seal(ck, _home_pub(home)), home, row["rel_path"], _b64(nonce + AESGCM(ck).encrypt(nonce, meta, META_LABEL)), time.time()), ) + if _referenced(row): + try: + vaultrefs.remove_original(src) + except vaultrefs.OriginalKept: + ex("DELETE FROM vault_items WHERE media_id=?", (media_id,)) + _drop(blob) + raise + else: + _unlink(src) ex("UPDATE media SET ocr_text='', face_state=CASE WHEN face_state=0 THEN 2 ELSE face_state END WHERE id=?", (media_id,)) - _unlink(src) + fsthumbs.forget(src) _scrub(media_id) _flag_webcache() @@ -451,7 +463,15 @@ def _unprotect(row, item) -> None: ck = _open_ck(item) rel = item["home_rel"] dest = libraryfs.abs_path(rel) - if os.path.exists(dest) or q1("SELECT id FROM media WHERE rel_path=? AND id<>?", (rel, media_id)): + + def taken(path: str) -> bool: + return q1("SELECT id FROM media WHERE rel_path=? AND id<>?", (path, media_id)) is not None + + if _referenced(row) and os.path.isabs(rel): + from .services import vaultrefs + + dest = rel = vaultrefs.restore_path(rel, taken) + elif os.path.exists(dest) or taken(rel): dest = libraryfs._dest_for(row["created_ts"], os.path.basename(rel)) rel = os.path.relpath(dest, libraryfs.abs_path("")) os.makedirs(os.path.dirname(dest), exist_ok=True) @@ -522,6 +542,23 @@ def reconcile(media_id: int) -> bool: return ok +def release_original(media_id: int) -> bool: + from .services import vaultrefs + + with _op: + item, row = _item(media_id), q1("SELECT * FROM media WHERE id=?", (media_id,)) + if item is None or row is None or not _referenced(row) or not os.path.isabs(item["home_rel"]): + return True + try: + ck = _open_ck(item) + except Locked: + return False + dest = vaultrefs.restore_path(item["home_rel"], lambda path: False) + os.makedirs(os.path.dirname(dest), exist_ok=True) + Sealed(_blob(item["blob"]), ck).write_to(dest) + return True + + def purge(media_id: int) -> None: with _op: item = _item(media_id) diff --git a/backend/tests/test_vault_referenced.py b/backend/tests/test_vault_referenced.py new file mode 100644 index 0000000..1f7808e --- /dev/null +++ b/backend/tests/test_vault_referenced.py @@ -0,0 +1,73 @@ +import hashlib +import os + +from tests.conftest import HEADERS, pattern, wait_job +from tests.support import sha + + +def referenced_library(client, tmp_path): + src = tmp_path / "outside" + os.makedirs(src) + pattern(320, 240).save(src / "harbour.jpg", "JPEG", quality=90) + created = client.post("/api/import", json={"path": str(src), "reference": True}, headers=HEADERS) + assert wait_job(client, created.json()["job_id"])["phase"] == "done" + item = client.get("/api/media").json()["items"][0] + assert item["referenced"] == 1 + token = client.post("/api/vault/setup", json={"passkey": "harbourkey"}, headers=HEADERS).json()["token"] + return src / "harbour.jpg", item, {**HEADERS, "x-dam-vault": token} + + +def test_hiding_a_referenced_original_moves_it_into_the_vault_and_back(client, tmp_path): + from app import vaultcrypt + + original, item, auth = referenced_library(client, tmp_path) + digest = sha(original) + assert client.get("/api/disk/thumb", params={"path": str(original), "s": 128}, headers=HEADERS).status_code == 200 + assert client.post(f"/api/media/{item['id']}/hide", headers=HEADERS).status_code == 200 + assert not original.exists() and vaultcrypt.is_vaulted(item["id"]) + from app.services import fsthumbs + + assert os.listdir(fsthumbs.folder()) == [] + listed = client.get("/api/disk/browse", params={"path": str(original.parent)}, headers=HEADERS).json() + assert listed["files"] == [] + served = client.get(f"/api/media/{item['id']}/file", headers=auth) + assert served.status_code == 200 and hashlib.sha256(served.content).hexdigest() == digest + assert client.post(f"/api/hidden/{item['id']}/unhide", headers=auth).status_code == 200 + assert original.exists() and sha(original) == digest and not vaultcrypt.is_vaulted(item["id"]) + + +def test_a_restored_original_goes_beside_a_file_that_took_its_place(client, tmp_path): + original, item, auth = referenced_library(client, tmp_path) + digest = sha(original) + client.post(f"/api/media/{item['id']}/trash", headers=HEADERS) + assert not original.exists() + original.write_bytes(b"someone else's file") + assert client.post(f"/api/trash/{item['id']}/restore", headers=auth).status_code == 200 + beside = original.with_name("harbour (restored).jpg") + assert original.read_bytes() == b"someone else's file" and sha(beside) == digest + row = client.get("/api/media").json()["items"][0] + assert row["rel_path"] == str(beside) and row["referenced"] == 1 + + +def test_an_unverified_protected_copy_keeps_the_original_and_hides_it_from_the_disk_browser(client, tmp_path, monkeypatch): + from app import vaultcrypt + from app.services import vaultrefs + + original, item, auth = referenced_library(client, tmp_path) + monkeypatch.setattr(vaultrefs, "sealed_matches", lambda sealed, src: False) + client.post(f"/api/media/{item['id']}/hide", headers=HEADERS) + assert original.exists() and not vaultcrypt.is_vaulted(item["id"]) + assert os.listdir(os.path.join(os.environ["DAM_LIBRARY"], "vault")) == [] + listed = client.get("/api/disk/browse", params={"path": str(original.parent)}, headers=HEADERS).json() + assert listed["files"] == [] + for route in ("/api/disk/thumb", "/api/disk/file"): + assert client.get(route, params={"path": str(original)}, headers=HEADERS).status_code == 404 + + +def test_deleting_a_referenced_original_forever_gives_the_file_back(client, tmp_path): + original, item, auth = referenced_library(client, tmp_path) + digest = sha(original) + client.post(f"/api/media/{item['id']}/trash", headers=HEADERS) + assert not original.exists() + assert client.delete(f"/api/trash/{item['id']}", headers=auth).status_code == 200 + assert sha(original) == digest and client.get("/api/media").json()["items"] == [] diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index e2a10db..129be65 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### ui/components/vaultmove.ts · confirm before an in-place original moves into the vault +- refers-to: vaultmove.ts (new) referencedCount, vaultMoveText, confirmVaultMove; selectbar.ts Hide, Delete, Add to Album (private); grid.ts context Hide and Move to Trash; viewer.ts Hide and Delete; dedup.ts Keep this one and Trash; tests/vaultmove.test.ts +- kind: feat +- logged: after v1.32.4 · 2026-11-29 + +Hiding, deleting or adding to a private album an item that was added in place now moves its original file into the vault (backend HASHOUT, same date). Before any of those actions, when at least one of the items is referenced, a dialog says how many original files live outside the library, that they will be encrypted, checked and then removed from their folders, and that restoring puts them back or beside their old place under a new name. Cancel or closing the dialog does nothing. Items that all live in the library get no dialog, so the usual one-click hide and delete are unchanged. + ### ui/components/notices.ts · Third-party notices in Settings - refers-to: notices.ts (new) thirdPartyNotices; settings.ts App pane, Licences and notices; styles/app.css .settings-notices-text - kind: feat diff --git a/frontend/src/ui/components/dedup.ts b/frontend/src/ui/components/dedup.ts index b270e91..6eea771 100644 --- a/frontend/src/ui/components/dedup.ts +++ b/frontend/src/ui/components/dedup.ts @@ -6,6 +6,7 @@ import { h } from "../dom.js"; import { iconEl } from "../icons.js"; import { toast } from "../toast.js"; import { loadThumb } from "./grid.js"; +import { confirmVaultMove } from "./vaultmove.js"; function cell(item: Media, tag: string | null, sim: number | null): HTMLElement { const img = h("img", { alt: item.name, loading: "lazy" }) as HTMLImageElement; @@ -98,6 +99,8 @@ export function mountDedupPage(host: HTMLElement): () => void { const actions = h("div", { style: "display:flex;gap:6px;margin-top:6px" }); const keepThis = h("button", { class: "btn", type: "button", style: "padding:3px 10px;font-size:11.5px" }, "Keep this one"); keepThis.addEventListener("click", () => void guarded(async () => { + const others = [...new Map([set.keeper, ...set.members].map((member) => [member.id, member])).values()].filter((member) => member.id !== item.id); + if (!(await confirmVaultMove(others.map((member) => member.id), "Deleting the others", others))) return; const res = await api<{ trashed: number }>(`/dedup/sets/${set.id}/resolve`, { method: "POST", body: JSON.stringify({ keep_media_id: item.id }), }); @@ -106,6 +109,7 @@ export function mountDedupPage(host: HTMLElement): () => void { })); const trashOne = h("button", { class: "btn danger", type: "button", style: "padding:3px 10px;font-size:11.5px" }, "Trash"); trashOne.addEventListener("click", () => void guarded(async () => { + if (!(await confirmVaultMove([item.id], "Deleting", [item]))) return; await api(`/dedup/sets/${set.id}/members/${item.id}/trash`, { method: "POST" }); refreshAfterChange(); })); diff --git a/frontend/src/ui/components/grid.ts b/frontend/src/ui/components/grid.ts index 048e1a8..7109173 100644 --- a/frontend/src/ui/components/grid.ts +++ b/frontend/src/ui/components/grid.ts @@ -9,6 +9,7 @@ import { type CtxEntry, openContextMenu } from "../contextmenu.js"; import { attachMarquee } from "../marquee.js"; import { toast } from "../toast.js"; import { addToAlbumFlow } from "./selectbar.js"; +import { confirmVaultMove } from "./vaultmove.js"; import { iconEl } from "../icons.js"; import { kindIcon, kindLabel } from "../../engine/assetkinds.js"; @@ -357,8 +358,15 @@ export function tileFor(item: Media, context: () => number[], selectable = true, ...tileHooks.ctx.flatMap((fn) => fn(live)), { label: "Download", icon: "download", action: () => { const a = h("a", { href: fileUrl(item.id), download: live.name }); a.click(); } }, "sep", - { label: "Hide", icon: "eyeOff", action: async () => { await api(`/media/${item.id}/hide`, { method: "POST" }); dropFromCaches(item.id); toast("Hidden"); } }, - { label: "Move to Trash", icon: "trash", danger: true, action: () => void trashMedia(item.id) }, + { label: "Hide", icon: "eyeOff", action: async () => { + if (!(await confirmVaultMove([item.id], "Hiding"))) return; + await api(`/media/${item.id}/hide`, { method: "POST" }); + dropFromCaches(item.id); + toast("Hidden"); + } }, + { label: "Move to Trash", icon: "trash", danger: true, action: async () => { + if (await confirmVaultMove([item.id], "Deleting")) await trashMedia(item.id); + } }, ]); }); if (item.kind === "audio") tile.append(h("span", { class: "kind-mark", title: "Audio" }, iconEl("audio"))); diff --git a/frontend/src/ui/components/selectbar.ts b/frontend/src/ui/components/selectbar.ts index 730cd6d..48ad3e5 100644 --- a/frontend/src/ui/components/selectbar.ts +++ b/frontend/src/ui/components/selectbar.ts @@ -6,6 +6,7 @@ import { iconEl, type IconName } from "../icons.js"; import { openModal } from "../modal.js"; import { toast } from "../toast.js"; import { unlockAlbumFlow } from "./albums.js"; +import { confirmVaultMove } from "./vaultmove.js"; export interface ContextAction { label: string; @@ -54,6 +55,7 @@ export function mountSelectBar(host: HTMLElement): void { hideBtn.addEventListener("click", async () => { const ids = [...state.selection]; + if (!(await confirmVaultMove(ids, "Hiding"))) return; for (const id of ids) { await api(`/media/${id}/hide`, { method: "POST" }); dropFromCaches(id); @@ -65,6 +67,7 @@ export function mountSelectBar(host: HTMLElement): void { trashBtn.addEventListener("click", async () => { const ids = [...state.selection]; + if (!(await confirmVaultMove(ids, "Deleting"))) return; for (const id of ids) { await api(`/media/${id}/trash`, { method: "POST" }); dropFromCaches(id); @@ -96,6 +99,7 @@ export function addToAlbumFlow(ids: number[], after?: () => void): void { h("div", { class: "list-main" }, h("div", { class: "list-title" }, album.name)), ); row.addEventListener("click", async () => { + if (album.is_private && !(await confirmVaultMove(ids, "Adding to a private album"))) return; const send = async () => api(`/albums/${album.id}/items`, { method: "POST", body: JSON.stringify({ media_ids: ids }) }, album.id); try { diff --git a/frontend/src/ui/components/vaultmove.ts b/frontend/src/ui/components/vaultmove.ts new file mode 100644 index 0000000..a215695 --- /dev/null +++ b/frontend/src/ui/components/vaultmove.ts @@ -0,0 +1,36 @@ +import { state } from "../../engine/store.js"; +import { h } from "../dom.js"; +import { openModal } from "../modal.js"; + +interface Placed { id: number; referenced?: number } + +export function referencedCount(ids: number[], known: Placed[] = []): number { + const given = new Map(known.map((item) => [item.id, item.referenced])); + return ids.filter((id) => (given.has(id) ? given.get(id) : state.byId.get(id)?.referenced)).length; +} + +export function vaultMoveText(count: number, verb: string): string { + const files = count === 1 ? "This item's original file is" : `${count} of these items' original files are`; + const them = count === 1 ? "it" : "them"; + return `${files} kept outside the library, where you added ${them} in place. ${verb} moves ${them} into the vault: ` + + `formDAM encrypts ${them}, checks the encrypted copy and only then removes the plain file from its folder. ` + + `Restoring puts ${them} back where ${count === 1 ? "it was" : "they were"}, or beside that place under a new name if it is taken.`; +} + +export function confirmVaultMove(ids: number[], verb: string, known: Placed[] = []): Promise { + const count = referencedCount(ids, known); + if (count === 0) return Promise.resolve(true); + return new Promise((resolve) => { + let answered = false; + const modal = openModal("Move originals into the vault?", 460, () => { if (!answered) resolve(false); }); + const cancel = h("button", { class: "btn", type: "button" }, "Cancel"); + const go = h("button", { class: "btn primary", type: "button" }, "Move into the Vault"); + cancel.addEventListener("click", () => modal.close()); + go.addEventListener("click", () => { + answered = true; + resolve(true); + modal.close(); + }); + modal.body.append(h("p", { class: "settings-hint" }, vaultMoveText(count, verb)), h("div", { class: "modal-actions" }, cancel, go)); + }); +} diff --git a/frontend/src/ui/components/viewer.ts b/frontend/src/ui/components/viewer.ts index f7a2ff1..59932bf 100644 --- a/frontend/src/ui/components/viewer.ts +++ b/frontend/src/ui/components/viewer.ts @@ -9,6 +9,7 @@ import type { Media } from "../../engine/types.js"; import { h } from "../dom.js"; import { iconEl, iconInto } from "../icons.js"; import { toast } from "../toast.js"; +import { confirmVaultMove } from "./vaultmove.js"; let filmIds: number[] | null = null; let filmTrack: HTMLElement | null = null; @@ -363,7 +364,7 @@ export function mountViewer(host: HTMLElement): void { const hideBtn = h("button", { class: "icon-btn", type: "button", "aria-label": "Hide" }, iconEl("eyeOff")); hideBtn.addEventListener("click", async () => { const id = currentId(); - if (id === null) return; + if (id === null || !(await confirmVaultMove([id], "Hiding"))) return; await api(`/media/${id}/hide`, { method: "POST" }); dropFromCaches(id); toast("Hidden. Find it under Utilities, behind the vault passkey."); @@ -372,7 +373,7 @@ export function mountViewer(host: HTMLElement): void { const trashBtn = h("button", { class: "icon-btn danger", type: "button", "aria-label": "Move to Recently Deleted" }, iconEl("trash")); trashBtn.addEventListener("click", async () => { const id = currentId(); - if (id === null) return; + if (id === null || !(await confirmVaultMove([id], "Deleting"))) return; await trashMedia(id); toast("Moved to Recently Deleted"); dropCurrentAndContinue(id); diff --git a/frontend/tests/vaultmove.test.ts b/frontend/tests/vaultmove.test.ts new file mode 100644 index 0000000..e67cae7 --- /dev/null +++ b/frontend/tests/vaultmove.test.ts @@ -0,0 +1,32 @@ +import { describe, expect, it } from "vitest"; +import { state } from "../src/engine/store.js"; +import type { Media } from "../src/engine/types.js"; +import { confirmVaultMove, referencedCount } from "../src/ui/components/vaultmove.js"; + +describe("moving referenced originals into the vault", () => { + it("counts only items added in place", () => { + state.byId.set(1, { id: 1, referenced: 1 } as Media); + state.byId.set(2, { id: 2, referenced: 0 } as Media); + expect(referencedCount([1, 2, 3])).toBe(1); + expect(referencedCount([2, 3], [{ id: 3, referenced: 1 }])).toBe(1); + expect(referencedCount([1], [{ id: 1, referenced: 0 }])).toBe(0); + }); + + it("asks nothing when no original lives outside the library", async () => { + await expect(confirmVaultMove([2], "Hiding")).resolves.toBe(true); + expect(document.querySelector(".modal-backdrop")).toBeNull(); + }); + + it("asks before moving and treats closing as no", async () => { + const asked = confirmVaultMove([1], "Hiding"); + const dialog = document.querySelector(".modal-backdrop") as HTMLElement; + expect(dialog).not.toBeNull(); + (dialog.querySelector(".btn.primary") as HTMLButtonElement).click(); + await expect(asked).resolves.toBe(true); + const declined = confirmVaultMove([1], "Deleting"); + const second = [...document.querySelectorAll(".modal-backdrop")].pop() as HTMLElement; + (second.querySelector(".btn:not(.primary)") as HTMLButtonElement).click(); + await new Promise((done) => setTimeout(done, 250)); + await expect(declined).resolves.toBe(false); + }); +}); From 16849776425841923d3a25a6a527fa8d5886374a Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:16:15 -0500 Subject: [PATCH 28/35] fix: clear the lint findings on the branch --- backend/app/services/filestrip.py | 2 +- backend/app/services/paletteres.py | 4 ++-- backend/tests/test_documents.py | 2 +- backend/tests/test_models.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index fd47495..c81feec 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -157,7 +157,7 @@ def clean_member(name: str, data: bytes, depth: int = 0, budget: Optional[zipsaf def _json_text(data: bytes) -> bool: head = data[:64].lstrip() - if not head[:1] in (b"{", b"["): + if head[:1] not in (b"{", b"["): return False try: data.decode("utf-8") diff --git a/backend/app/services/paletteres.py b/backend/app/services/paletteres.py index 8e598c3..063a670 100644 --- a/backend/app/services/paletteres.py +++ b/backend/app/services/paletteres.py @@ -12,8 +12,8 @@ class PaletteError(ValueError): pass -def _lab_to_rgb(l: float, a: float, b: float) -> Tuple[int, int, int]: - y = (l + 16) / 116 +def _lab_to_rgb(lightness: float, a: float, b: float) -> Tuple[int, int, int]: + y = (lightness + 16) / 116 x, z = y + a / 500, y - b / 200 def inv(t: float) -> float: diff --git a/backend/tests/test_documents.py b/backend/tests/test_documents.py index 7561501..10060c5 100644 --- a/backend/tests/test_documents.py +++ b/backend/tests/test_documents.py @@ -165,7 +165,7 @@ def test_rtf_text_reader(): def test_huge_workbook_parts_preview_quickly(client, tmp_path): import time - from app.services import assetwork, docres + from app.services import docres shared = "" + "".join(f"string {n}" for n in range(400000)) + "" sheet = ('3' diff --git a/backend/tests/test_models.py b/backend/tests/test_models.py index d4ec9e5..547b579 100644 --- a/backend/tests/test_models.py +++ b/backend/tests/test_models.py @@ -27,7 +27,7 @@ def obj(path): def ply_ascii(path): - head = f"ply\nformat ascii 1.0\nelement vertex 8\nproperty float x\nproperty float y\nproperty float z\nelement face 6\nproperty list uchar int vertex_indices\nend_header\n" + head = "ply\nformat ascii 1.0\nelement vertex 8\nproperty float x\nproperty float y\nproperty float z\nelement face 6\nproperty list uchar int vertex_indices\nend_header\n" path.write_text(head + "\n".join(" ".join(map(str, v)) for v in CUBE_V) + "\n" + "\n".join("4 " + " ".join(map(str, q)) for q in CUBE_QUADS) + "\n") From 22cbbb66ed77c3e2341228499857f7f5bd05a9b4 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:20:22 -0500 Subject: [PATCH 29/35] fix: harden vaulting of referenced originals and waveform decodes 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. --- backend/HASHOUT_LOG.md | 7 +++ backend/app/routers/library.py | 6 ++- backend/app/services/fsthumbs.py | 37 +++++++++---- backend/app/services/vaultrefs.py | 72 ++++++++++++++++++++++--- backend/app/services/waveform.py | 6 +++ backend/app/vaultcrypt.py | 73 ++++++++++++++++++++++---- backend/tests/test_vault_referenced.py | 26 +++++++++ 7 files changed, 197 insertions(+), 30 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 4ba64ea..a542b06 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### vaultcrypt.py, services/vaultrefs.py, services/fsthumbs.py, waveform.py · review fixes for referenced originals and audio +- refers-to: vaultcrypt _protect, _seal_item, _unprotect, _finish_referenced, release_original, _settle, _scrub_vaulted, Sealed.write_to, _encrypt_stream; vaultrefs fsync_dir, stamp, recently_failed, mark_failed, clear_failed, own_sidecar, restore_path (_claim); fsthumbs ProtectedIndex, is_protected; routers/library.py browse_disk, disk_thumb; waveform._ffmpeg_peaks MAX_FOUND and watchdog; tests/test_vault_referenced.py sidecar and give-back tests +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +From the branch review. A sidecar formDAM wrote (x:xmptk="FormDAM") beside an original, referenced or in the library, is sealed with it as .xmp and removed, and written back beside the restored file when no sidecar is there; other apps' sidecars are left alone. The vault folder is fsynced after every blob and restored file is renamed into place, so a referenced original is removed only after its encrypted copy is durable, and the file's mtime and size must be unchanged between sealing and removal. A seal that failed (no match, cannot remove) is not retried until the file changes (per process), and the item's plain caches and Disk thumbnails are scrubbed anyway. If the engine stopped between recording the vault item and removing the original, the next settle with the key open checks the blob against the file and finishes the removal. A restored name is claimed with O_EXCL before the decrypted bytes replace it, so a file created meanwhile is never overwritten, and an empty claim is removed if the write fails. Giving an original back on delete forever never raises: a missing drive, a full disk or a bad chunk keeps the item in Recently Deleted (409), so the startup purge cannot stop the engine. The share, render and effects caches join the start-up sweep of vaulted items. The Disk browser reads the protected rows once per listing instead of querying per file, a path or name and size matching any protected row (not just the first) is left out, and a Disk thumbnail written while its item was being protected is deleted again. The waveform decode has a watchdog that kills ffmpeg after the decode timeout, and the peak buffer halves its resolution (doubling the window) past 200,000 values so a file that lies about its duration cannot grow it without bound. + ### vaultcrypt.py, services/vaultrefs.py, services/fsthumbs.py, routers/library.py, routers/trash.py · referenced originals go into the vault - refers-to: vaultcrypt _referenced, _protect, _unprotect, release_original; services/vaultrefs (new) sealed_matches, remove_original, restore_path, OriginalKept; services/fsthumbs (new) folder, thumb_file, forget, owner, is_protected; routers/library.py browse_disk, _media_file, disk_thumb; routers/trash.py _purge_row; tests/test_vault_referenced.py - kind: fix diff --git a/backend/app/routers/library.py b/backend/app/routers/library.py index 1af6e43..738f3fe 100644 --- a/backend/app/routers/library.py +++ b/backend/app/routers/library.py @@ -236,6 +236,7 @@ def browse_disk(path: str = Query("", max_length=4000)): if not os.path.isdir(target): raise HTTPException(404, detail="That folder does not exist") dirs, files = [], [] + guard = fsthumbs.ProtectedIndex() try: entries = sorted(os.scandir(target), key=lambda e: e.name.lower()) except PermissionError: @@ -253,7 +254,7 @@ def browse_disk(path: str = Query("", max_length=4000)): st = entry.stat() except OSError: continue - if fsthumbs.is_protected(entry.path, entry.name, st.st_size): + if guard.covers(entry.path, entry.name, st.st_size): continue files.append({"name": entry.name, "path": entry.path, "size": st.st_size, "mtime": st.st_mtime, "kind": kind}) for f in files[:2000]: @@ -357,6 +358,9 @@ def disk_thumb(path: str = Query(..., max_length=4000), s: int = Query(384, ge=6 if img is None: raise HTTPException(415, detail="No preview for this file") img.convert("RGB").save(out, "WEBP", quality=80) + if fsthumbs.is_protected(full, os.path.basename(full), st.st_size): + os.unlink(out) + raise HTTPException(404, detail="Not a media file") return FileResponse(out, media_type="image/webp", headers={"Cache-Control": "private, max-age=3600"}) diff --git a/backend/app/services/fsthumbs.py b/backend/app/services/fsthumbs.py index d057ebc..dd07031 100644 --- a/backend/app/services/fsthumbs.py +++ b/backend/app/services/fsthumbs.py @@ -1,10 +1,9 @@ import glob import hashlib import os -from typing import Optional +from typing import Any, List, Optional from ..config import cache_dir, originals_dir -from ..db import q1 def folder() -> str: @@ -38,22 +37,38 @@ def _inside(full: str, library: str) -> bool: return False -def owner(full: str, name: Optional[str] = None, size: Optional[int] = None): +def _rows(full: str, name: Optional[str], size: Optional[int]) -> List[Any]: + from ..db import q + paths = [full] library = originals_dir() if _inside(full, library): paths.append(os.path.relpath(full, library)) - for path in paths: - row = q1("SELECT * FROM media WHERE rel_path=? LIMIT 1", (path,)) - if row is not None: - return row + rows = [row for path in paths for row in q("SELECT * FROM media WHERE rel_path=?", (path,))] if name is not None and size is not None: - return q1("SELECT * FROM media WHERE name=? AND size=? LIMIT 1", (name, size)) - return None + rows += q("SELECT * FROM media WHERE name=? AND size=?", (name, size)) + return rows + + +class ProtectedIndex: + def __init__(self) -> None: + from .. import vaultcrypt + from ..db import q + + library = originals_dir() + self.paths, self.named = set(), set() + for row in q("SELECT * FROM media WHERE hidden=1 OR trashed_ts IS NOT NULL OR private=1 OR live_of IS NOT NULL"): + if not vaultcrypt.protected(row): + continue + rel = row["rel_path"] + self.paths.add(rel if os.path.isabs(rel) else os.path.join(library, rel)) + self.named.add((row["name"], row["size"])) + + def covers(self, full: str, name: str, size: int) -> bool: + return full in self.paths or (name, size) in self.named def is_protected(full: str, name: Optional[str] = None, size: Optional[int] = None) -> bool: from .. import vaultcrypt - row = owner(full, name, size) - return row is not None and vaultcrypt.protected(row) + return any(vaultcrypt.protected(row) for row in _rows(full, name, size)) diff --git a/backend/app/services/vaultrefs.py b/backend/app/services/vaultrefs.py index 3272134..c7d2327 100644 --- a/backend/app/services/vaultrefs.py +++ b/backend/app/services/vaultrefs.py @@ -1,7 +1,11 @@ import hashlib import os +from typing import Callable, Dict, Optional, Tuple CHUNK = 1 << 20 +OWN_SIDECAR = b'x:xmptk="FormDAM"' +Stamp = Tuple[float, int] +_failed: Dict[int, Stamp] = {} class OriginalKept(RuntimeError): @@ -24,6 +28,54 @@ def sealed_matches(sealed, src: str) -> bool: return sealed.size == os.path.getsize(src) and digest.hexdigest() == _file_digest(src) +def stamp(path: str) -> Optional[Stamp]: + try: + st = os.stat(path) + except OSError: + return None + return st.st_mtime, st.st_size + + +def recently_failed(media_id: int, current: Optional[Stamp]) -> bool: + return current is not None and _failed.get(media_id) == current + + +def mark_failed(media_id: int, current: Optional[Stamp]) -> None: + if current is not None: + _failed[media_id] = current + + +def clear_failed(media_id: int) -> None: + _failed.pop(media_id, None) + + +def own_sidecar(src: str) -> Optional[str]: + from . import xmpsvc + + side = xmpsvc.find_sidecar(src) + if side is None: + return None + try: + with open(side, "rb") as handle: + head = handle.read(4096) + except OSError: + return None + return side if OWN_SIDECAR in head else None + + +def fsync_dir(folder: str) -> None: + try: + handle = os.open(folder, os.O_RDONLY) + except OSError: + return + try: + os.fsync(handle) + except OSError: + pass + finally: + os.close(handle) + + def remove_original(src: str) -> None: try: os.remove(src) @@ -33,13 +85,19 @@ def remove_original(src: str) -> None: raise OriginalKept(f"the original at {src} is still there") -def restore_path(original: str, taken) -> str: - if not os.path.exists(original) and not taken(original): - return original +def _claim(path: str) -> bool: + try: + os.close(os.open(path, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o644)) + except FileExistsError: + return False + return True + + +def restore_path(original: str, taken: Callable[[str], bool]) -> str: + os.makedirs(os.path.dirname(original), exist_ok=True) stem, ext = os.path.splitext(original) - for n in range(1, 10000): - label = " (restored)" if n == 1 else f" (restored {n})" - candidate = f"{stem}{label}{ext}" - if not os.path.exists(candidate) and not taken(candidate): + for n in range(10000): + candidate = original if n == 0 else f"{stem}{' (restored)' if n == 1 else f' (restored {n})'}{ext}" + if not taken(candidate) and _claim(candidate): return candidate raise OriginalKept(f"no free name beside {original}") diff --git a/backend/app/services/waveform.py b/backend/app/services/waveform.py index 1271cf7..826d3ed 100644 --- a/backend/app/services/waveform.py +++ b/backend/app/services/waveform.py @@ -16,6 +16,7 @@ WAVE_VER = 1 DECODE_RATE = 8000 READ_CHUNK = 1 << 16 +MAX_FOUND = 200_000 DECODE_TIMEOUT = 600 MIN_DECODED = 0.5 BACKGROUND = (24, 22, 18) @@ -91,6 +92,8 @@ def _ffmpeg_peaks(binary: str, src: Optional[str], data: Optional[bytes], durati found: List[float] = [] total = 0 carry = np.zeros(0, dtype=np.int16) + watchdog = threading.Timer(DECODE_TIMEOUT, proc.kill) + watchdog.start() try: while True: block = proc.stdout.read(READ_CHUNK) @@ -102,11 +105,14 @@ def _ffmpeg_peaks(binary: str, src: Optional[str], data: Optional[bytes], durati whole = (samples.size // window) * window if whole: found.extend(np.abs(samples[:whole].astype(np.int32)).reshape(-1, window).max(axis=1).tolist()) + if len(found) > MAX_FOUND: + found, window = [max(found[i:i + 2]) for i in range(0, len(found), 2)], window * 2 carry = samples[whole:] if carry.size: found.append(float(np.abs(carry.astype(np.int32)).max())) proc.wait(timeout=DECODE_TIMEOUT) finally: + watchdog.cancel() if proc.poll() is None: proc.kill() proc.wait() diff --git a/backend/app/vaultcrypt.py b/backend/app/vaultcrypt.py index 30e14c8..6fb6c57 100644 --- a/backend/app/vaultcrypt.py +++ b/backend/app/vaultcrypt.py @@ -20,6 +20,7 @@ from .config import cache_dir, library_root from .db import connect, ex, q, q1, reset_thread_conn, setting_get, setting_set +from .services.vaultrefs import fsync_dir MAGIC = b"DAMV1\n" HEADER_LEN = 16 @@ -148,6 +149,7 @@ def _encrypt_stream(source, dst: str, ck: bytes) -> None: out.flush() os.fsync(out.fileno()) os.replace(part, dst) + fsync_dir(os.path.dirname(dst)) def _encrypt_file(src: str, dst: str, ck: bytes) -> None: @@ -193,6 +195,7 @@ def write_to(self, dst: str) -> None: out.flush() os.fsync(out.fileno()) os.replace(part, dst) + fsync_dir(os.path.dirname(dst)) def ensure_keypair() -> None: @@ -405,12 +408,31 @@ def _referenced(row) -> bool: def _protect(row, home: str) -> None: - from .services import fsthumbs, libraryfs, thumbs, vaultrefs + from .services import fsthumbs, libraryfs, vaultrefs media_id = row["id"] src = libraryfs.abs_path(row["rel_path"]) if not os.path.isfile(src): return + before = vaultrefs.stamp(src) + if vaultrefs.recently_failed(media_id, before): + _scrub(media_id) + fsthumbs.forget(src) + return + try: + _seal_item(row, home, src, before) + except vaultrefs.OriginalKept: + vaultrefs.mark_failed(media_id, before) + _scrub(media_id) + fsthumbs.forget(src) + raise + vaultrefs.clear_failed(media_id) + + +def _seal_item(row, home: str, src: str, before) -> None: + from .services import fsthumbs, thumbs, vaultrefs + + media_id = row["id"] ck, blob = os.urandom(32), secrets.token_hex(16) for size in thumbs.SIZES: plain = thumbs.thumb_path(media_id, size) @@ -421,7 +443,10 @@ def _protect(row, home: str) -> None: if made and os.path.isfile(made): _encrypt_file(made, _blob(blob, ".p384" if "_ph." in made or "_card_" in made else ".t384"), ck) _encrypt_file(src, _blob(blob), ck) - if _referenced(row) and not vaultrefs.sealed_matches(Sealed(_blob(blob), ck), src): + sidecar = vaultrefs.own_sidecar(src) + if sidecar: + _encrypt_file(sidecar, _blob(blob, ".xmp"), ck) + if _referenced(row) and not (vaultrefs.sealed_matches(Sealed(_blob(blob), ck), src) and vaultrefs.stamp(src) == before): _drop(blob) raise vaultrefs.OriginalKept("the protected copy of a referenced original did not match it") meta = json.dumps({"ocr": row["ocr_text"], "face_state": row["face_state"]}).encode() @@ -440,6 +465,8 @@ def _protect(row, home: str) -> None: raise else: _unlink(src) + if sidecar: + _unlink(sidecar) ex("UPDATE media SET ocr_text='', face_state=CASE WHEN face_state=0 THEN 2 ELSE face_state END WHERE id=?", (media_id,)) fsthumbs.forget(src) _scrub(media_id) @@ -457,7 +484,7 @@ def _open_ck(item) -> bytes: def _unprotect(row, item) -> None: - from .services import libraryfs, thumbs + from .services import libraryfs, thumbs, vaultrefs, xmpsvc media_id = row["id"] ck = _open_ck(item) @@ -468,14 +495,20 @@ def taken(path: str) -> bool: return q1("SELECT id FROM media WHERE rel_path=? AND id<>?", (path, media_id)) is not None if _referenced(row) and os.path.isabs(rel): - from .services import vaultrefs - dest = rel = vaultrefs.restore_path(rel, taken) elif os.path.exists(dest) or taken(rel): dest = libraryfs._dest_for(row["created_ts"], os.path.basename(rel)) rel = os.path.relpath(dest, libraryfs.abs_path("")) os.makedirs(os.path.dirname(dest), exist_ok=True) - Sealed(_blob(item["blob"]), ck).write_to(dest) + try: + Sealed(_blob(item["blob"]), ck).write_to(dest) + except Exception: + if _referenced(row) and os.path.isfile(dest) and os.path.getsize(dest) == 0: + _unlink(dest) + raise + side = _blob(item["blob"], ".xmp") + if os.path.isfile(side) and not os.path.exists(xmpsvc.sidecar_for(dest)): + Sealed(side, ck).write_to(xmpsvc.sidecar_for(dest)) for size in thumbs.SIZES: path = _blob(item["blob"], f".t{size}") if os.path.isfile(path): @@ -490,6 +523,17 @@ def taken(path: str) -> bool: _drop(item["blob"]) +def _finish_referenced(row, item) -> None: + from .services import fsthumbs, vaultrefs + + src = item["home_rel"] + if not vaultrefs.sealed_matches(Sealed(_blob(item["blob"]), _open_ck(item)), src): + return + vaultrefs.remove_original(src) + fsthumbs.forget(src) + _scrub(row["id"]) + + def _reseal(item, home: str) -> None: ck = _open_ck(item) ex("UPDATE vault_items SET sealed=?, home=? WHERE media_id=?", (_seal(ck, _home_pub(home)), home, item["media_id"])) @@ -521,6 +565,8 @@ def _settle(row) -> bool: _unprotect(row, item) elif item is not None and item["home"] != home: _reseal(item, home) + elif item is not None and _referenced(row) and os.path.isabs(item["home_rel"]) and os.path.isfile(item["home_rel"]): + _finish_referenced(row, item) except Locked: return False except Exception as exc: @@ -551,11 +597,16 @@ def release_original(media_id: int) -> bool: return True try: ck = _open_ck(item) - except Locked: + dest = vaultrefs.restore_path(item["home_rel"], lambda path: False) + except Exception as exc: + print(f"vault: item {media_id} original not given back: {exc}", flush=True) + return False + try: + Sealed(_blob(item["blob"]), ck).write_to(dest) + except Exception as exc: + _unlink(dest) + print(f"vault: item {media_id} original not given back: {exc}", flush=True) return False - dest = vaultrefs.restore_path(item["home_rel"], lambda path: False) - os.makedirs(os.path.dirname(dest), exist_ok=True) - Sealed(_blob(item["blob"]), ck).write_to(dest) return True @@ -654,7 +705,7 @@ def _scrub_vaulted() -> None: vaulted = {row["media_id"] for row in q("SELECT media_id FROM vault_items")} if not vaulted: return - for sub in ("thumbs", "listen", "play"): + for sub in ("thumbs", "listen", "play", "share", "render", "effects"): folder = os.path.join(cache_dir(), sub) try: names = os.listdir(folder) diff --git a/backend/tests/test_vault_referenced.py b/backend/tests/test_vault_referenced.py index 1f7808e..40f0200 100644 --- a/backend/tests/test_vault_referenced.py +++ b/backend/tests/test_vault_referenced.py @@ -71,3 +71,29 @@ def test_deleting_a_referenced_original_forever_gives_the_file_back(client, tmp_ assert not original.exists() assert client.delete(f"/api/trash/{item['id']}", headers=auth).status_code == 200 assert sha(original) == digest and client.get("/api/media").json()["items"] == [] + + +def test_a_formdam_sidecar_goes_into_the_vault_with_its_original(client, tmp_path): + original, item, auth = referenced_library(client, tmp_path) + side = original.with_suffix(".xmp") + side.write_text('') + foreign = tmp_path / "outside" / "notes.xmp" + foreign.write_text("") + client.post(f"/api/media/{item['id']}/hide", headers=HEADERS) + assert not side.exists() and foreign.exists() + assert client.post(f"/api/hidden/{item['id']}/unhide", headers=auth).status_code == 200 + assert "GPSLatitude" in side.read_text() + + +def test_a_failed_give_back_keeps_the_item_in_recently_deleted(client, tmp_path, monkeypatch): + from app.services import vaultrefs + + original, item, auth = referenced_library(client, tmp_path) + client.post(f"/api/media/{item['id']}/trash", headers=HEADERS) + + def blocked(path, taken): + raise OSError("the drive is not there") + + monkeypatch.setattr(vaultrefs, "restore_path", blocked) + assert client.delete(f"/api/trash/{item['id']}", headers=auth).status_code == 409 + assert [row["id"] for row in client.get("/api/trash", headers=auth).json()["items"]] == [item["id"]] From ce6a9292d776c3797d46fb755662723d6e8bbe7c Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:28:39 -0500 Subject: [PATCH 30/35] fix: bound file-kind readers and fail closed on odd inputs 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. --- backend/HASHOUT_LOG.md | 7 ++++++ backend/app/routers/assets.py | 21 +++++++++++++---- backend/app/services/assetwork.py | 36 +++++++++++++++++++++++------ backend/app/services/decode.py | 2 ++ backend/app/services/docres.py | 22 ++++++++++++++++-- backend/app/services/filestrip.py | 25 +++++++++++++------- backend/app/services/imagex.py | 27 ++++++++++++++-------- backend/app/services/modelres.py | 22 +++++++++++++++--- backend/app/services/sequences.py | 20 +++++++++++++++- backend/tests/test_formats_extra.py | 14 +++++++---- 10 files changed, 157 insertions(+), 39 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index a542b06..f5934f6 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/assetwork.py, modelres.py, imagex.py, decode.py, sequences.py, filestrip.py, docres.py, routers/assets.py · review fixes for file kinds +- refers-to: assetwork _bounded, _text, process; modelres read_stl, _ply_header, read_ply, STL_VERTEX; imagex STILL_SCALE, gunzip_capped, svg_size, render_svg; decode.open_image DecompressionBombError; sequences RENDER_PAD, _looks_rendered, group, pack date clamp; filestrip _is_zip, strip_file, text_located, JSON_LATLON, EXR_TEXT_SCAN; docres _whole_utf8, delimited, _Zip; routers/assets.py _original_bytes, media_lottie, media_mesh; tests/test_formats_extra.py test_sequence_grouping_rules +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +From the branch review. The preview worker stores what a handler found inside a try: numbers that SQLite cannot bind (a Lottie end frame of 1e300) become NULL, text with lone surrogates (RTF \u escapes) is re-encoded, and a row that still cannot be stored is marked done with an error instead of blocking every later item forever. PLY element counts, face sizes (0 to 4096, inside the file) and face totals, binary STL triangle counts and text STL vertices are capped like the other readers. SVGZ is inflated through zlib with a 64 MiB cap (8 KiB for the size probe), and a truncated stream is a refusal, not an EOFError. ffmpeg stills are scaled to at most 4096 px on each side inside ffmpeg, so a huge EXR data window cannot fill memory through the pipe, and a Pillow DecompressionBombError is no longer retried through ffmpeg. PNG and TIFF frames are grouped into one sequence only when their numbers have at least four digits and every frame has the same size, so scanner output and numbered screenshots import as photos again; EXR and DPX are unchanged. Sequence zips clamp frame dates to 1980-01-01. filestrip treats a file as a zip only when it starts with a zip header (a JPEG with a zip appended is a JPEG), turns any unexpected error into a refusal and removes the partial output, searches UTF-16 at odd offsets as well, finds JSON latitude and longitude keys, and searches EXR header text. CSV with an unclosed quote falls back to plain text, a text preview cut at 32 MiB ends on a whole UTF-8 character, a refused document zip is closed, the Lottie and mesh routes answer 422 or 404 instead of 500 for any malformed file, and a vaulted file above the request read cap is not read whole. + ### vaultcrypt.py, services/vaultrefs.py, services/fsthumbs.py, waveform.py · review fixes for referenced originals and audio - refers-to: vaultcrypt _protect, _seal_item, _unprotect, _finish_referenced, release_original, _settle, _scrub_vaulted, Sealed.write_to, _encrypt_stream; vaultrefs fsync_dir, stamp, recently_failed, mark_failed, clear_failed, own_sidecar, restore_path (_claim); fsthumbs ProtectedIndex, is_protected; routers/library.py browse_disk, disk_thumb; waveform._ffmpeg_peaks MAX_FOUND and watchdog; tests/test_vault_referenced.py sidecar and give-back tests - kind: fix diff --git a/backend/app/routers/assets.py b/backend/app/routers/assets.py index ac220c9..b47faaa 100644 --- a/backend/app/routers/assets.py +++ b/backend/app/routers/assets.py @@ -110,6 +110,8 @@ def _original_bytes(row) -> bytes: sealed = vaultcrypt.opener(row) if sealed is not None: + if sealed.size > assetstore.MAX_READ: + raise HTTPException(404, detail="Original file missing on disk or too large to read here") return sealed.read_all() path = libraryfs.abs_path(row["rel_path"]) data = assetstore.read_capped(path) @@ -127,10 +129,16 @@ def media_lottie(media_id: int, request: Request): from ..services import lottieres row = _resource_row(media_id, request, "lottie") - data, _ = lottieres.load_bytes(_original_bytes(row)) - if data is None: + try: + data, _ = lottieres.load_bytes(_original_bytes(row)) + clean = lottieres.sanitise(data) if data is not None else None + except HTTPException: + raise + except Exception: + clean = None + if clean is None: raise HTTPException(422, detail="No Lottie animation in this file") - return _json_response(lottieres.sanitise(data), must_not_store(row)) + return _json_response(clean, must_not_store(row)) @router.get("/media/{media_id}/cues") @@ -189,7 +197,12 @@ def media_mesh(media_id: int, request: Request): guarded = must_not_store(row) mesh = None if guarded else assetstore.load_json(media_id, "mesh") if mesh is None and guarded and (row["size"] or 0) <= modelres.REQUEST_READ: - mesh = modelres.mesh_from_bytes(_original_bytes(row), (row["subkind"] or "").lower()) + try: + mesh = modelres.mesh_from_bytes(_original_bytes(row), (row["subkind"] or "").lower()) + except HTTPException: + raise + except Exception: + mesh = None if mesh is None: raise HTTPException(404, detail="No viewable mesh for this model") return _json_response(mesh, guarded) diff --git a/backend/app/services/assetwork.py b/backend/app/services/assetwork.py index 34137b5..ccb3b45 100644 --- a/backend/app/services/assetwork.py +++ b/backend/app/services/assetwork.py @@ -8,6 +8,7 @@ from ..db import ex, q, q1, reset_thread_conn from . import assetkinds, assetstore, classify, libraryfs +INT_LIMIT = 2 ** 31 - 1 logger = logging.getLogger(__name__) PENDING, DONE, NONE = 0, 1, 2 @@ -33,21 +34,21 @@ def _clean_text(text: Optional[str]) -> Optional[str]: if text is None: return None flat = " ".join(text.split()) - return flat[:MAX_TEXT] + return _text(flat[:MAX_TEXT]) def _store(row, found: assetkinds.Extract) -> None: media_id = row["id"] sets = ["asset_json=?", "pages=?", "preview_state=?"] - vals: List[Any] = [json.dumps(found.meta, separators=(",", ":"), default=str), found.pages, + vals: List[Any] = [json.dumps(found.meta, separators=(",", ":"), default=str), _bounded(found.pages), DONE if found.preview is not None else NONE] for column, value in (("width", found.width), ("height", found.height), ("duration", found.duration)): if value is not None: sets.append(f"{column}=?") - vals.append(value) + vals.append(_bounded(value)) if found.title and not row["title"]: sets.append("title=?") - vals.append(found.title[:300]) + vals.append(_text(found.title[:300])) if found.text is not None: sets.append("ocr_text=?") vals.append(_clean_text(found.text)) @@ -57,6 +58,22 @@ def _store(row, found: assetkinds.Extract) -> None: ex(f"UPDATE media SET {', '.join(sets)} WHERE id=?", (*vals, media_id)) +def _bounded(value: Any) -> Any: + if value is None: + return None + try: + number = float(value) + except (TypeError, ValueError, OverflowError): + return None + if number != number or not -INT_LIMIT <= number <= INT_LIMIT: + return None + return int(value) if isinstance(value, int) else number + + +def _text(value: str) -> str: + return value.encode("utf-8", "replace").decode("utf-8") + + def process(media_id: int) -> bool: from .. import vaultcrypt @@ -74,9 +91,14 @@ def process(media_id: int) -> bool: found = assetkinds.Extract(meta={"error": "This file could not be read"}) if found.preview is not None and assetstore.save_image(media_id, found.preview) is None: found = assetkinds.Extract(**{**found.__dict__, "preview": None}) - for tag, value in found.extras.items(): - assetstore.save_json(media_id, tag, value) - _store(row, found) + try: + for tag, value in found.extras.items(): + assetstore.save_json(media_id, tag, value) + _store(row, found) + except Exception as exc: + logger.warning("preview for item %s could not be stored: %s", media_id, exc) + ex("UPDATE media SET asset_json=?, preview_state=? WHERE id=?", + (json.dumps({"error": "This file could not be read"}), NONE, media_id)) return True diff --git a/backend/app/services/decode.py b/backend/app/services/decode.py index 136d6b4..d968461 100644 --- a/backend/app/services/decode.py +++ b/backend/app/services/decode.py @@ -110,6 +110,8 @@ def open_image(src: Source, name: str, max_long: Optional[int] = None, develop: if max_long: img.draft("RGB", (max_long * 2, max_long * 2)) img = ImageOps.exif_transpose(img) + except Image.DecompressionBombError: + return None except Exception: img = imagex.ffmpeg_still(src, ext_of(name)) if img is None: diff --git a/backend/app/services/docres.py b/backend/app/services/docres.py index c9f581d..3487f1f 100644 --- a/backend/app/services/docres.py +++ b/backend/app/services/docres.py @@ -51,7 +51,11 @@ class _Zip: def __init__(self, path: str): self.archive = zipfile.ZipFile(path) self.budget = zipsafe.Budget(total_cap=XML_CAP * 4, member_cap=XML_CAP) - self.names = {info.filename: info for info in zipsafe.members(self.archive, self.budget)} + try: + self.names = {info.filename: info for info in zipsafe.members(self.archive, self.budget)} + except Exception: + self.archive.close() + raise def read(self, name: str) -> Optional[str]: from . import safexml @@ -264,9 +268,20 @@ def xlsx(path: str, row: Dict[str, Any]) -> Extract: text=_cap(" ".join(sheets + words)), preview=table_image(_sheet_grid(cells, shown))) +def _whole_utf8(raw: bytes) -> bytes: + cut = len(raw) + while cut > max(0, len(raw) - 4) and raw[cut - 1] & 0xC0 == 0x80: + cut -= 1 + if cut > 0 and raw[cut - 1] >= 0xC0: + cut -= 1 + return raw[:cut] + + def _read_text(path: str) -> str: with open(path, "rb") as handle: raw = handle.read(MAX_PLAIN) + if len(raw) == MAX_PLAIN: + raw = _whole_utf8(raw) for codec in ("utf-8-sig", "utf-16"): try: if codec == "utf-16" and raw[:2] not in (b"\xff\xfe", b"\xfe\xff"): @@ -283,7 +298,10 @@ def delimited(path: str, row: Dict[str, Any]) -> Extract: dialect = csv.Sniffer().sniff(text[:8192], delimiters=",;\t|") except csv.Error: dialect = csv.excel_tab if path.lower().endswith(".tsv") else csv.excel - rows = list(csv.reader(io.StringIO(text), dialect)) + try: + rows = list(csv.reader(io.StringIO(text), dialect)) + except csv.Error: + return plain(path, row) columns = max((len(r) for r in rows), default=0) grid = [r[:TABLE_COLS] + [""] * (TABLE_COLS - len(r[:TABLE_COLS])) for r in rows[:TABLE_ROWS]] meta = {"format": "CSV", "rows": len(rows), "columns": columns, "header": rows[0][:30] if rows else []} diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index c81feec..38bd915 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -19,6 +19,8 @@ MAX_DEPTH = zipsafe.MAX_DEPTH XMP_GPS_VALUE = re.compile(rb"GPS(?:Dest)?(?:Latitude|Longitude)[\"']?\s*(?:=\s*[\"']\s*[^\"'\s]|>\s*[^<\s]|:\s*[\"']?\s*[^\"'\s,}\]])", re.IGNORECASE) +JSON_LATLON = re.compile(rb"[\"'](?:lat|latitude|lon|lng|long|longitude)[\"']\s*:\s*[\"']?\s*-?\d", re.IGNORECASE) +EXR_TEXT_SCAN = 1 << 16 Source = Union[str, bytes] @@ -108,10 +110,14 @@ def raster_located(data: bytes) -> Optional[bool]: def text_located(data: bytes) -> bool: if XMP_GPS_VALUE.search(data): return True - for codec in ("utf-16-le", "utf-16-be"): - wide = data[: len(data) - len(data) % 2].decode(codec, "ignore").encode("utf-8", "ignore") - if XMP_GPS_VALUE.search(wide): - return True + if JSON_LATLON.search(data): + return True + for start in (0, 1): + body = data[start:] + for codec in ("utf-16-le", "utf-16-be"): + wide = body[: len(body) - len(body) % 2].decode(codec, "ignore").encode("utf-8", "ignore") + if XMP_GPS_VALUE.search(wide): + return True return False @@ -125,7 +131,7 @@ def clean_member(name: str, data: bytes, depth: int = 0, budget: Optional[zipsaf return out.getvalue() if ext == ".exr": clean = wipe_exr(data) - if exr_located(clean): + if exr_located(clean) or text_located(clean[:EXR_TEXT_SCAN]): raise LocationRemains(f"{name} still carries a location") return clean if ext == ".dpx": @@ -205,7 +211,8 @@ def strip_zip(src: Source, dest: str) -> None: def _is_zip(src: Source) -> bool: if isinstance(src, (bytes, bytearray)): return bytes(src[:4]) == b"PK\x03\x04" - return zipfile.is_zipfile(src) + with open(src, "rb") as handle: + return handle.read(4) == b"PK\x03\x04" def strip_file(row, src: Source, dest: str) -> None: @@ -230,7 +237,9 @@ def strip_file(row, src: Source, dest: str) -> None: raise LocationRemains("location could not be removed from this file") if row["lat"] is not None and not verified and not (raster and found is False and raster_located(clean) is False): raise LocationRemains("this item has a location and the file cannot be shown to be free of it") - except (LocationRemains, zipfile.BadZipFile, OSError): + except Exception as exc: if os.path.exists(dest): os.remove(dest) - raise + if isinstance(exc, (LocationRemains, OSError)): + raise + raise LocationRemains(f"this file could not be checked for a location ({type(exc).__name__})") from exc diff --git a/backend/app/services/imagex.py b/backend/app/services/imagex.py index 2a7813a..9073cf5 100644 --- a/backend/app/services/imagex.py +++ b/backend/app/services/imagex.py @@ -5,6 +5,7 @@ import struct import subprocess import tempfile +import zlib from typing import Optional, Tuple, Union import numpy as np @@ -22,6 +23,8 @@ DECODE_TIMEOUT = 120 SVG_DEFAULT = 1024 SVG_MAX = 4096 +SVG_INFLATE_CAP = 64 * 1024 * 1024 +STILL_SCALE = "scale=w='min(4096,iw)':h='min(4096,ih)':force_original_aspect_ratio=decrease" PSB_THUMB_IDS = (1036, 1033) SVG_TAG = re.compile(rb"]*>", re.IGNORECASE | re.DOTALL) SVG_ATTR = re.compile(rb'\b(width|height|viewBox)\s*=\s*["\']([^"\']*)["\']', re.IGNORECASE) @@ -99,13 +102,13 @@ def tonemap(linear: np.ndarray) -> Image.Image: def _float_still(src: Source, ext: str) -> Optional[Image.Image]: - data = _run_ffmpeg(["-frames:v", "1", "-f", "image2pipe", "-c:v", "pfm", "-pix_fmt", "gbrpf32le", "pipe:1"], src, ext) + data = _run_ffmpeg(["-frames:v", "1", "-vf", STILL_SCALE, "-f", "image2pipe", "-c:v", "pfm", "-pix_fmt", "gbrpf32le", "pipe:1"], src, ext) pixels = parse_pfm(data) if data else None return tonemap(pixels) if pixels is not None else None def ffmpeg_still(src: Source, ext: str = "") -> Optional[Image.Image]: - data = _run_ffmpeg(["-frames:v", "1", "-f", "image2pipe", "-c:v", "png", "pipe:1"], src, ext) + data = _run_ffmpeg(["-frames:v", "1", "-vf", STILL_SCALE, "-f", "image2pipe", "-c:v", "png", "pipe:1"], src, ext) if not data: return None try: @@ -147,11 +150,9 @@ def psd_thumbnail(data: bytes) -> Optional[Image.Image]: def svg_size(data: bytes) -> Optional[Tuple[int, int]]: head = data[:8192] if head[:2] == b"\x1f\x8b": - import gzip - try: - head = gzip.decompress(data)[:8192] - except OSError: + head = zlib.decompressobj(31).decompress(data, 8192) + except zlib.error: return None tag = SVG_TAG.search(head) if not tag: @@ -235,6 +236,14 @@ def sanitise_svg(data: bytes) -> Optional[bytes]: return ET.tostring(root) +def gunzip_capped(data: bytes, cap: int) -> bytes: + inflater = zlib.decompressobj(31) + plain = inflater.decompress(data, cap + 1) + if len(plain) > cap or inflater.unconsumed_tail: + raise ValueError("this SVGZ expands past the size limit") + return plain + + def render_svg(data: bytes, max_long: Optional[int]) -> Optional[Image.Image]: try: import resvg_py @@ -247,14 +256,12 @@ def render_svg(data: bytes, max_long: Optional[int]) -> Optional[Image.Image]: with tempfile.TemporaryDirectory(prefix="dam-svg-") as empty: try: if data[:2] == b"\x1f\x8b": - import gzip - - data = gzip.decompress(data) + data = gunzip_capped(data, SVG_INFLATE_CAP) safe = sanitise_svg(data) if safe is None: return None png = resvg_py.svg_to_bytes(svg_string=safe.decode("utf-8", "replace"), width=width, resources_dir=empty) - except (ValueError, OSError, UnicodeError) as exc: + except (ValueError, OSError, UnicodeError, zlib.error, EOFError, RecursionError) as exc: logger.info("svg render failed: %s", exc) return None try: diff --git a/backend/app/services/modelres.py b/backend/app/services/modelres.py index c7096ec..038ce85 100644 --- a/backend/app/services/modelres.py +++ b/backend/app/services/modelres.py @@ -27,6 +27,7 @@ MAX_COUNT = 5_000_000 REQUEST_READ = 64 * 1024 * 1024 MAX_FACE_VERTS = 4096 +STL_VERTEX = re.compile(r"vertex\s+([-+0-9.eE]+)\s+([-+0-9.eE]+)\s+([-+0-9.eE]+)") MAX_PRIMITIVES = 4096 MAX_MESHES = 4096 BACKGROUND = (30, 28, 24) @@ -73,11 +74,15 @@ def read_stl(data: bytes) -> Mesh: if len(data) >= 84: count = struct.unpack_from(" MAX_FACES: + raise ModelError("This STL file has more triangles than formDAM previews") rec = np.frombuffer(data, dtype=np.dtype([("n", "<3f4"), ("v", "<9f4"), ("a", " MAX_VERTS: + raise ModelError("This STL file has more triangles than formDAM previews") if not found or len(found) % 3: raise ModelError("No triangles in this STL file") verts = np.array(found, dtype=np.float32) @@ -131,7 +136,10 @@ def _ply_header(data: bytes) -> Tuple[str, List[Tuple[str, int, List[List[str]]] if parts[0] == "format": fmt = parts[1] elif parts[0] == "element": - elements.append((parts[1], int(parts[2]), [])) + count = int(parts[2]) + if not 0 <= count <= MAX_FACES: + raise ModelError("This PLY file is larger than formDAM previews") + elements.append((parts[1], count, [])) elif parts[0] == "property" and elements: elements[-1][2].append(parts[1:]) return fmt, elements, body @@ -147,12 +155,16 @@ def read_ply(data: bytes) -> Mesh: rows = [ln.split() for ln in lines[at:at + count]] at += count if name == "vertex": + if count > MAX_VERTS: + raise ModelError("This PLY file is larger than formDAM previews") keys = [p[-1] for p in props] cols = [keys.index(k) for k in ("x", "y", "z")] verts = np.array([[float(r[c]) for c in cols] for r in rows if len(r) >= 3], dtype=np.float32) elif name == "face": for r in rows: - n = int(r[0]) + n = int(r[0]) if r else 0 + if not 0 <= n <= MAX_FACE_VERTS or len(faces) + n > MAX_FACES: + raise ModelError("This PLY file is larger than formDAM previews") faces.extend(_fan([int(v) for v in r[1:1 + n]])) else: order = "<" if fmt == "binary_little_endian" else ">" @@ -162,6 +174,8 @@ def read_ply(data: bytes) -> Mesh: block = np.frombuffer(data, dtype=dtype, count=count, offset=pos) pos += dtype.itemsize * count if name == "vertex": + if count > MAX_VERTS: + raise ModelError("This PLY file is larger than formDAM previews") verts = np.stack([block["x"], block["y"], block["z"]], axis=1).astype(np.float32) continue if name != "face" or len(props) != 1: @@ -170,6 +184,8 @@ def read_ply(data: bytes) -> Mesh: csize, isize = np.dtype(count_t).itemsize, np.dtype(index_t).itemsize for _ in range(count): n = int(np.frombuffer(data, dtype=count_t, count=1, offset=pos)[0]) + if not 0 <= n <= MAX_FACE_VERTS or pos + csize + n * isize > len(data) or len(faces) + n > MAX_FACES: + raise ModelError("This PLY file is larger than formDAM previews or ends early") idx = np.frombuffer(data, dtype=index_t, count=n, offset=pos + csize).tolist() pos += csize + n * isize faces.extend(_fan(idx)) diff --git a/backend/app/services/sequences.py b/backend/app/services/sequences.py index 33e36db..a23817b 100644 --- a/backend/app/services/sequences.py +++ b/backend/app/services/sequences.py @@ -16,6 +16,7 @@ FRAME_NAME = re.compile(r"^(?P.*?)(?P\d+)\.(?P[A-Za-z0-9]+)$") MIN_FRAMES = {"exr": 2, "dpx": 2, "png": 10, "tif": 10, "tiff": 10} DEFAULT_RATE = 24.0 +RENDER_PAD = 4 SEQUENCE_MIME = "application/zip" EXR_MAGIC = b"\x76\x2f\x31\x01" EXR_HEADER_CAP = 1 << 16 @@ -52,6 +53,21 @@ def _accepts(ext: str, numbers: Sequence[int]) -> bool: return numbers[-1] - numbers[0] + 1 == len(numbers) +def _looks_rendered(pad: int, frames: Sequence[str]) -> bool: + if pad < RENDER_PAD: + return False + sizes = set() + for path in frames: + try: + with Image.open(path) as img: + sizes.add(img.size) + except Exception: + return False + if len(sizes) > 1: + return False + return True + + def group(folder: str, names: Sequence[str]) -> Tuple[List[FrameSequence], List[str]]: buckets: Dict[Tuple[str, str, int], List[Tuple[int, str]]] = {} for name in names: @@ -69,6 +85,8 @@ def group(folder: str, names: Sequence[str]) -> Tuple[List[FrameSequence], List[ if len(set(numbers)) != len(numbers) or not _accepts(ext, numbers): continue frames = tuple(os.path.join(folder, n) for _, n in members) + if ext not in ("exr", "dpx") and not _looks_rendered(pad, frames): + continue found.append(FrameSequence(folder, prefix, ext, pad, frames, numbers)) used.update(n for _, n in members) return found, [n for n in names if n not in used] @@ -78,7 +96,7 @@ def pack(seq: FrameSequence, dest_dir: str) -> str: target = os.path.join(dest_dir, seq.label()) with zipfile.ZipFile(target, "w", compression=zipfile.ZIP_STORED, allowZip64=True) as archive: for path in seq.frames: - stamp = time.localtime(max(os.path.getmtime(path), 315532800))[:6] + stamp = max(time.localtime(os.path.getmtime(path))[:6], (1980, 1, 1, 0, 0, 0)) info = zipfile.ZipInfo(os.path.basename(path), date_time=stamp) info.compress_type = zipfile.ZIP_STORED with open(path, "rb") as src, archive.open(info, "w", force_zip64=True) as out: diff --git a/backend/tests/test_formats_extra.py b/backend/tests/test_formats_extra.py index e220107..0172571 100644 --- a/backend/tests/test_formats_extra.py +++ b/backend/tests/test_formats_extra.py @@ -156,17 +156,23 @@ def png_frames(folder, count, start=1001, size=(24, 16), color=(10, 200, 10)): Image.new("RGB", size, color).save(folder / f"shot_{n:04d}.png") -def test_sequence_grouping_rules(): +def test_sequence_grouping_rules(tmp_path): from app.services import sequences names = [f"render.{n:04d}.exr" for n in (1, 2, 5)] + [f"IMG_{n}.png" for n in (1, 2, 3)] + ["notes.txt"] groups, singles = sequences.group("/f", names) assert len(groups) == 1 and groups[0].numbers == (1, 2, 5) and groups[0].label() == "render.[0001-0005].exr.zip" assert sorted(singles) == ["IMG_1.png", "IMG_2.png", "IMG_3.png", "notes.txt"] - groups, _ = sequences.group("/f", [f"f{n:03d}.png" for n in range(1, 13)]) + for n in range(1, 13): + Image.new("RGB", (8, 6)).save(tmp_path / f"f{n:04d}.png") + Image.new("RGB", (8, 6)).save(tmp_path / f"scan{n:03d}.png") + Image.new("RGB", (8, 6 + n % 2)).save(tmp_path / f"mixed{n:04d}.png") + frames = [f"f{n:04d}.png" for n in range(1, 13)] + groups, _ = sequences.group(str(tmp_path), frames) assert len(groups) == 1 and groups[0].first == 1 and groups[0].last == 12 - groups, _ = sequences.group("/f", [f"f{n:03d}.png" for n in range(1, 13) if n != 6]) - assert groups == [] + assert sequences.group(str(tmp_path), [f for f in frames if f != "f0006.png"])[0] == [] + assert sequences.group(str(tmp_path), [f"scan{n:03d}.png" for n in range(1, 13)])[0] == [] + assert sequences.group(str(tmp_path), [f"mixed{n:04d}.png" for n in range(1, 13)])[0] == [] @needs_ffmpeg From cb315dc992f71b7352bc968adfe4a4f12fcb26ad Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:29:01 -0500 Subject: [PATCH 31/35] fix: asset bodies keep their size and players stay out of the way 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. --- LICENSES.md | 2 +- README.md | 2 +- backend/HASHOUT_LOG.md | 2 +- frontend/HASHOUT_LOG.md | 7 ++++ frontend/src/engine/assetkinds.ts | 4 +- frontend/src/styles/assets.css | 16 ++++---- frontend/src/styles/audio.css | 1 - frontend/src/ui/components/assetbodies.ts | 46 ++++++++++++++++++----- frontend/src/ui/components/audioplayer.ts | 7 +++- frontend/src/ui/components/editor.ts | 2 +- frontend/src/ui/components/importer.ts | 1 + frontend/src/ui/components/trim.ts | 21 ++++++++++- frontend/src/ui/components/vaultmove.ts | 6 ++- frontend/tests/vaultmove.test.ts | 3 +- setup/notices.py | 17 +++++++-- 15 files changed, 105 insertions(+), 32 deletions(-) diff --git a/LICENSES.md b/LICENSES.md index 8d97c41..b4e9179 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -1,6 +1,6 @@ # formDAM license ledger -formDAM itself is Apache-2.0, copyright 2026 NodeAgentc, Inc. (see LICENSE and NOTICE.md; MIT until v1.27.5). Every dependency & binary that enters the tree is classified here before use, per dev-rules licensing policy. The full licence texts of everything shipped are in THIRD-PARTY-NOTICES.txt, written and checked by `setup/notices.py`. Runtime web deps are also tabled in README.md. +formDAM itself is Apache-2.0, copyright 2026 NodeAgentc, Inc. (see LICENSE and NOTICE.md; MIT until v1.27.5). Every dependency & binary that enters the tree is classified here before use, per dev-rules licensing policy. The full licence texts of everything shipped are in THIRD-PARTY-NOTICES.txt, written and checked by `setup/notices.py`. ## Adobe DNG patent licence diff --git a/README.md b/README.md index ca09263..86c8f62 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ Code owners are set in [`.github/CODEOWNERS`](.github/CODEOWNERS). ## License -FormDAM is licensed under the Apache License 2.0 ([`LICENSE`](LICENSE), SPDX `Apache-2.0`). Copyright 2026 NodeAgentc, Inc. Third-party notices: [`NOTICE.md`](NOTICE.md), [`LICENSES.md`](LICENSES.md). FormDAM was MIT licensed up to v1.27.5. +FormDAM is licensed under the Apache License 2.0 ([`LICENSE`](LICENSE), SPDX `Apache-2.0`). Copyright 2026 NodeAgentc, Inc. Third-party notices: [`NOTICE.md`](NOTICE.md), [`LICENSES.md`](LICENSES.md) (what each component is and why) and [`THIRD-PARTY-NOTICES.txt`](THIRD-PARTY-NOTICES.txt) (their full licence texts). FormDAM was MIT licensed up to v1.27.5. This product includes DNG technology under license by Adobe Systems Incorporated. Adobe, Bridge, Lightroom and Photoshop are trademarks of Adobe, and Apple and Photos are trademarks of Apple Inc. FormDAM is an independent project and is not affiliated with or endorsed by them; the names describe file formats and compatibility only. diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index f5934f6..3ab3afe 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -39,7 +39,7 @@ A Type 3 font's /CharProcs (read only from a real /Font dictionary) keeps an ent - kind: feat - logged: after v1.32.4 · 2026-11-29 -LICENSES.md says what each component is and why it is there; THIRD-PARTY-NOTICES.txt at the repository root now holds the full licence texts (copyright lines, conditions and disclaimers) of what ships. `python3 setup/notices.py` writes it from four sources. Python: the names in requirements.txt and requirements_macos.txt and everything they require (markers evaluated with packaging when it is installed, extras left out), each with every licence, copying, notice or authors file its installed distribution lists, the files under a licenses folder included (pypdfium2 and opencv carry their bundled libraries' texts that way), plus the interpreter's own LICENSE.txt for the frozen runtime. A requirement not installed where the file is written keeps its section from the previous file and is named on stderr, so writing it on Linux does not drop the macOS-only packages. JavaScript: the packages package-lock.json does not mark dev, with the licence files from node_modules (npm ci first). Rust: every crate Cargo.lock reaches from formdam-desktop, which is all three platforms and the build dependencies, with the licence, repository and source folder from `cargo metadata --locked` (CARGO and CARGO_HOME are honoured; --offline passes --offline) or, when cargo cannot answer, from the crate's Cargo.toml in the registry cache; a crate whose package carries no licence file, or whose source is not in the cache, is listed with its SPDX licence and repository and a note saying which. Binaries: the ffmpeg build the engine downloads is referenced by its formai-binaries release, which carries its own notices, the LGPL-2.1 text and the source. Identical texts (the Apache-2.0 text most crates carry) are printed once at the end and referred to by number. Written twice in the same environment the file is byte-identical. +LICENSES.md says what each component is and why it is there; THIRD-PARTY-NOTICES.txt at the repository root now holds the full licence texts (copyright lines, conditions and disclaimers) of what ships. `python3 setup/notices.py` writes it from four sources. Python: the names in requirements.txt and requirements_macos.txt and everything they require (markers evaluated with packaging for macOS, Linux and Windows at Python 3.12 and the union taken, extras left out; a requirement no install here provides is named on stderr), each with every licence, copying, notice or authors file its installed distribution lists, the files under a licenses folder included (pypdfium2 and opencv carry their bundled libraries' texts that way), plus the interpreter's own LICENSE.txt for the frozen runtime. A requirement not installed where the file is written keeps its section from the previous file and is named on stderr, so writing it on Linux does not drop the macOS-only packages. JavaScript: the packages package-lock.json does not mark dev, with the licence files from node_modules (npm ci first). Rust: every crate Cargo.lock reaches from formdam-desktop, which is all three platforms and the build dependencies, with the licence, repository and source folder from `cargo metadata --locked` (CARGO and CARGO_HOME are honoured; --offline passes --offline) or, when cargo cannot answer, from the crate's Cargo.toml in the registry cache; a crate whose package carries no licence file, or whose source is not in the cache, is listed with its SPDX licence and repository and a note saying which. Binaries: the ffmpeg build the engine downloads is referenced by its formai-binaries release, which carries its own notices, the LGPL-2.1 text and the source. Identical texts (the Apache-2.0 text most crates carry) are printed once at the end and referred to by number. Written twice in the same environment the file is byte-identical. `python3 setup/notices.py --check` (CI, in the test job after the frontend tests) fails when a pinned requirement's version differs from the listed one, an installed shipped Python package has no section, the npm or crate list differs from the lock files in either direction, or the ffmpeg release differs from ffmpeg_record.RELEASE. It needs no cargo and no network. Unpinned Python packages are checked by name only, so a new numpy release does not fail CI; regenerate before a release. The script turns off bytecode writing so it leaves no __pycache__ in setup/, which test_build_tree_clean reads. diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 129be65..87bdd9d 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### ui/components/assetbodies.ts, audioplayer.ts, trim.ts, vaultmove.ts, importer.ts · review fixes for the window +- refers-to: styles/assets.css .asset-preview, .asset-font, .asset-cues, .asset-excerpt, .asset-model, .asset-turntable, .swatch-chip; styles/audio.css .no-wave; assetbodies.ts meshInk, rgbOf, drawMesh, modelBody, captionBody, lottieBody; audioplayer.ts key, wave drag; trim.ts trimSurface, openTrim, done; editor.ts paste-edits shortcut; vaultmove.ts referencedCount; importer.ts mediaFiles; engine/assetkinds.ts assetFacts +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +From the branch review. The asset panel is centred, so every body that filled in late moved the head and buttons; each body now has its height from the start (previews, PDF pages and the model box 56vh, the font box 40vh with its fallback image inside it, cues 50vh, the excerpt 56vh), and an audio track keeps its height when the waveform cannot be fetched. The turntable reads its ground and face colours from --glass-bg-2 and --text, the swatch rim uses --glass-border and the wave colours fall back to the text colour. Mesh, cue and Lottie fetches carry the body's abort signal, and drags end on pointercancel as well as pointerup. The viewer's audio keys do nothing while a dialog or an editor (Trim included) is open, Trim pauses whatever was playing and releases its video when it closes, a failed Trim save shows an error, and the paste-edits shortcut is off during Trim. The vault-move confirm counts an item it has not loaded as referenced, so it asks rather than moving silently. Dropped dotfiles, Office lock files and desktop.ini are skipped, and assetFacts builds its rows without pushing into the handler's array. + ### ui/components/vaultmove.ts · confirm before an in-place original moves into the vault - refers-to: vaultmove.ts (new) referencedCount, vaultMoveText, confirmVaultMove; selectbar.ts Hide, Delete, Add to Album (private); grid.ts context Hide and Move to Trash; viewer.ts Hide and Delete; dedup.ts Keep this one and Trash; tests/vaultmove.test.ts - kind: feat diff --git a/frontend/src/engine/assetkinds.ts b/frontend/src/engine/assetkinds.ts index f4673cb..471a4cb 100644 --- a/frontend/src/engine/assetkinds.ts +++ b/frontend/src/engine/assetkinds.ts @@ -222,7 +222,7 @@ const FACTS: Readonly FactRow[]>> = { export function assetFacts(item: Pick): FactRow[] { const facts = item.asset ?? {}; const key = item.subkind && FACTS[`${item.kind}:${item.subkind}`] ? `${item.kind}:${item.subkind}` : item.kind; - const rows = FACTS[key]?.(facts) ?? []; - if (typeof facts.error === "string") rows.push(["Note", facts.error]); + const base = FACTS[key]?.(facts) ?? []; + const rows: FactRow[] = typeof facts.error === "string" ? [...base, ["Note", facts.error]] : base; return rows.filter(([, value]) => value !== ""); } diff --git a/frontend/src/styles/assets.css b/frontend/src/styles/assets.css index b726937..3cc36cc 100644 --- a/frontend/src/styles/assets.css +++ b/frontend/src/styles/assets.css @@ -6,7 +6,7 @@ .asset-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .asset-title { font-size: 17px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .asset-sub { font-size: 13px; color: var(--text-muted); } -.asset-preview { width: 100%; max-height: 56vh; object-fit: contain; border-radius: 10px; background: var(--glass-bg-2); } +.asset-preview { width: 100%; height: 56vh; object-fit: contain; border-radius: 10px; background: var(--glass-bg-2); } .asset-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-3); font-size: 13px; } .asset-fact { display: contents; } .asset-fact-k { color: var(--text-faint); } @@ -17,24 +17,26 @@ .asset-facts { grid-template-columns: 1fr; } } .asset-input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--glass-border, transparent); background: var(--glass-bg-2); color: var(--text); font: inherit; } -.asset-font { display: flex; flex-direction: column; gap: var(--space-2); overflow: hidden; } +.asset-font { display: flex; flex-direction: column; gap: var(--space-2); overflow: hidden; height: 40vh; } +.asset-font .asset-preview { height: 100%; min-height: 0; flex: 1; } .font-line { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; } .asset-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-2); max-height: 50vh; overflow: auto; } .swatch { display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 0; } -.swatch-chip { height: 56px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25); } +.swatch-chip { height: 56px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--glass-border); } .swatch-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .swatch-hex { color: var(--text-faint); font-variant-numeric: tabular-nums; } -.asset-cues { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; font-size: 13px; } +.asset-cues { display: flex; flex-direction: column; gap: 6px; height: 50vh; overflow: auto; font-size: 13px; } .cue { display: grid; grid-template-columns: 9em 1fr; gap: var(--space-2); } .cue-at { color: var(--text-faint); font-variant-numeric: tabular-nums; } .cue-text { color: var(--text); white-space: pre-wrap; } .asset-pages { display: flex; flex-direction: column; gap: var(--space-2); align-items: center; } .asset-pager { display: flex; align-items: center; gap: var(--space-3); } .asset-doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); } -.asset-excerpt { max-height: 56vh; overflow: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--text); padding: var(--space-2); border-radius: 8px; background: var(--glass-bg-2); } +.asset-excerpt { height: 56vh; overflow: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--text); padding: var(--space-2); border-radius: 8px; background: var(--glass-bg-2); } @media (max-width: 720px) { .asset-doc { grid-template-columns: 1fr; } } -.asset-model { display: flex; justify-content: center; } -.asset-turntable { width: 100%; max-height: 56vh; aspect-ratio: 3 / 2; border-radius: 10px; cursor: grab; touch-action: none; } +.asset-model { display: flex; justify-content: center; align-items: center; height: 56vh; } +.asset-model .asset-preview { height: 100%; } +.asset-turntable { max-width: 100%; height: 100%; aspect-ratio: 3 / 2; border-radius: 10px; cursor: grab; touch-action: none; } .asset-lottie { width: 100%; height: 56vh; border-radius: 10px; background: var(--glass-bg-2); } @media (max-width: 560px) { .cue { grid-template-columns: 1fr; } diff --git a/frontend/src/styles/audio.css b/frontend/src/styles/audio.css index 6d6d848..82e09c1 100644 --- a/frontend/src/styles/audio.css +++ b/frontend/src/styles/audio.css @@ -16,7 +16,6 @@ .wave-track { position: relative; height: 120px; cursor: pointer; border-radius: 8px; touch-action: none; } .wave-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .wave-canvas { width: 100%; height: 100%; display: block; } -.audio-player.no-wave .wave-track { height: 32px; } .audio-controls { display: flex; align-items: center; gap: var(--space-2); } .audio-clock { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; } .audio-volume { width: 110px; accent-color: var(--accent); } diff --git a/frontend/src/ui/components/assetbodies.ts b/frontend/src/ui/components/assetbodies.ts index e753a87..7621680 100644 --- a/frontend/src/ui/components/assetbodies.ts +++ b/frontend/src/ui/components/assetbodies.ts @@ -32,7 +32,7 @@ function paletteBody(item: Media): HTMLElement { function captionBody(item: Media, signal: AbortSignal): HTMLElement { const listBox = h("div", { class: "asset-cues" }, h("div", { class: "asset-sub" }, "Loading cues...")); - void api<{ cues: Array<{ start: number; end: number; text: string }> }>(`/media/${item.id}/cues`).then((body) => { + void api<{ cues: Array<{ start: number; end: number; text: string }> }>(`/media/${item.id}/cues`, { signal }).then((body) => { if (signal.aborted) return; listBox.replaceChildren(...body.cues.slice(0, 2000).map((cue) => h("div", { class: "cue" }, h("span", { class: "cue-at" }, `${clockLabel(cue.start)} to ${clockLabel(cue.end)}`), @@ -45,7 +45,7 @@ function lottieBody(item: Media, signal: AbortSignal): HTMLElement { const stage = h("div", { class: "asset-lottie" }); void Promise.all([ import("lottie-web/build/player/lottie_light"), - api>(`/media/${item.id}/lottie`), + api>(`/media/${item.id}/lottie`, { signal }), ]).then(([mod, data]) => { if (signal.aborted) return; const anim = mod.default.loadAnimation({ container: stage, renderer: "svg", loop: true, autoplay: true, animationData: data }); @@ -83,11 +83,31 @@ function excerptBody(item: Media): HTMLElement { interface ViewerMesh { positions: number[]; indices: number[]; points: boolean } -function drawMesh(canvas: HTMLCanvasElement, mesh: ViewerMesh, yaw: number, pitch: number): void { +interface MeshInk { ground: string; face: [number, number, number] } + +function rgbOf(ctx: CanvasRenderingContext2D, color: string): [number, number, number] { + ctx.fillStyle = color; + const value = String(ctx.fillStyle); + if (value.startsWith("#") && value.length === 7) { + return [parseInt(value.slice(1, 3), 16), parseInt(value.slice(3, 5), 16), parseInt(value.slice(5, 7), 16)]; + } + const parts = value.match(/[\d.]+/g) ?? ["214", "204", "186"]; + return [Number(parts[0]), Number(parts[1]), Number(parts[2])]; +} + +function meshInk(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D): MeshInk { + const style = getComputedStyle(canvas); + const ground = style.getPropertyValue("--glass-bg-2").trim() || style.backgroundColor; + return { ground, face: rgbOf(ctx, style.getPropertyValue("--text").trim() || style.color) }; +} + +function drawMesh(canvas: HTMLCanvasElement, mesh: ViewerMesh, yaw: number, pitch: number, ink: MeshInk): void { const ctx = canvas.getContext("2d"); if (!ctx) return; const w = canvas.width, hgt = canvas.height, scale = Math.min(w, hgt) * 0.8; - ctx.fillStyle = "#1e1c18"; + const [fr, fg, fb] = ink.face; + ctx.clearRect(0, 0, w, hgt); + ctx.fillStyle = ink.ground; ctx.fillRect(0, 0, w, hgt); const p = mesh.positions; const proj: Array<[number, number, number]> = []; @@ -95,7 +115,7 @@ function drawMesh(canvas: HTMLCanvasElement, mesh: ViewerMesh, yaw: number, pitc const sx = (v: [number, number, number]) => w / 2 + v[0] * scale; const sy = (v: [number, number, number]) => hgt / 2 - v[1] * scale; if (mesh.points || mesh.indices.length === 0) { - ctx.fillStyle = "#d6ccba"; + ctx.fillStyle = `rgb(${fr}, ${fg}, ${fb})`; for (const v of proj) ctx.fillRect(sx(v), sy(v), 1.5, 1.5); return; } @@ -112,7 +132,7 @@ function drawMesh(canvas: HTMLCanvasElement, mesh: ViewerMesh, yaw: number, pitc const nx = uy * vz - uz * vy, ny = uz * vx - ux * vz, nz = ux * vy - uy * vx; const len = Math.hypot(nx, ny, nz) || 1; const shade = 0.28 + 0.72 * Math.abs((nx * 0.35 + ny * 0.55 + nz * 0.76) / len); - ctx.fillStyle = `rgb(${Math.round(214 * shade)}, ${Math.round(204 * shade)}, ${Math.round(186 * shade)})`; + ctx.fillStyle = `rgb(${Math.round(fr * shade)}, ${Math.round(fg * shade)}, ${Math.round(fb * shade)})`; ctx.beginPath(); ctx.moveTo(sx(A), sy(A)); ctx.lineTo(sx(B), sy(B)); @@ -127,13 +147,15 @@ function modelBody(item: Media, signal: AbortSignal): HTMLElement { const still = h("img", { class: "asset-preview", alt: item.name, src: thumbUrl(item.id, 768), draggable: "false" }); const box = h("div", { class: "asset-model" }, still); let yaw = 0.62, pitch = 0.42, spinning = true, frame = 0; - void api(`/media/${item.id}/mesh`).then((mesh) => { + void api(`/media/${item.id}/mesh`, { signal }).then((mesh) => { if (signal.aborted) return; box.replaceChildren(canvas); + const ctx = canvas.getContext("2d"); + const ink = ctx ? meshInk(canvas, ctx) : { ground: "transparent", face: [214, 204, 186] as [number, number, number] }; const tick = () => { if (signal.aborted) return; if (spinning) yaw += 0.01; - drawMesh(canvas, mesh, yaw, pitch); + drawMesh(canvas, mesh, yaw, pitch, ink); frame = requestAnimationFrame(tick); }; tick(); @@ -145,8 +167,14 @@ function modelBody(item: Media, signal: AbortSignal): HTMLElement { yaw = y0 + (ev.clientX - startX) / 150; pitch = Math.max(-1.5, Math.min(1.5, p0 + (ev.clientY - startY) / 150)); }; + const end = () => { + canvas.removeEventListener("pointermove", move); + canvas.removeEventListener("pointerup", end); + canvas.removeEventListener("pointercancel", end); + }; canvas.addEventListener("pointermove", move, { signal }); - canvas.addEventListener("pointerup", () => canvas.removeEventListener("pointermove", move), { once: true, signal }); + canvas.addEventListener("pointerup", end, { signal }); + canvas.addEventListener("pointercancel", end, { signal }); }, { signal }); canvas.addEventListener("dblclick", () => { spinning = !spinning; }, { signal }); }).catch(() => undefined); diff --git a/frontend/src/ui/components/audioplayer.ts b/frontend/src/ui/components/audioplayer.ts index a63f70e..b37b5f0 100644 --- a/frontend/src/ui/components/audioplayer.ts +++ b/frontend/src/ui/components/audioplayer.ts @@ -72,8 +72,8 @@ export function createAudioPlayer(item: Media, autoplay = true): AudioPlayer { const played = duration() ? audio.currentTime / duration() : 0; const bars = resamplePeaks(peaks.length ? peaks : [0.02], Math.max(1, Math.floor(width / BAR_STRIDE))); const middle = height / 2; - const ahead = cssColor(el, "--wave-ahead", "rgba(255,255,255,0.35)"); - const behind = cssColor(el, "--wave-played", "rgba(255,255,255,0.92)"); + const ahead = cssColor(el, "--wave-ahead", getComputedStyle(el).color); + const behind = cssColor(el, "--wave-played", getComputedStyle(el).color); bars.forEach((value, i) => { const x = i * BAR_STRIDE; const span = Math.max(1, value * height * 0.46); @@ -143,9 +143,11 @@ export function createAudioPlayer(item: Media, autoplay = true): AudioPlayer { const up = () => { wave.removeEventListener("pointermove", move); wave.removeEventListener("pointerup", up); + wave.removeEventListener("pointercancel", up); }; wave.addEventListener("pointermove", move); wave.addEventListener("pointerup", up); + wave.addEventListener("pointercancel", up); }); el.addEventListener("click", (event) => event.stopPropagation()); playBtn.addEventListener("click", toggle); @@ -173,6 +175,7 @@ export function createAudioPlayer(item: Media, autoplay = true): AudioPlayer { audio, key: (event) => { if (event.metaKey || event.ctrlKey || event.altKey) return false; + if (document.querySelector(".modal-backdrop, .editor.open")) return false; const target = event.target as HTMLElement | null; if (target && target.closest("input, textarea, select, [contenteditable=\"true\"]")) return false; const handled = act(audioKeyAction(event.key, event.shiftKey)); diff --git a/frontend/src/ui/components/editor.ts b/frontend/src/ui/components/editor.ts index 0f25249..b3479f8 100644 --- a/frontend/src/ui/components/editor.ts +++ b/frontend/src/ui/components/editor.ts @@ -870,7 +870,7 @@ export function registerEditor(): void { tileHooks.ctx.push(editEntries); selectbarExtras.push({ label: "Paste Edits", icon: "copy", handler: (ids) => { if (clipboard) void pasteEdits(ids); else toast("Copy edits from an edited photo first"); } }); window.addEventListener("keydown", (event) => { - if (!(event.metaKey || event.ctrlKey) || !event.shiftKey || open) return; + if (!(event.metaKey || event.ctrlKey) || !event.shiftKey || open || isTrimming()) return; const key = event.key.toLowerCase(); const viewerId = store.viewer ? store.viewer.ids[store.viewer.index] : null; const ids = viewerId !== null && viewerId !== undefined ? [viewerId] : [...store.selection]; diff --git a/frontend/src/ui/components/importer.ts b/frontend/src/ui/components/importer.ts index f7186a9..50e08c1 100644 --- a/frontend/src/ui/components/importer.ts +++ b/frontend/src/ui/components/importer.ts @@ -132,6 +132,7 @@ export function mountImportPage(host: HTMLElement): () => void { function mediaFiles(list: FileList | null): globalThis.File[] { if (!list) return []; return [...list].filter((file) => { + if (file.name.startsWith(".") || file.name.startsWith("~$") || file.name.toLowerCase() === "desktop.ini") return false; const ext = file.name.split(".").pop()?.toLowerCase() ?? ""; return file.type.startsWith("image/") || file.type.startsWith("video/") || file.type.startsWith("audio/") || MEDIA_DROP.has(ext) || (ext !== "" && ext !== file.name.toLowerCase()); }); diff --git a/frontend/src/ui/components/trim.ts b/frontend/src/ui/components/trim.ts index dc14bea..43bdb09 100644 --- a/frontend/src/ui/components/trim.ts +++ b/frontend/src/ui/components/trim.ts @@ -20,11 +20,20 @@ function trimSurface(item: Media): { el: HTMLElement; media: HTMLMediaElement; d return { el: player.el, media: player.audio, dispose: player.dispose }; } const video = h("video", { src: fileUrl(item.id), controls: true, playsinline: true, class: "trim-video" }) as HTMLVideoElement; - return { el: video, media: video, dispose: () => video.pause() }; + return { + el: video, + media: video, + dispose: () => { + video.pause(); + video.removeAttribute("src"); + video.load(); + }, + }; } export function openTrim(item: Media): void { trimming = true; + document.querySelectorAll("audio, video").forEach((playing) => (playing as HTMLMediaElement).pause()); const surface = trimSurface(item); const media = surface.media; const inRange = h("input", { type: "range", min: "0", max: "1000", value: "0", class: "ed-range" }) as HTMLInputElement; @@ -88,7 +97,15 @@ export function openTrim(item: Media): void { }; cancel.addEventListener("click", close); reset.addEventListener("click", () => { inRange.value = "0"; outRange.value = "1000"; sync(); }); - done.addEventListener("click", async () => { await save(); toast("Trim saved"); close(); }); + done.addEventListener("click", async () => { + try { + await save(); + toast("Trim saved"); + close(); + } catch (err) { + toast(String((err as Error).message), "error"); + } + }); asNew.addEventListener("click", async () => { if (!(await save())) { toast("Move the start or end first"); return; } try { diff --git a/frontend/src/ui/components/vaultmove.ts b/frontend/src/ui/components/vaultmove.ts index a215695..1feb195 100644 --- a/frontend/src/ui/components/vaultmove.ts +++ b/frontend/src/ui/components/vaultmove.ts @@ -6,7 +6,11 @@ interface Placed { id: number; referenced?: number } export function referencedCount(ids: number[], known: Placed[] = []): number { const given = new Map(known.map((item) => [item.id, item.referenced])); - return ids.filter((id) => (given.has(id) ? given.get(id) : state.byId.get(id)?.referenced)).length; + return ids.filter((id) => { + if (given.has(id)) return Boolean(given.get(id)); + const known = state.byId.get(id); + return known === undefined || Boolean(known.referenced); + }).length; } export function vaultMoveText(count: number, verb: string): string { diff --git a/frontend/tests/vaultmove.test.ts b/frontend/tests/vaultmove.test.ts index e67cae7..01383fc 100644 --- a/frontend/tests/vaultmove.test.ts +++ b/frontend/tests/vaultmove.test.ts @@ -7,7 +7,8 @@ describe("moving referenced originals into the vault", () => { it("counts only items added in place", () => { state.byId.set(1, { id: 1, referenced: 1 } as Media); state.byId.set(2, { id: 2, referenced: 0 } as Media); - expect(referencedCount([1, 2, 3])).toBe(1); + expect(referencedCount([1, 2])).toBe(1); + expect(referencedCount([2, 3])).toBe(1); expect(referencedCount([2, 3], [{ id: 3, referenced: 1 }])).toBe(1); expect(referencedCount([1], [{ id: 1, referenced: 0 }])).toBe(0); }); diff --git a/setup/notices.py b/setup/notices.py index dc46e35..3b87cd5 100644 --- a/setup/notices.py +++ b/setup/notices.py @@ -16,6 +16,11 @@ REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) OUT = os.path.join(REPO, "THIRD-PARTY-NOTICES.txt") REQUIREMENTS = ("backend/requirements.txt", "backend/requirements_macos.txt") +TARGETS = ( + {"sys_platform": "darwin", "platform_system": "Darwin", "os_name": "posix", "python_version": "3.12"}, + {"sys_platform": "linux", "platform_system": "Linux", "os_name": "posix", "python_version": "3.12"}, + {"sys_platform": "win32", "platform_system": "Windows", "os_name": "nt", "python_version": "3.12"}, +) RULE = "=" * 78 THIN = "-" * 78 HEADER_LINE = re.compile(r"^(python|npm|crate|runtime|binary): (\S+) (\S+)$") @@ -76,7 +81,8 @@ def _wanted(requirement: str) -> Optional[str]: try: from packaging.markers import Marker - if not Marker(marker.strip()).evaluate(): + parsed = Marker(marker.strip()) + if not any(parsed.evaluate(target) for target in TARGETS): return None except Exception: pass @@ -84,7 +90,7 @@ def _wanted(requirement: str) -> Optional[str]: return norm(match.group(1)) if match else None -def python_closure(roots: Dict[str, Optional[str]]) -> Dict[str, md.Distribution]: +def python_closure(roots: Dict[str, Optional[str]], missing: Optional[Set[str]] = None) -> Dict[str, md.Distribution]: found: Dict[str, md.Distribution] = {} queue = list(roots) while queue: @@ -94,6 +100,8 @@ def python_closure(roots: Dict[str, Optional[str]]) -> Dict[str, md.Distribution try: dist = md.distribution(name) except md.PackageNotFoundError: + if missing is not None and name not in roots: + missing.add(name) continue found[name] = dist queue.extend(dep for dep in map(_wanted, dist.requires or []) if dep and dep not in found) @@ -280,7 +288,10 @@ def _previous() -> List[Section]: def generate(offline: bool) -> List[Section]: - closure = python_closure(requirement_roots()) + missing: Set[str] = set() + closure = python_closure(requirement_roots(), missing) + for name in sorted(missing): + print(f"required on some platform but not installed here: {name}", file=sys.stderr) current = python_sections(closure) kept = [s for s in _previous() if s.kind == "python" and s.name not in closure] for section in kept: From abd76585d5831c01ea76b6450fdf78735acb72e8 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 15:45:59 -0500 Subject: [PATCH 32/35] refactor: keep the edit-file check beside the other edit helpers Moves the check for edit files another item still uses into extedit so vaultcrypt.py stays under the file size limit after the merge. --- backend/app/services/extedit.py | 17 ++++++++++++++++- backend/app/vaultcrypt.py | 18 ++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/backend/app/services/extedit.py b/backend/app/services/extedit.py index 13a883c..4d2c8fd 100644 --- a/backend/app/services/extedit.py +++ b/backend/app/services/extedit.py @@ -1,3 +1,4 @@ +import json import os import shutil import threading @@ -5,7 +6,7 @@ from typing import Any, Callable, Dict, Optional from ..config import library_root -from ..db import q1, reset_thread_conn +from ..db import q, q1, reset_thread_conn from . import decode, editsvc, filesvc, libraryfs POLL_S = 1.5 @@ -34,6 +35,20 @@ def external_path(state: Dict[str, Any]) -> Optional[str]: return path if os.path.isfile(path) else None +def files_in_use(media_id: int) -> set: + names = set() + for row in q("SELECT edit_json FROM media WHERE id<>? AND edit_json LIKE '%external%'", (media_id,)): + try: + state = json.loads(row["edit_json"]) or {} + except ValueError: + continue + ext = state.get("external") if isinstance(state, dict) else None + name = os.path.basename(str((ext or {}).get("file") or "")) if isinstance(ext, dict) else "" + if name: + names.add(name) + return names + + def _working_copy(row) -> str: os.makedirs(work_dir(), exist_ok=True) stamp = int(time.time()) diff --git a/backend/app/vaultcrypt.py b/backend/app/vaultcrypt.py index a06949a..4e174e3 100644 --- a/backend/app/vaultcrypt.py +++ b/backend/app/vaultcrypt.py @@ -617,29 +617,15 @@ def purge(media_id: int) -> None: _drop(item["blob"]) ex("DELETE FROM vault_items WHERE media_id=?", (media_id,)) _scrub(media_id) - from .services.extedit import edits_dir, work_dir + from .services.extedit import edits_dir, files_in_use, work_dir - kept = _edit_files_in_use(media_id) + kept = files_in_use(media_id) for folder in (edits_dir(), work_dir()): for path in glob.glob(os.path.join(glob.escape(folder), f"{media_id}-*")): if os.path.basename(path) not in kept: _unlink(path) -def _edit_files_in_use(media_id: int) -> set: - names = set() - for row in q("SELECT edit_json FROM media WHERE id<>? AND edit_json LIKE '%external%'", (media_id,)): - try: - state = json.loads(row["edit_json"]) or {} - except ValueError: - continue - ext = state.get("external") if isinstance(state, dict) else None - name = os.path.basename(str((ext or {}).get("file") or "")) if isinstance(ext, dict) else "" - if name: - names.add(name) - return names - - def is_vaulted(media_id: int) -> bool: return _item(media_id) is not None From 8ab04cb3598fefc3aa0524ce04dfe4e40532c87c Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 16:48:48 -0500 Subject: [PATCH 33/35] fix: sealed WAV waveforms decode without ffmpeg 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. --- backend/HASHOUT_LOG.md | 7 +++++++ backend/app/services/waveform.py | 7 +++++-- backend/tests/test_audio_organise.py | 11 +++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 6faa7a2..de37451 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/waveform.py decode · a sealed WAV draws its waveform without ffmpeg +- refers-to: waveform.decode, _wave_peaks (path or file object); tests/test_audio_organise.py test_a_sealed_wav_shows_its_waveform_without_ffmpeg +- kind: fix +- logged: after v1.32.4 · 2026-11-29 + +PR #19's Linux engine tests failed in test_hidden_audio_is_sealed_and_still_plays with 409 on the waveform of the hidden WAV. The CI runner has no ffmpeg, and a protected item's waveform is decoded from its sealed bytes; decode() fell back to the standard library WAV reader only when it had a file path, so sealed bytes without ffmpeg gave no peaks and the route answered "ffmpeg is needed". Machines with ffmpeg on PATH (every one this branch was tested on) never reached that branch. decode() now reads WAV bytes through wave.open on a BytesIO when there is no path, the same reader a plain WAV uses. Reproduced with ffmpeg_path patched to None: 409 before, 200 with 60 peaks after. + ### services/assetwork.py, modelres.py, imagex.py, decode.py, sequences.py, filestrip.py, docres.py, routers/assets.py · review fixes for file kinds - refers-to: assetwork _bounded, _text, process; modelres read_stl, _ply_header, read_ply, STL_VERTEX; imagex STILL_SCALE, gunzip_capped, svg_size, render_svg; decode.open_image DecompressionBombError; sequences RENDER_PAD, _looks_rendered, group, pack date clamp; filestrip _is_zip, strip_file, text_located, JSON_LATLON, EXR_TEXT_SCAN; docres _whole_utf8, delimited, _Zip; routers/assets.py _original_bytes, media_lottie, media_mesh; tests/test_formats_extra.py test_sequence_grouping_rules - kind: fix diff --git a/backend/app/services/waveform.py b/backend/app/services/waveform.py index 826d3ed..74bb5b5 100644 --- a/backend/app/services/waveform.py +++ b/backend/app/services/waveform.py @@ -1,3 +1,4 @@ +import io import json import math import os @@ -5,7 +6,7 @@ import subprocess import threading import wave -from typing import Iterable, List, Optional +from typing import BinaryIO, Iterable, List, Optional, Union import numpy as np from PIL import Image, ImageDraw @@ -123,7 +124,7 @@ def _ffmpeg_peaks(binary: str, src: Optional[str], data: Optional[bytes], durati return normalise(pool(found, buckets)) -def _wave_peaks(src: str, buckets: int) -> Optional[List[float]]: +def _wave_peaks(src: Union[str, BinaryIO], buckets: int) -> Optional[List[float]]: try: with wave.open(src, "rb") as handle: width, channels = handle.getsampwidth(), handle.getnchannels() @@ -151,6 +152,8 @@ def decode(src: Optional[str] = None, data: Optional[bytes] = None, duration: Op return found if src and os.path.isfile(src): return _wave_peaks(src, buckets) + if data is not None: + return _wave_peaks(io.BytesIO(data), buckets) return None diff --git a/backend/tests/test_audio_organise.py b/backend/tests/test_audio_organise.py index b8059ea..fcf4829 100644 --- a/backend/tests/test_audio_organise.py +++ b/backend/tests/test_audio_organise.py @@ -201,3 +201,14 @@ def test_listen_copy_goes_with_trash_even_without_a_vault(client, tmp_path): assert client.post(f"/api/media/{media_id}/trash", headers=HEADERS).status_code == 200 assert not os.path.exists(listen_path(media_id)) assert not os.path.exists(waveform.cache_path(media_id)) + + +def test_a_sealed_wav_shows_its_waveform_without_ffmpeg(client, tmp_path, monkeypatch): + from app.services import waveform + + item = one_audio(client, tmp_path) + token = client.post("/api/vault/setup", json={"passkey": "vaultkey9"}, headers=HEADERS).json()["token"] + client.post(f"/api/media/{item['id']}/hide", headers=HEADERS) + monkeypatch.setattr(waveform, "ffmpeg_path", lambda: None) + res = client.get(f"/api/media/{item['id']}/waveform", params={"n": 60}, headers={**HEADERS, "x-dam-vault": token}) + assert res.status_code == 200 and len(res.json()["peaks"]) == 60 From 68d5053dd02daafb04a9283d27b76da99d7fc184 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 16:49:08 -0500 Subject: [PATCH 34/35] feat: offer to flatten PDFs that cannot leave without location 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. --- backend/HASHOUT_LOG.md | 7 +++ backend/app/routers/packages.py | 7 ++- backend/app/services/filestrip.py | 20 ++++++- backend/app/services/gallerysvc.py | 57 ++++++++++++++---- backend/app/services/outputsvc.py | 14 ++++- backend/app/services/packagesvc.py | 25 +++++--- backend/app/services/pdfflatten.py | 81 +++++++++++++++++++++++++ backend/app/services/pdfstrip.py | 10 +++- backend/tests/test_pdf_flatten.py | 82 ++++++++++++++++++++++++++ frontend/HASHOUT_LOG.md | 7 +++ frontend/src/engine/types.ts | 1 + frontend/src/ui/components/flatten.ts | 34 +++++++++++ frontend/src/ui/components/outputs.ts | 20 ++++++- frontend/src/ui/components/packages.ts | 18 ++++-- frontend/src/ui/components/sharing.ts | 24 +++++++- frontend/tests/flatten.test.ts | 22 +++++++ 16 files changed, 387 insertions(+), 42 deletions(-) create mode 100644 backend/app/services/pdfflatten.py create mode 100644 backend/tests/test_pdf_flatten.py create mode 100644 frontend/src/ui/components/flatten.ts create mode 100644 frontend/tests/flatten.test.ts diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index de37451..db73ebf 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/pdfflatten.py, filestrip.py, pdfstrip.py, outputsvc.py, packagesvc.py, gallerysvc.py · Flatten to images +- refers-to: pdfflatten (new) flatten, _render, _image_pdf, DPI, MAX_SIDE, MAX_PAGES, MAX_PIXELS; filestrip FlattenAvailable, strip_file flatten; pdfstrip.clean_pdf; outputsvc _copy_file_kind, _flattenable, export_job state flattenable; packagesvc _payload, _entry, build flatten_pdfs; gallerysvc FLATTEN_MARK, _refusal, flattenable, file_download, download_path, _needs_flatten, web_gallery flatten_pdfs; routers/packages.py BuildIn and GalleryIn flatten_pdfs; tests/test_pdf_flatten.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +Owner decision 2026-11-29. When the PDF rebuild refuses a file because it met something it cannot make safe (an inline image, a function stream, a CCITT scan and the like), the refusal is a FlattenAvailable, a kind of LocationRemains, so every existing caller still treats it as a refusal. Encrypted, unreadable or oversized PDFs and PDFs inside archives are plain LocationRemains and are never offered. Flattening runs only when the request says so (flatten_pdfs on export options, package and web gallery requests; the default is false everywhere, so the API and agents never flatten without the flag). It renders each page with pypdfium2 under the PDFium lock at 150 dpi, capped at 4000 px on the long side, 500 pages and 400 megapixels in all, encodes each page as a fresh JPEG and writes a new PDF with pypdf that holds only the pages, one image each and a one-line content stream, with no document information. The result goes through the same read-back check as a rebuilt copy. Export lists the items it could have flattened in its job state (flattenable) and exports the rest; a package or web gallery stops before writing anything and lists them, so the window can ask and run again with the flag. A web gallery remembers the kind of refusal in its share cache marker, and flattened copies are cached under their own name. + ### services/waveform.py decode · a sealed WAV draws its waveform without ffmpeg - refers-to: waveform.decode, _wave_peaks (path or file object); tests/test_audio_organise.py test_a_sealed_wav_shows_its_waveform_without_ffmpeg - kind: fix diff --git a/backend/app/routers/packages.py b/backend/app/routers/packages.py index ae98ca4..b774fed 100644 --- a/backend/app/routers/packages.py +++ b/backend/app/routers/packages.py @@ -26,6 +26,7 @@ class BuildIn(BaseModel): include_location: bool = False add_as: str = Field("album", pattern="^(album|stack)$") sender: str = Field("", max_length=60) + flatten_pdfs: bool = False class OpenIn(BaseModel): @@ -89,7 +90,7 @@ def build_package(body: BuildIn): def run(state): try: packagesvc.build(body.ids, body.password, body.title.strip(), dest, body.include_location, body.add_as, - body.album_id, body.sender.strip(), state) + body.album_id, body.sender.strip(), state, flatten_pdfs=body.flatten_pdfs) except packagesvc.PackageError as exc: state["message"] = str(exc) raise @@ -164,6 +165,7 @@ class GalleryIn(BaseModel): title: str = Field("Web Gallery", max_length=120) dest: str = Field(min_length=1) include_location: bool = False + flatten_pdfs: bool = False @router.post("/packages/gallery") @@ -175,7 +177,8 @@ def gallery(body: GalleryIn): os.makedirs(dest, exist_ok=True) except OSError: raise HTTPException(400, detail="That folder cannot be created") - return {"job_id": jobs.start("gallery", lambda state: gallerysvc.web_gallery(body.ids, body.title, dest, body.include_location, state))} + return {"job_id": jobs.start("gallery", lambda state: gallerysvc.web_gallery(body.ids, body.title, dest, body.include_location, state, + flatten_pdfs=body.flatten_pdfs))} @router.get("/albums/{album_id}/notes") diff --git a/backend/app/services/filestrip.py b/backend/app/services/filestrip.py index 38bd915..4d53a75 100644 --- a/backend/app/services/filestrip.py +++ b/backend/app/services/filestrip.py @@ -28,6 +28,10 @@ class LocationRemains(ValueError): pass +class FlattenAvailable(LocationRemains): + pass + + def _exr_part(data: bytes, pos: int, attrs: list) -> Tuple[int, bool]: while pos < len(data): if data[pos] == 0: @@ -215,10 +219,13 @@ def _is_zip(src: Source) -> bool: return handle.read(4) == b"PK\x03\x04" -def strip_file(row, src: Source, dest: str) -> None: +def strip_file(row, src: Source, dest: str, flatten: bool = False) -> None: try: if row["kind"] == "sequence" or _is_zip(src): - strip_zip(src, dest) + try: + strip_zip(src, dest) + except FlattenAvailable as exc: + raise LocationRemains(str(exc)) from exc return if isinstance(src, (bytes, bytearray)): data = bytes(src) @@ -226,7 +233,14 @@ def strip_file(row, src: Source, dest: str) -> None: with open(src, "rb") as handle: data = handle.read() name = row["name"] if "name" in row.keys() else os.path.basename(dest) - clean = clean_member(name, data) + try: + clean = clean_member(name, data) + except FlattenAvailable: + if not flatten: + raise + from . import pdfflatten + + clean = pdfflatten.flatten(name, data) with open(dest, "wb") as handle: handle.write(clean) found = gpsscrub.has_gps(dest) diff --git a/backend/app/services/gallerysvc.py b/backend/app/services/gallerysvc.py index 7f4b82d..1c91874 100644 --- a/backend/app/services/gallerysvc.py +++ b/backend/app/services/gallerysvc.py @@ -8,6 +8,7 @@ from ..db import q1 from . import classify, thumbs +FLATTEN_MARK = "flatten" SHAREABLE = "m.trashed_ts IS NULL AND m.private=0 AND m.hidden=0 AND m.live_of IS NULL" @@ -56,7 +57,20 @@ def _cut_timed(ff: str, row, src: str, tmp: str, strip: bool) -> bool: return False -def file_download(row, src: str, keep_location: bool) -> Optional[str]: +def _refusal(row, flatten: bool) -> str: + tag = "flat" if flatten else "noloc" + return os.path.join(cache_dir(), "share", f"{row['id']}_{row['sha256'][:12]}_{tag}.refused") + + +def flattenable(row) -> bool: + try: + with open(_refusal(row, False), "r", encoding="utf-8") as handle: + return handle.read() == FLATTEN_MARK + except OSError: + return False + + +def file_download(row, src: str, keep_location: bool, flatten: bool = False) -> Optional[str]: from . import filestrip if not os.path.isfile(src): @@ -65,29 +79,30 @@ def file_download(row, src: str, keep_location: bool) -> Optional[str]: return src folder = os.path.join(cache_dir(), "share") os.makedirs(folder, exist_ok=True) - out = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_noloc{os.path.splitext(row['name'])[1].lower()}") - refused = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_noloc.refused") + tag = "flat" if flatten else "noloc" + out = os.path.join(folder, f"{row['id']}_{row['sha256'][:12]}_{tag}{os.path.splitext(row['name'])[1].lower()}") + refused = _refusal(row, flatten) if os.path.isfile(refused): return None if not os.path.isfile(out): tmp = f"{out}.part" try: - filestrip.strip_file(row, src, tmp) - except (filestrip.LocationRemains, OSError, ValueError): - with open(refused, "w", encoding="utf-8"): - pass + filestrip.strip_file(row, src, tmp, flatten=flatten) + except (filestrip.LocationRemains, OSError, ValueError) as exc: + with open(refused, "w", encoding="utf-8") as handle: + handle.write(FLATTEN_MARK if isinstance(exc, filestrip.FlattenAvailable) else "") return None os.replace(tmp, out) return out -def download_path(share, media_id: int) -> Optional[str]: +def download_path(share, media_id: int, flatten: bool = False) -> Optional[str]: from . import libraryfs row = q1("SELECT * FROM media WHERE id=?", (media_id,)) src = libraryfs.abs_path(row["rel_path"]) if classify.is_file_kind(row["kind"]): - return file_download(row, src, bool(share["include_location"]) and not row["location_hidden"]) + return file_download(row, src, bool(share["include_location"]) and not row["location_hidden"], flatten) timed = row["kind"] in ("video", "audio") trimmed = timed and (row["trim_in"] is not None or row["trim_out"] is not None) if share["include_location"] and not row["location_hidden"] and not row["edit_json"] and not trimmed: @@ -148,13 +163,31 @@ def dms(value: float): return exif -def web_gallery(ids: List[int], title: str, dest: str, include_location: bool, state: Dict[str, Any]) -> None: +def _needs_flatten(ids: List[int], fake: Dict[str, Any]) -> List[Dict[str, Any]]: + found = [] + for media_id in ids: + row = q1("SELECT * FROM media WHERE id=?", (media_id,)) + if classify.is_file_kind(row["kind"]) and download_path(fake, media_id) is None and flattenable(row): + found.append({"id": media_id, "name": row["name"]}) + return found + + +def web_gallery(ids: List[int], title: str, dest: str, include_location: bool, state: Dict[str, Any], + flatten_pdfs: bool = False) -> None: import json import re import shutil from ..routers.render import render_image + ok = _shareable_ids(ids) + fake = {"include_location": int(include_location), "allow_download": 1} + if not flatten_pdfs: + pending = _needs_flatten(ok, fake) + if pending: + state["flattenable"] = pending + state["message"] = f"{len(pending)} PDF{'s' if len(pending) != 1 else ''} can only be shared flattened to images" + raise ValueError(state["message"]) name = re.sub(r"[^\w .-]+", "", title).strip() or "Web Gallery" folder = os.path.join(dest, name) n = 1 @@ -163,17 +196,15 @@ def web_gallery(ids: List[int], title: str, dest: str, include_location: bool, s folder = os.path.join(dest, f"{name} {n}") os.makedirs(os.path.join(folder, "photos")) os.makedirs(os.path.join(folder, "thumbs")) - ok = _shareable_ids(ids) counts = {"written": 0, "skipped": len(ids) - len(ok)} state["counts"] = counts state["dest"] = folder - fake = {"include_location": int(include_location), "allow_download": 1} entries = [] for pos, media_id in enumerate(ok, start=1): row = q1("SELECT * FROM media WHERE id=?", (media_id,)) stem = f"{pos:04d}" if row["kind"] in ("video", "audio") or classify.is_file_kind(row["kind"]): - src = download_path(fake, media_id) + src = download_path(fake, media_id, flatten_pdfs and flattenable(row)) if src is None: counts["skipped"] += 1 continue diff --git a/backend/app/services/outputsvc.py b/backend/app/services/outputsvc.py index 9142dbf..9b26e9d 100644 --- a/backend/app/services/outputsvc.py +++ b/backend/app/services/outputsvc.py @@ -117,7 +117,7 @@ def _copy_stripped(src: Any, target: str, row, opts: Dict[str, Any]) -> None: from . import classify if classify.is_file_kind(row["kind"]): - _copy_file_kind(src, target, row) + _copy_file_kind(src, target, row, bool(opts.get("flatten_pdfs"))) return if isinstance(src, (bytes, bytearray)): data = bytes(src) @@ -133,11 +133,11 @@ def _copy_stripped(src: Any, target: str, row, opts: Dict[str, Any]) -> None: raise ExportError(f"{row['name']}: location could not be removed from this original") -def _copy_file_kind(src: Any, target: str, row) -> None: +def _copy_file_kind(src: Any, target: str, row, flatten: bool = False) -> None: from . import filestrip try: - filestrip.strip_file(row, src, target) + filestrip.strip_file(row, src, target, flatten=flatten) except (filestrip.LocationRemains, OSError, ValueError) as exc: raise ExportError(f"{row['name']}: location could not be removed ({exc})") from exc @@ -226,6 +226,12 @@ def export_one(row, dest: str, seq: int, opts: Dict[str, Any], taken: set) -> Op return target +def _flattenable(err: BaseException) -> bool: + from . import filestrip + + return isinstance(err.__cause__, filestrip.FlattenAvailable) + + def export_job(ids: List[int], dest: str, opts: Dict[str, Any], state: Dict[str, Any]) -> None: from .. import vaultcrypt @@ -244,6 +250,8 @@ def export_job(ids: List[int], dest: str, opts: Dict[str, Any], state: Dict[str, done = export_one(row, dest, seq, merged, taken) except ExportError as err: state.setdefault("failures", []).append(str(err)) + if _flattenable(err): + state.setdefault("flattenable", []).append({"id": media_id, "name": row["name"]}) done = None except Exception: done = None diff --git a/backend/app/services/packagesvc.py b/backend/app/services/packagesvc.py index 3cda388..b44b60b 100644 --- a/backend/app/services/packagesvc.py +++ b/backend/app/services/packagesvc.py @@ -12,7 +12,7 @@ from ..config import cache_dir from ..db import ex, q, q1 -from . import gpsscrub, libraryfs +from . import filestrip, gpsscrub, libraryfs FORMAT = "formdam-share" VERSION = 1 @@ -152,7 +152,7 @@ def strip_timed(row, src: str, dest: str) -> bool: return _strip_audio(src, dest) if row["kind"] == "audio" else _strip_video(src, dest) -def _payload(row, include_location: bool, work: str) -> Dict[str, Any]: +def _payload(row, include_location: bool, work: str, flatten: bool = False) -> Dict[str, Any]: src = libraryfs.abs_path(row["rel_path"]) if include_location and not row["location_hidden"]: return {"path": src, "name": row["name"], "converted": False} @@ -165,7 +165,7 @@ def _payload(row, include_location: bool, work: str) -> Dict[str, Any]: if classify.is_file_kind(row["kind"]): try: - filestrip.strip_file(row, src, target) + filestrip.strip_file(row, src, target, flatten=flatten) except (filestrip.LocationRemains, OSError, ValueError) as exc: raise PackageError(f"{row['name']}: location could not be removed ({exc})") from exc return {"path": target, "name": row["name"], "converted": False} @@ -187,10 +187,10 @@ def _payload(row, include_location: bool, work: str) -> Dict[str, Any]: return {"path": target, "name": stem + ".jpg", "converted": True} -def _entry(row, include_location: bool, work: str, members: List[Any]) -> Dict[str, Any]: +def _entry(row, include_location: bool, work: str, members: List[Any], flatten: bool = False) -> Dict[str, Any]: from .extedit import external_path - payload = _payload(row, include_location, work) + payload = _payload(row, include_location, work, flatten) member = secrets.token_hex(16) members.append((member, payload["path"])) entry: Dict[str, Any] = { @@ -234,7 +234,7 @@ def ensure_album_share(album_id: int) -> str: def build(ids: List[int], password: str, title: str, dest: str, include_location: bool, add_as: str, - album_id: Optional[int], sender: str, state: Dict[str, Any]) -> None: + album_id: Optional[int], sender: str, state: Dict[str, Any], flatten_pdfs: bool = False) -> None: if len(password) < MIN_PASSWORD: raise PackageError(f"Use a password of at least {MIN_PASSWORD} characters") pz = _zipper() @@ -253,12 +253,23 @@ def build(ids: List[int], password: str, title: str, dest: str, include_location try: members: List[Any] = [] entries = [] + flattenable: List[Dict[str, Any]] = [] for media_id in keep: row = q1("SELECT * FROM media WHERE id=?", (media_id,)) - entry = _entry(row, include_location, work, members) + try: + entry = _entry(row, include_location, work, members, flatten_pdfs) + except PackageError as exc: + if not isinstance(exc.__cause__, filestrip.FlattenAvailable): + raise + flattenable.append({"id": media_id, "name": row["name"]}) + continue counts["items"] += 1 counts["converted"] += int(entry["name"] != row["name"]) entries.append(entry) + if flattenable: + state["flattenable"] = flattenable + raise PackageError(f"{len(flattenable)} PDF{'s' if len(flattenable) != 1 else ''} could not be cleaned of location " + "and can only be shared flattened to images") package_id = uuid.uuid4().hex manifest: Dict[str, Any] = {"format": FORMAT, "version": VERSION, "package_id": package_id, "created_ts": time.time(), "sender": sender, "title": title or (album["name"] if album else "Shared Photos"), diff --git a/backend/app/services/pdfflatten.py b/backend/app/services/pdfflatten.py new file mode 100644 index 0000000..b27179c --- /dev/null +++ b/backend/app/services/pdfflatten.py @@ -0,0 +1,81 @@ +import io +import logging +from typing import List, Tuple + +from . import filestrip, pdfstrip, zipsafe + +logger = logging.getLogger(__name__) + +DPI = 150 +MAX_SIDE = 4000 +MAX_PAGES = 500 +MAX_PIXELS = 400 * 1024 * 1024 +JPEG_QUALITY = 88 + + +def flatten(name: str, data: bytes) -> bytes: + if len(data) > zipsafe.MEMBER_CAP: + raise filestrip.LocationRemains(f"{name} is too large to flatten") + try: + pages = _render(data) + flat = _image_pdf(pages) + pdfstrip.verify(flat) + except filestrip.LocationRemains as exc: + raise filestrip.LocationRemains(f"{name}: {exc}") from exc + except Exception as exc: + logger.info("pdf flatten failed: %s", exc) + raise filestrip.LocationRemains(f"{name}: this PDF could not be flattened to images") from exc + return flat + + +def _render(data: bytes) -> List[Tuple[bytes, float, float, int, int]]: + from .docres import _PDF_LOCK, _pdf + + out: List[Tuple[bytes, float, float, int, int]] = [] + budget = MAX_PIXELS + with _PDF_LOCK: + doc = _pdf(data) + try: + if len(doc) > MAX_PAGES: + raise filestrip.LocationRemains(f"this PDF has more than {MAX_PAGES} pages to flatten") + for index in range(len(doc)): + page = doc[index] + width, height = page.get_size() + scale = min(DPI / 72, MAX_SIDE / max(width, height, 1)) + bitmap = page.render(scale=scale) + image = bitmap.to_pil().convert("RGB") + budget -= image.width * image.height + if budget < 0: + raise filestrip.LocationRemains("this PDF is too large to flatten") + encoded = io.BytesIO() + image.save(encoded, "JPEG", quality=JPEG_QUALITY) + out.append((encoded.getvalue(), float(width), float(height), image.width, image.height)) + finally: + doc.close() + if not out: + raise filestrip.LocationRemains("this PDF has no pages to flatten") + return out + + +def _image_pdf(pages: List[Tuple[bytes, float, float, int, int]]) -> bytes: + from pypdf import PdfWriter + from pypdf.generic import DecodedStreamObject, DictionaryObject, NameObject, NumberObject, StreamObject + + writer = PdfWriter() + writer.metadata = None + for jpeg, width, height, px_w, px_h in pages: + page = writer.add_blank_page(width, height) + image = StreamObject() + image.update({NameObject("/Type"): NameObject("/XObject"), NameObject("/Subtype"): NameObject("/Image"), + NameObject("/Width"): NumberObject(px_w), NameObject("/Height"): NumberObject(px_h), + NameObject("/ColorSpace"): NameObject("/DeviceRGB"), NameObject("/BitsPerComponent"): NumberObject(8), + NameObject("/Filter"): NameObject("/DCTDecode")}) + image._data = jpeg + content = DecodedStreamObject() + content.set_data(f"q {width:.3f} 0 0 {height:.3f} 0 0 cm /Im0 Do Q".encode()) + page[NameObject("/Resources")] = DictionaryObject({ + NameObject("/XObject"): DictionaryObject({NameObject("/Im0"): writer._add_object(image)})}) + page[NameObject("/Contents")] = writer._add_object(content.flate_encode()) + out = io.BytesIO() + writer.write(out) + return out.getvalue() diff --git a/backend/app/services/pdfstrip.py b/backend/app/services/pdfstrip.py index 318bb98..481e024 100644 --- a/backend/app/services/pdfstrip.py +++ b/backend/app/services/pdfstrip.py @@ -15,13 +15,17 @@ def clean_pdf(name: str, data: bytes) -> bytes: if len(data) > zipsafe.MEMBER_CAP: raise filestrip.LocationRemains(f"{name} is too large to check") try: - clean = _rebuild(_open(data)) - verify(clean) + reader = _open(data) except filestrip.LocationRemains as exc: raise filestrip.LocationRemains(f"{name}: {exc}") from exc + try: + clean = _rebuild(reader) + verify(clean) + except filestrip.LocationRemains as exc: + raise filestrip.FlattenAvailable(f"{name}: {exc}") from exc except Exception as exc: logger.info("pdf clean failed: %s", exc) - raise filestrip.LocationRemains(f"{name}: this PDF could not be rebuilt without its location") from exc + raise filestrip.FlattenAvailable(f"{name}: this PDF could not be rebuilt without its location") from exc return clean diff --git a/backend/tests/test_pdf_flatten.py b/backend/tests/test_pdf_flatten.py new file mode 100644 index 0000000..05086e8 --- /dev/null +++ b/backend/tests/test_pdf_flatten.py @@ -0,0 +1,82 @@ +import io +import os + +import pytest + +from tests.conftest import HEADERS, import_dir, wait_job +from tests.test_formats_extra import pdf_with, stream_of + + +def refused_pdf(tmp_path): + from pypdf.generic import NameObject + + def build(writer, page): + page[NameObject("/Contents")] = stream_of(writer, b"0 0 1 rg 20 20 160 160 re f q BI /W 1 /H 1 /CS /G /BPC 8 ID \x00 EI Q") + + return pdf_with(tmp_path, build) + + +def test_a_pdf_the_rebuild_refuses_can_be_flattened_on_request(tmp_path): + from pypdf import PdfReader + + from app.services import filestrip + + data = refused_pdf(tmp_path) + dest = tmp_path / "flat.pdf" + with pytest.raises(filestrip.FlattenAvailable): + filestrip.strip_file({"kind": "document", "lat": 51.5, "name": "plan.pdf"}, data, str(dest)) + assert not dest.exists() + filestrip.strip_file({"kind": "document", "lat": 51.5, "name": "plan.pdf"}, data, str(dest), flatten=True) + reader = PdfReader(io.BytesIO(dest.read_bytes())) + page = reader.pages[0] + image = page["/Resources"]["/XObject"]["/Im0"].get_object() + assert len(reader.pages) == 1 and "/Info" not in reader.trailer and image["/Filter"] == "/DCTDecode" + assert page.extract_text() == "" and image["/Width"] > 300 + + +def test_encrypted_and_archived_pdfs_are_never_offered_flattening(tmp_path): + import zipfile + + from app.services import filestrip + from tests.test_formats_extra import located_pdf + + with pytest.raises(filestrip.LocationRemains) as refused: + filestrip.strip_file({"kind": "document", "lat": None, "name": "l.pdf"}, located_pdf(tmp_path, encrypt=True), + str(tmp_path / "l.pdf"), flatten=True) + assert not isinstance(refused.value, filestrip.FlattenAvailable) + bundle = io.BytesIO() + with zipfile.ZipFile(bundle, "w") as archive: + archive.writestr("inside.pdf", refused_pdf(tmp_path)) + with pytest.raises(filestrip.LocationRemains) as zipped: + filestrip.strip_file({"kind": "resource", "lat": None, "name": "b.zip"}, bundle.getvalue(), str(tmp_path / "b.zip")) + assert not isinstance(zipped.value, filestrip.FlattenAvailable) + + +def test_export_lists_flattenable_pdfs_and_flattens_only_when_asked(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + (src / "plan.pdf").write_bytes(refused_pdf(tmp_path)) + import_dir(client, src) + item = client.get("/api/media", params={"filter": "all"}).json()["items"][0] + out = tmp_path / "out" + body = {"ids": [item["id"]], "dest": str(out), "options": {"original": True, "location": False}} + first = wait_job(client, client.post("/api/export", json=body, headers=HEADERS).json()["job_id"]) + assert first["counts"]["exported"] == 0 and first["flattenable"] == [{"id": item["id"], "name": "plan.pdf"}] + assert not (out / "plan.pdf").exists() + body["options"]["flatten_pdfs"] = True + second = wait_job(client, client.post("/api/export", json=body, headers=HEADERS).json()["job_id"]) + assert second["counts"]["exported"] == 1 and "flattenable" not in second + assert (out / "plan.pdf").read_bytes().startswith(b"%PDF-") + + +def test_packages_stop_and_name_pdfs_that_need_flattening(client, tmp_path): + src = tmp_path / "src" + os.makedirs(src) + (src / "plan.pdf").write_bytes(refused_pdf(tmp_path)) + import_dir(client, src) + item = client.get("/api/media", params={"filter": "all"}).json()["items"][0] + body = {"ids": [item["id"]], "password": "a-long-enough-password", "dest": str(tmp_path / "pkg"), "include_location": False} + refused = wait_job(client, client.post("/api/packages", json=body, headers=HEADERS).json()["job_id"]) + assert refused["phase"] == "error" and refused["flattenable"][0]["id"] == item["id"] + made = wait_job(client, client.post("/api/packages", json={**body, "flatten_pdfs": True}, headers=HEADERS).json()["job_id"]) + assert made["phase"] == "done" and os.path.isfile(made["path"]) diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 87bdd9d..b386dd5 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### ui/components/flatten.ts · ask before flattening a PDF +- refers-to: flatten.ts (new) offerFlatten, flattenText; outputs.ts runExport; packages.ts the create step; sharing.ts writeGallery; engine/types.ts JobState.flattenable; styles/app.css .flatten-list; tests/flatten.test.ts +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +When an export, package or web gallery comes back with PDFs that can only leave without location as images, a dialog names them (up to eight, then a count), says that every page becomes a 150 dpi picture, that text can no longer be selected, copied or searched and that links and form fields are gone, and that the library copy is unchanged. Leave Them Out (or closing) exports nothing more and writes no package or gallery; Flatten to Images runs the export again for just those items, or the package or gallery again, with flatten_pdfs set. + ### ui/components/assetbodies.ts, audioplayer.ts, trim.ts, vaultmove.ts, importer.ts · review fixes for the window - refers-to: styles/assets.css .asset-preview, .asset-font, .asset-cues, .asset-excerpt, .asset-model, .asset-turntable, .swatch-chip; styles/audio.css .no-wave; assetbodies.ts meshInk, rgbOf, drawMesh, modelBody, captionBody, lottieBody; audioplayer.ts key, wave drag; trim.ts trimSurface, openTrim, done; editor.ts paste-edits shortcut; vaultmove.ts referencedCount; importer.ts mediaFiles; engine/assetkinds.ts assetFacts - kind: fix diff --git a/frontend/src/engine/types.ts b/frontend/src/engine/types.ts index 34e0a34..b11a9a2 100644 --- a/frontend/src/engine/types.ts +++ b/frontend/src/engine/types.ts @@ -164,6 +164,7 @@ export interface JobState { phase: "running" | "done" | "error"; counts: Record; error: string; + flattenable?: Array<{ id: number; name: string }>; } export interface DupSet { diff --git a/frontend/src/ui/components/flatten.ts b/frontend/src/ui/components/flatten.ts new file mode 100644 index 0000000..ddd2bf8 --- /dev/null +++ b/frontend/src/ui/components/flatten.ts @@ -0,0 +1,34 @@ +import { h } from "../dom.js"; +import { openModal } from "../modal.js"; + +export interface Flattenable { id: number; name: string } + +const SHOWN = 8; + +export function flattenText(count: number): string { + const these = count === 1 ? "This PDF" : `These ${count} PDFs`; + return `${these} could not be cleaned of location: formDAM met something inside that it cannot rebuild safely. ` + + "Flattening turns every page into a picture (150 dpi) in a new PDF with no metadata. " + + "Text in a flattened PDF can no longer be selected, copied or searched, and links and form fields are gone. " + + "The PDF in your library is not changed."; +} + +export function offerFlatten(items: Flattenable[]): Promise { + if (items.length === 0) return Promise.resolve(false); + return new Promise((resolve) => { + let answered = false; + const modal = openModal("Flatten PDFs to images?", 460, () => { if (!answered) resolve(false); }); + const names = items.slice(0, SHOWN).map((item) => h("li", {}, item.name)); + if (items.length > SHOWN) names.push(h("li", {}, `and ${items.length - SHOWN} more`)); + const leave = h("button", { class: "btn", type: "button" }, "Leave Them Out"); + const go = h("button", { class: "btn primary", type: "button" }, "Flatten to Images"); + leave.addEventListener("click", () => modal.close()); + go.addEventListener("click", () => { + answered = true; + resolve(true); + modal.close(); + }); + modal.body.append(h("p", { class: "settings-hint" }, flattenText(items.length)), h("ul", { class: "flatten-list" }, ...names), + h("div", { class: "modal-actions" }, leave, go)); + }); +} diff --git a/frontend/src/ui/components/outputs.ts b/frontend/src/ui/components/outputs.ts index 59509e1..9d72c03 100644 --- a/frontend/src/ui/components/outputs.ts +++ b/frontend/src/ui/components/outputs.ts @@ -12,6 +12,7 @@ import { toast } from "../toast.js"; import { tileHooks } from "./grid.js"; import { selectbarExtras } from "./selectbar.js"; import { viewerHooks } from "./viewer.js"; +import { offerFlatten } from "./flatten.js"; interface Template { id: number; name: string; fields: Record } interface Workflow { id: number; name: string; steps: Array> } @@ -135,6 +136,21 @@ export async function fileInfoFlow(ids: number[]): Promise { modal.body.append(body, h("div", { class: "modal-foot" }, tplSel, saveTpl, h("span", { class: "head-spacer" }), cancel, save), auto.wrap); } +function runExport(ids: number[], dest: string, options: Record): void { + void api<{ job_id: string; dest: string }>("/export", { method: "POST", body: JSON.stringify({ ids, dest, options }) }).then((res) => { + toast(`Exporting ${countFmt(ids.length)} item${ids.length === 1 ? "" : "s"}...`); + pollJob(res.job_id, (job) => { + toast(`Exported ${countFmt(job.counts.exported ?? 0)} to ${res.dest}${job.counts.skipped ? ` (${countFmt(job.counts.skipped)} skipped)` : ""}`); + const waiting = job.flattenable ?? []; + if (waiting.length && !options.flatten_pdfs) { + void offerFlatten(waiting).then((yes) => { + if (yes) runExport(waiting.map((item) => item.id), dest, { ...options, flatten_pdfs: true }); + }); + } + }); + }).catch((err) => toast((err as Error).message, "error")); +} + export function exportFlow(ids: number[]): void { const modal = openModal(`Export ${countFmt(ids.length)} Item${ids.length === 1 ? "" : "s"}`, 560); const original = check("Export unmodified originals (no edits, original format)", false); @@ -169,10 +185,8 @@ export function exportFlow(ids: number[]): void { original: original.input.checked, format: format.value, quality: Number(quality.value), size: size.value, px: Number(px.value), naming: naming.value || "{name}", subfolder: sub.value, metadata: meta.value, location: location.input.checked, sidecar: sidecar.input.checked, }; - const res = await api<{ job_id: string; dest: string }>("/export", { method: "POST", body: JSON.stringify({ ids, dest, options }) }); modal.close(); - toast(`Exporting ${countFmt(ids.length)} item${ids.length === 1 ? "" : "s"}...`); - pollJob(res.job_id, (job) => toast(`Exported ${countFmt(job.counts.exported ?? 0)} to ${res.dest}${job.counts.skipped ? ` (${countFmt(job.counts.skipped)} skipped)` : ""}`)); + runExport(ids, dest, options); }); modal.body.append(original.wrap, lossy, sizeRow, field("File Name", naming), h("div", { class: "field-hint" }, "Tokens: {name} {seq:3} {date:%Y-%m-%d} {camera} {place} {title} {rating} {custom}"), diff --git a/frontend/src/ui/components/packages.ts b/frontend/src/ui/components/packages.ts index 138d537..572f958 100644 --- a/frontend/src/ui/components/packages.ts +++ b/frontend/src/ui/components/packages.ts @@ -7,8 +7,9 @@ import { patchList, setText } from "../keyed.js"; import { openModal, textField } from "../modal.js"; import { toast } from "../toast.js"; import { pickFolder } from "./outputs.js"; +import { offerFlatten } from "./flatten.js"; -interface Job { phase: string; error?: string; counts: Record; path?: string; album_id?: number | null; stack_id?: number | null } +interface Job { phase: string; error?: string; counts: Record; path?: string; album_id?: number | null; stack_id?: number | null; flattenable?: Array<{ id: number; name: string }> } interface PackageRow { id: number; direction: "in" | "out"; kind: string; title: string; count: number; sender: string | null; path: string | null; created_ts: number; exists: boolean; album_id: number | null } interface Note { id: string; author: string; text: string; ts: number; mine: number } @@ -112,11 +113,16 @@ export async function packageFlow(ids: number[], album?: { id: number; name: str create.setAttribute("disabled", "true"); setText(create, "Encrypting..."); try { - const res = await api<{ job_id: string }>("/packages", { method: "POST", body: JSON.stringify({ - ids, album_id: album?.id ?? null, title: title.input.value.trim(), password: password.input.value, - dest: dest.input.value.trim() || "~/Desktop", include_location: location.input.checked, add_as: addAs.get(), - }) }); - const job = await waitJob(res.job_id); + const send = async (flatten: boolean) => { + const res = await api<{ job_id: string }>("/packages", { method: "POST", body: JSON.stringify({ + ids, album_id: album?.id ?? null, title: title.input.value.trim(), password: password.input.value, + dest: dest.input.value.trim() || "~/Desktop", include_location: location.input.checked, add_as: addAs.get(), + flatten_pdfs: flatten, + }) }); + return waitJob(res.job_id); + }; + let job = await send(false); + if (job.phase !== "done" && job.flattenable?.length && (await offerFlatten(job.flattenable))) job = await send(true); if (job.phase !== "done") throw new Error(job.error || "The package could not be made"); const rows = await api<{ packages: PackageRow[] }>("/packages"); const made = rows.packages.find((p) => p.direction === "out" && p.path === job.path); diff --git a/frontend/src/ui/components/sharing.ts b/frontend/src/ui/components/sharing.ts index 3d2fa20..a4c6225 100644 --- a/frontend/src/ui/components/sharing.ts +++ b/frontend/src/ui/components/sharing.ts @@ -8,6 +8,7 @@ import { iconEl } from "../icons.js"; import { patchList, setText } from "../keyed.js"; import { promptText } from "../prompt.js"; import { toast } from "../toast.js"; +import { offerFlatten } from "./flatten.js"; import { tileHooks } from "./grid.js"; import { pickFolder } from "./outputs.js"; import { selectbarExtras } from "./selectbar.js"; @@ -19,8 +20,27 @@ export async function galleryFlow(ids: number[]): Promise { if (!title) return; const dest = await pickFolder("Save the gallery in"); if (!dest) return; - const res = await api<{ job_id: string }>("/packages/gallery", { method: "POST", body: JSON.stringify({ ids, title, dest }) }); - pollJob(res.job_id, (job) => toast(`Web gallery written with ${countFmt(job.counts.written ?? 0)} item${(job.counts.written ?? 0) === 1 ? "" : "s"}${job.counts.skipped ? `, ${countFmt(job.counts.skipped)} private or unreadable skipped` : ""}`)); + writeGallery(ids, title, dest, false); +} + +function writeGallery(ids: number[], title: string, dest: string, flatten: boolean): void { + void api<{ job_id: string }>("/packages/gallery", { method: "POST", body: JSON.stringify({ ids, title, dest, flatten_pdfs: flatten }) }).then((res) => { + pollJob(res.job_id, (job) => { + const waiting = job.flattenable ?? []; + if (job.phase === "error" && waiting.length && !flatten) { + void offerFlatten(waiting).then((yes) => { + if (yes) writeGallery(ids, title, dest, true); + else toast("No gallery was written"); + }); + return; + } + if (job.phase === "error") { + toast(job.error || "The gallery could not be written", "error"); + return; + } + toast(`Web gallery written with ${countFmt(job.counts.written ?? 0)} item${(job.counts.written ?? 0) === 1 ? "" : "s"}${job.counts.skipped ? `, ${countFmt(job.counts.skipped)} private or unreadable skipped` : ""}`); + }); + }).catch((err) => toast((err as Error).message, "error")); } async function moveLibrary(ids: number[], shared: boolean): Promise { diff --git a/frontend/tests/flatten.test.ts b/frontend/tests/flatten.test.ts new file mode 100644 index 0000000..696351e --- /dev/null +++ b/frontend/tests/flatten.test.ts @@ -0,0 +1,22 @@ +import { describe, expect, it } from "vitest"; +import { offerFlatten } from "../src/ui/components/flatten.js"; + +describe("offering to flatten PDFs", () => { + it("never asks or flattens when nothing needs it", async () => { + await expect(offerFlatten([])).resolves.toBe(false); + expect(document.querySelector(".modal-backdrop")).toBeNull(); + }); + + it("flattens only after the person agrees", async () => { + const agreed = offerFlatten([{ id: 4, name: "plan.pdf" }]); + const dialog = [...document.querySelectorAll(".modal-backdrop")].pop() as HTMLElement; + expect(dialog.textContent).toContain("plan.pdf"); + (dialog.querySelector(".btn.primary") as HTMLButtonElement).click(); + await expect(agreed).resolves.toBe(true); + const declined = offerFlatten([{ id: 5, name: "map.pdf" }]); + const second = [...document.querySelectorAll(".modal-backdrop")].pop() as HTMLElement; + (second.querySelector(".btn:not(.primary)") as HTMLButtonElement).click(); + await new Promise((done) => setTimeout(done, 250)); + await expect(declined).resolves.toBe(false); + }); +}); From 0390da575705a5704fcf6304e8e8004234ea0dd9 Mon Sep 17 00:00:00 2001 From: gbarnai Date: Sun, 29 Nov 2026 16:49:26 -0500 Subject: [PATCH 35/35] feat: find plain copies that older vault seals left behind 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. --- README.md | 11 +- backend/HASHOUT_LOG.md | 9 + backend/app/main.py | 6 +- backend/app/routers/importer.py | 4 + backend/app/routers/library.py | 3 + backend/app/routers/plaincopies.py | 38 ++++ backend/app/services/plainscan.py | 234 ++++++++++++++++++++++ backend/app/vaultcrypt.py | 5 + backend/tests/test_plain_copies.py | 63 ++++++ frontend/HASHOUT_LOG.md | 7 + frontend/src/styles/app.css | 4 + frontend/src/ui/components/plaincopies.ts | 81 ++++++++ frontend/src/ui/components/settings.ts | 3 +- 13 files changed, 464 insertions(+), 4 deletions(-) create mode 100644 backend/app/routers/plaincopies.py create mode 100644 backend/app/services/plainscan.py create mode 100644 backend/tests/test_plain_copies.py create mode 100644 frontend/src/ui/components/plaincopies.ts diff --git a/README.md b/README.md index 86c8f62..5969213 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,20 @@

Formats

- Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR, DPX, PNG and TIFF frames as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app), fonts (OTF, TTF, WOFF, WOFF2) with a specimen, colour LUTs (.cube, .3dl) as a before and after, captions (SRT, VTT), ASE palettes and Lottie animations (JSON and .lottie), documents (PDF with page images, DOCX, PPTX, XLSX, CSV, Markdown, TXT, RTF, IDML) with full-text search, 3D models (GLB and glTF, OBJ, STL, PLY, text USD and USDZ drawn and turnable; STEP and IGES as point clouds; FBX, binary USD and Alembic catalogued) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP + Opens: JPEG, PNG, WebP, TIFF, HEIC and HEIF, PSD, TGA, ICO, JPEG 2000, SVG, 23 camera RAW extensions, EXR, HDR, DPX, PSB (embedded preview without ffmpeg) and JPEG XL (when ffmpeg has it) via ffmpeg, video via ffmpeg including MXF, MPEG, WMV, FLV and Ogg (played through a converted copy when the window cannot play them), R3D and BRAW as catalogue entries only, numbered EXR and DPX frames, and PNG and TIFF frames with four-digit numbers and one size, as one image sequence, audio (MP3, M4A, AAC, WAV, AIFF, FLAC, Ogg, Opus, CAF, WMA) via ffmpeg, WAV also without it, Form app project files (preview, manifest and Open in the app), fonts (OTF, TTF, WOFF, WOFF2) with a specimen, colour LUTs (.cube, .3dl) as a before and after, captions (SRT, VTT), ASE palettes and Lottie animations (JSON and .lottie), documents (PDF with page images, DOCX, PPTX, XLSX, CSV, Markdown, TXT, RTF, IDML) with full-text search, 3D models (GLB and glTF, OBJ, STL, PLY, text USD and USDZ drawn and turnable; STEP and IGES as point clouds; FBX, binary USD and Alembic catalogued) · Saves: JPEG, HEIC, PNG, TIFF, WebP · Sidecars: XMP +## Vault, sharing and files added in place + +- **Hidden, Recently Deleted and private albums** are encrypted at rest in the library's vault folder. +- **Files added in place** (Add in place on import) stay in their own folders until you hide, delete or make one private. formDAM then asks first, encrypts the original into the vault, checks the encrypted copy against it and only then removes the plain file from its folder. A sidecar formDAM wrote goes with it. +- **Restoring** puts the file back where it was, or beside that place under a new name when the place is taken. +- **Delete forever** of a file added in place gives the file back to its original place rather than destroying it, because formDAM never deletes a file it was only pointed at. While the vault is locked such an item stays in Recently Deleted until it can be given back. +- **Plain copies from older versions:** before this change, protecting a file added in place copied it into the library and left the original where it was. After the upgrade, formDAM scans the folders it has imported from or browsed (not the whole disk) for files that match protected items by their SHA-256. Settings > Vault & Keychain lists what it found, and each file moves into the vault (the same check, then removal) or is ignored only when you choose. Scan Again repeats the search. +- **Sharing without location:** exports, packages and web galleries rebuild a PDF without its metadata. When a PDF holds something formDAM cannot rebuild safely, it asks whether to flatten it instead: every page becomes a 150 dpi picture in a new PDF with no metadata, so its text can no longer be selected or searched. Nothing is flattened unless you agree; the API and automation flatten only when a request sets `flatten_pdfs`. + ## Under the hood - **Engine:** FastAPI and a SQLite catalog (`dam.db`) in a library folder you choose; originals are copied, moved or referenced in place, SHA-256 fingerprinted. diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index db73ebf..8ce0d1f 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,5 +1,14 @@ # backend HASHOUT_LOG · formDAM current: v1.27.2 · 2026-10-22 +### services/plainscan.py, routers/plaincopies.py · plain copies left by older seals +- refers-to: plainscan (new) TABLES known_folders and plain_copies, remember_folder, roots, scan, listing, ignore, move, start_once, run_once, DONE_KEY; vaultcrypt.sealed_for; routers/plaincopies.py (new) GET /vault/plain-copies, POST /vault/plain-copies/scan, /{id}/move, /{id}/ignore; main.py start_once after the vault starts; routers/importer.py and routers/library.py browse_disk remember folders; tests/test_plain_copies.py +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +Owner decision 2026-11-29. Before referenced originals were sealed in place, protecting one copied it into the library, sealed that copy and left the original where it was, and the outside path was forgotten. The scan finds such files without walking the disk: it looks only in folders formDAM knows about, which are the folders of items still added in place plus every folder imported from or opened in the Disk browser (recorded from now on in known_folders, never inside the library), three levels deep, at most 2,000 folders and 50,000 files, skipping dot entries and symlinked folders it has already seen. A file is hashed only when its size equals a vaulted item's size, and it is listed only when its SHA-256 equals that item's stored hash. Findings go to plain_copies with state found, ignored, changed or moved; an ignored file is never listed again. + +Nothing moves without the person. The list, a new scan, a move and an ignore all need the vault token, and a move needs the vault key open because the file is checked against the decrypted vault copy (size and SHA-256), the same check as sealing; a file that no longer matches is marked changed and left alone (409). After the check the file is removed from its folder, its Disk thumbnails are dropped and, when the item was a library copy, the vault item's home becomes that outside path and the item is marked added in place again, so restoring it puts the file back where the person had it. The scan runs once by itself after the upgrade, in a background thread, only on libraries that already have vaulted items (a new library just records that it is done), and Settings > Vault & Keychain can run it again. + ### services/pdfflatten.py, filestrip.py, pdfstrip.py, outputsvc.py, packagesvc.py, gallerysvc.py · Flatten to images - refers-to: pdfflatten (new) flatten, _render, _image_pdf, DPI, MAX_SIDE, MAX_PAGES, MAX_PIXELS; filestrip FlattenAvailable, strip_file flatten; pdfstrip.clean_pdf; outputsvc _copy_file_kind, _flattenable, export_job state flattenable; packagesvc _payload, _entry, build flatten_pdfs; gallerysvc FLATTEN_MARK, _refusal, flattenable, file_download, download_path, _needs_flatten, web_gallery flatten_pdfs; routers/packages.py BuildIn and GalleryIn flatten_pdfs; tests/test_pdf_flatten.py - kind: feature diff --git a/backend/app/main.py b/backend/app/main.py index 7b16b69..2ef3c68 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -10,7 +10,7 @@ from . import ffmpeg_fetch, mediacodecs, upgrade_thumbs, wiring from .db import init_db, q, ex, setting_get, setting_set from .services import classify -from .routers import albums, assets, audio, automation, browse, curate, dedup, discover, edit, files, geo, importer, library, mediaapi, organize, output, packages, people, render, syncapi, system, trash +from .routers import albums, assets, audio, automation, browse, curate, dedup, discover, edit, files, geo, importer, library, mediaapi, organize, output, packages, people, plaincopies, render, syncapi, system, trash from .security import local_only_guard mimetypes.add_type("text/javascript", ".js") @@ -31,6 +31,8 @@ async def lifespan(app: FastAPI): os.makedirs(cache_dir(), exist_ok=True) from . import vaultcrypt vaultcrypt.startup() + from .services import plainscan + plainscan.start_once() trash.purge_expired() from .services import housekeeping housekeeping.register(trash.purge_expired) @@ -82,7 +84,7 @@ def _reclassify_screenshots() -> None: app = FastAPI(title="formDAM", version=VERSION, lifespan=lifespan) app.middleware("http")(local_only_guard) -for module in (automation, system, importer, browse, render, edit, organize, files, geo, discover, output, curate, library, packages, syncapi, mediaapi, audio, assets, albums, people, trash, dedup): +for module in (automation, system, importer, browse, render, edit, organize, files, geo, discover, output, curate, library, packages, syncapi, mediaapi, audio, assets, albums, people, trash, dedup, plaincopies): app.include_router(module.router, prefix="/api") _dist = env("DIST", os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "frontend", "dist")) diff --git a/backend/app/routers/importer.py b/backend/app/routers/importer.py index 0cfc232..59ba692 100644 --- a/backend/app/routers/importer.py +++ b/backend/app/routers/importer.py @@ -30,6 +30,10 @@ def start_import(body: ImportIn): targets = [t for t in targets if os.path.exists(t)] if not targets: raise HTTPException(404, detail="That path does not exist. Check for typos.") + from ..services import plainscan + + for target in targets: + plainscan.remember_folder(target, "import") def run(state: Dict[str, Any]) -> None: counts = {"found": 0, "imported": 0, "duplicates": 0, "skipped": 0, "failed": 0} diff --git a/backend/app/routers/library.py b/backend/app/routers/library.py index 761ef4e..dcfe57b 100644 --- a/backend/app/routers/library.py +++ b/backend/app/routers/library.py @@ -235,6 +235,9 @@ def browse_disk(path: str = Query("", max_length=4000)): target = os.path.abspath(os.path.expanduser(path or "~")) if not os.path.isdir(target): raise HTTPException(404, detail="That folder does not exist") + from ..services import plainscan + + plainscan.remember_folder(target, "disk") dirs, files = [], [] guard = fsthumbs.ProtectedIndex() try: diff --git a/backend/app/routers/plaincopies.py b/backend/app/routers/plaincopies.py new file mode 100644 index 0000000..ae2793a --- /dev/null +++ b/backend/app/routers/plaincopies.py @@ -0,0 +1,38 @@ +from fastapi import APIRouter, HTTPException, Request + +from .. import jobs, vaultcrypt +from ..services import plainscan, vaultrefs +from .guard import require_vault + +router = APIRouter() + + +@router.get("/vault/plain-copies") +def plain_copies(request: Request): + require_vault(request) + return {"items": plainscan.listing(), "folders": len(plainscan.roots())} + + +@router.post("/vault/plain-copies/scan", status_code=202) +def scan_plain_copies(request: Request): + require_vault(request) + return {"job_id": jobs.start("plainscan", plainscan.scan)} + + +@router.post("/vault/plain-copies/{copy_id}/move") +def move_plain_copy(copy_id: int, request: Request): + require_vault(request) + try: + return plainscan.move(copy_id) + except vaultcrypt.Locked: + raise HTTPException(401, detail="Unlock the vault again to check this file against its vault copy") + except (plainscan.NotMovable, vaultrefs.OriginalKept) as exc: + raise HTTPException(409, detail=str(exc)) + + +@router.post("/vault/plain-copies/{copy_id}/ignore") +def ignore_plain_copy(copy_id: int, request: Request): + require_vault(request) + if not plainscan.ignore(copy_id): + raise HTTPException(404, detail="No such file in the list") + return {"ok": True} diff --git a/backend/app/services/plainscan.py b/backend/app/services/plainscan.py new file mode 100644 index 0000000..51208e0 --- /dev/null +++ b/backend/app/services/plainscan.py @@ -0,0 +1,234 @@ +import hashlib +import logging +import os +import time +from typing import Any, Dict, Iterator, List, Optional, Set + +from ..config import library_root +from ..db import connect, ex, exn, q, q1, setting_get, setting_set + +logger = logging.getLogger(__name__) + +TABLES = """ +CREATE TABLE IF NOT EXISTS known_folders( + path TEXT PRIMARY KEY, + source TEXT NOT NULL, + seen_ts REAL NOT NULL +); +CREATE TABLE IF NOT EXISTS plain_copies( + id INTEGER PRIMARY KEY, + media_id INTEGER NOT NULL, + path TEXT NOT NULL UNIQUE, + size INTEGER NOT NULL, + mtime REAL NOT NULL, + found_ts REAL NOT NULL, + state TEXT NOT NULL DEFAULT 'found' +); +""" +DONE_KEY = "plain_scan_v1" +MAX_DEPTH = 3 +MAX_FILES = 50_000 +MAX_FOLDERS = 2_000 +CHUNK = 1 << 20 + + +def ensure() -> None: + connect().executescript(TABLES) + + +def remember_folder(path: str, source: str) -> None: + folder = os.path.abspath(path if os.path.isdir(path) else os.path.dirname(path)) + if _inside_library(folder): + return + ensure() + ex("INSERT INTO known_folders(path, source, seen_ts) VALUES(?,?,?) ON CONFLICT(path) DO UPDATE SET seen_ts=excluded.seen_ts", + (folder, source, time.time())) + + +def _inside_library(path: str) -> bool: + root = os.path.abspath(library_root()) + try: + return os.path.commonpath([root, os.path.abspath(path)]) == root + except ValueError: + return False + + +def roots() -> List[str]: + ensure() + found = [row["path"] for row in q("SELECT path FROM known_folders ORDER BY seen_ts DESC LIMIT ?", (MAX_FOLDERS,))] + for row in q("SELECT rel_path FROM media WHERE referenced=1"): + if os.path.isabs(row["rel_path"]): + found.append(os.path.dirname(row["rel_path"])) + unique, seen = [], set() + for path in found: + if path not in seen and os.path.isdir(path) and not _inside_library(path): + seen.add(path) + unique.append(path) + return unique[:MAX_FOLDERS] + + +def _walk(root: str, seen: Set[str]) -> Iterator[os.DirEntry]: + stack = [(root, 0)] + while stack: + folder, depth = stack.pop() + real = os.path.realpath(folder) + if real in seen: + continue + seen.add(real) + try: + entries = list(os.scandir(folder)) + except OSError: + continue + for entry in entries: + if entry.name.startswith("."): + continue + try: + if entry.is_dir(follow_symlinks=False): + if depth < MAX_DEPTH and not _inside_library(entry.path): + stack.append((entry.path, depth + 1)) + elif entry.is_file(follow_symlinks=False): + yield entry + except OSError: + continue + + +def _digest(path: str) -> Optional[str]: + digest = hashlib.sha256() + try: + with open(path, "rb") as handle: + for block in iter(lambda: handle.read(CHUNK), b""): + digest.update(block) + except OSError: + return None + return digest.hexdigest() + + +def _protected_by_size() -> Dict[int, List[Any]]: + by_size: Dict[int, List[Any]] = {} + for row in q("SELECT m.id, m.sha256, m.size FROM media m JOIN vault_items v ON v.media_id=m.id"): + by_size.setdefault(row["size"], []).append(row) + return by_size + + +def scan(state: Optional[Dict[str, Any]] = None) -> Dict[str, int]: + ensure() + counts = {"folders": 0, "files": 0, "hashed": 0, "found": 0} + if state is not None: + state["counts"] = counts + by_size = _protected_by_size() + if not by_size: + return counts + seen: Set[str] = set() + for root in roots(): + counts["folders"] += 1 + for entry in _walk(root, seen): + counts["files"] += 1 + if counts["files"] > MAX_FILES: + return counts + try: + st = entry.stat(follow_symlinks=False) + except OSError: + continue + matches = by_size.get(st.st_size) + if not matches: + continue + digest = _digest(entry.path) + counts["hashed"] += 1 + hit = next((row for row in matches if row["sha256"] == digest), None) + if hit is not None and _record(hit["id"], entry.path, st): + counts["found"] += 1 + return counts + + +def _record(media_id: int, path: str, st: os.stat_result) -> bool: + known = q1("SELECT state FROM plain_copies WHERE path=?", (path,)) + if known is not None and known["state"] in ("ignored", "found"): + return known["state"] == "found" + ex("""INSERT INTO plain_copies(media_id, path, size, mtime, found_ts, state) VALUES(?,?,?,?,?, 'found') + ON CONFLICT(path) DO UPDATE SET media_id=excluded.media_id, size=excluded.size, mtime=excluded.mtime, + found_ts=excluded.found_ts, state='found'""", (media_id, path, st.st_size, st.st_mtime, time.time())) + return True + + +def listing() -> List[Dict[str, Any]]: + ensure() + out = [] + for row in q("""SELECT p.id, p.media_id, p.path, p.size, p.found_ts, m.name FROM plain_copies p + JOIN media m ON m.id=p.media_id WHERE p.state='found' ORDER BY p.found_ts DESC, p.id"""): + if os.path.isfile(row["path"]): + out.append(dict(row)) + else: + ex("DELETE FROM plain_copies WHERE id=?", (row["id"],)) + return out + + +def ignore(copy_id: int) -> bool: + ensure() + return exn("UPDATE plain_copies SET state='ignored' WHERE id=? AND state='found'", (copy_id,)) > 0 + + +class NotMovable(ValueError): + pass + + +def move(copy_id: int) -> Dict[str, Any]: + from .. import vaultcrypt + from . import fsthumbs, vaultrefs + + ensure() + copy = q1("SELECT * FROM plain_copies WHERE id=? AND state='found'", (copy_id,)) + if copy is None or not os.path.isfile(copy["path"]): + raise NotMovable("That file is no longer there") + row = q1("SELECT * FROM media WHERE id=?", (copy["media_id"],)) + sealed = vaultcrypt.sealed_for(copy["media_id"]) if row is not None and vaultcrypt.protected(row) else None + if sealed is None: + raise NotMovable("That item is no longer in the vault") + if not vaultrefs.sealed_matches(sealed, copy["path"]): + ex("UPDATE plain_copies SET state='changed' WHERE id=?", (copy_id,)) + raise NotMovable("The file changed since the scan and no longer matches the vault copy, so it was left alone") + vaultrefs.remove_original(copy["path"]) + fsthumbs.forget(copy["path"]) + item = q1("SELECT home_rel FROM vault_items WHERE media_id=?", (copy["media_id"],)) + if item is not None and not row["referenced"] and not os.path.isabs(item["home_rel"]): + _adopt_home(copy["media_id"], copy["path"]) + ex("UPDATE plain_copies SET state='moved' WHERE id=?", (copy_id,)) + return {"id": copy_id, "media_id": copy["media_id"], "path": copy["path"]} + + +def _adopt_home(media_id: int, path: str) -> None: + ex("UPDATE vault_items SET home_rel=? WHERE media_id=?", (path, media_id)) + ex("UPDATE media SET referenced=1, rel_path=? WHERE id=? AND EXISTS(SELECT 1 FROM vault_items WHERE media_id=?)", + (path, media_id, media_id)) + + +def start_once() -> None: + import threading + + ensure() + if setting_get(DONE_KEY): + return + if q1("SELECT 1 FROM vault_items LIMIT 1") is None: + setting_set(DONE_KEY, str(time.time())) + return + threading.Thread(target=_background_once, name="plain-scan", daemon=True).start() + + +def _background_once() -> None: + from ..db import reset_thread_conn + + try: + run_once() + finally: + reset_thread_conn() + + +def run_once() -> None: + if setting_get(DONE_KEY): + return + try: + counts = scan() + logger.info("plain copy scan: %s", counts) + except Exception as exc: + logger.warning("plain copy scan stopped: %s", exc) + return + setting_set(DONE_KEY, str(time.time())) diff --git a/backend/app/vaultcrypt.py b/backend/app/vaultcrypt.py index 4e174e3..2a28d16 100644 --- a/backend/app/vaultcrypt.py +++ b/backend/app/vaultcrypt.py @@ -626,6 +626,11 @@ def purge(media_id: int) -> None: _unlink(path) +def sealed_for(media_id: int) -> Optional[Sealed]: + item = _item(media_id) + return Sealed(_blob(item["blob"]), _open_ck(item)) if item is not None else None + + def is_vaulted(media_id: int) -> bool: return _item(media_id) is not None diff --git a/backend/tests/test_plain_copies.py b/backend/tests/test_plain_copies.py new file mode 100644 index 0000000..3b53bcd --- /dev/null +++ b/backend/tests/test_plain_copies.py @@ -0,0 +1,63 @@ +import os + +from tests.conftest import HEADERS, pattern, wait_job +from tests.support import sha + + +def sealed_the_old_way(client, tmp_path): + from app.services import libraryfs + + src = tmp_path / "outside" + os.makedirs(src) + pattern(320, 240).save(src / "pier.jpg", "JPEG", quality=90) + created = client.post("/api/import", json={"path": str(src), "reference": True}, headers=HEADERS) + assert wait_job(client, created.json()["job_id"])["phase"] == "done" + item = client.get("/api/media").json()["items"][0] + libraryfs.consolidate(item["id"]) + token = client.post("/api/vault/setup", json={"passkey": "pierkey99"}, headers=HEADERS).json()["token"] + assert client.post(f"/api/media/{item['id']}/hide", headers=HEADERS).status_code == 200 + return src / "pier.jpg", item, {**HEADERS, "x-dam-vault": token} + + +def test_a_plain_copy_left_by_an_old_seal_is_found_and_moved_only_on_request(client, tmp_path): + from app import vaultcrypt + + original, item, auth = sealed_the_old_way(client, tmp_path) + digest = sha(original) + assert original.exists() and vaultcrypt.is_vaulted(item["id"]) + assert client.get("/api/vault/plain-copies", headers=HEADERS).status_code == 401 + job = client.post("/api/vault/plain-copies/scan", headers=auth).json()["job_id"] + assert wait_job(client, job)["counts"]["found"] == 1 + listed = client.get("/api/vault/plain-copies", headers=auth).json()["items"] + assert [(row["media_id"], row["path"]) for row in listed] == [(item["id"], str(original))] + assert original.exists() + assert client.post(f"/api/vault/plain-copies/{listed[0]['id']}/move", headers=auth).status_code == 200 + assert not original.exists() and client.get("/api/vault/plain-copies", headers=auth).json()["items"] == [] + assert client.post(f"/api/hidden/{item['id']}/unhide", headers=auth).status_code == 200 + assert sha(original) == digest + + +def test_ignored_and_changed_copies_are_left_alone(client, tmp_path): + original, item, auth = sealed_the_old_way(client, tmp_path) + twin = original.with_name("pier copy.jpg") + twin.write_bytes(original.read_bytes()) + wait_job(client, client.post("/api/vault/plain-copies/scan", headers=auth).json()["job_id"]) + rows = {row["path"]: row["id"] for row in client.get("/api/vault/plain-copies", headers=auth).json()["items"]} + assert set(rows) == {str(original), str(twin)} + assert client.post(f"/api/vault/plain-copies/{rows[str(twin)]}/ignore", headers=auth).status_code == 200 + original.write_bytes(original.read_bytes() + b"edited") + assert client.post(f"/api/vault/plain-copies/{rows[str(original)]}/move", headers=auth).status_code == 409 + assert original.exists() and twin.exists() + wait_job(client, client.post("/api/vault/plain-copies/scan", headers=auth).json()["job_id"]) + assert client.get("/api/vault/plain-copies", headers=auth).json()["items"] == [] + + +def test_the_upgrade_scan_runs_once_and_never_moves_anything(client, tmp_path): + from app.db import setting_get, setting_set + from app.services import plainscan + + original, item, auth = sealed_the_old_way(client, tmp_path) + setting_set(plainscan.DONE_KEY, "") + plainscan.run_once() + assert setting_get(plainscan.DONE_KEY) and original.exists() + assert len(client.get("/api/vault/plain-copies", headers=auth).json()["items"]) == 1 diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index b386dd5..d0be390 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,12 @@ # frontend HASHOUT_LOG · formDAM current: v1.27.7 · 2026-10-25 +### ui/components/plaincopies.ts · Settings > Vault: plain copies of protected items +- refers-to: plaincopies.ts (new) plainCopiesPanel, confirmMove; settings.ts vault pane; styles/app.css .plain-copies, .plain-copy, .plain-copy-path +- kind: feature +- logged: after v1.32.4 · 2026-11-29 + +The Vault & Keychain pane gains a section for the plain-copy scan. Show Plain Copies (after the vault gate) lists what the scan found, each with its path and the item it matches, with Move into Vault and Ignore; Move asks first and says the file is checked against the protected copy, removed from its folder and put back there on restore. Scan Again runs the scan and reloads the list. The list appears only after a click, so nothing arrives late into a laid-out pane. + ### ui/components/flatten.ts · ask before flattening a PDF - refers-to: flatten.ts (new) offerFlatten, flattenText; outputs.ts runExport; packages.ts the create step; sharing.ts writeGallery; engine/types.ts JobState.flattenable; styles/app.css .flatten-list; tests/flatten.test.ts - kind: feature diff --git a/frontend/src/styles/app.css b/frontend/src/styles/app.css index 78f1edd..32a6da8 100644 --- a/frontend/src/styles/app.css +++ b/frontend/src/styles/app.css @@ -644,6 +644,10 @@ html.vibrancy #app { background: var(--vib-body, rgba(10,6,3,0.46)); } .settings-notices { max-width: 560px; margin-top: 6px; } .settings-notices summary { cursor: pointer; font-size: 12.5px; color: var(--text); } .settings-notices .settings-notices { margin-top: 10px; } +.plain-copies { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-width: 560px; } +.plain-copy { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--glass-bg-2); border: 1px solid var(--glass-border); } +.plain-copy-path { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; font-size: 12px; color: var(--text); } +.flatten-list { margin: 6px 0 0 18px; font-size: 12.5px; color: var(--text); } .settings-notices-text { height: 320px; margin: 8px 0 0; padding: 10px 12px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 ui-monospace, monospace; color: var(--text-muted); background: var(--glass-bg-2); border: 1px solid var(--glass-border); border-radius: 8px; } .settings-pane .preset-row { display: flex; gap: 8px; margin: 4px 0 14px; } .settings-pane .swatch-row { display: flex; gap: 10px; margin: 6px 0 4px; } diff --git a/frontend/src/ui/components/plaincopies.ts b/frontend/src/ui/components/plaincopies.ts new file mode 100644 index 0000000..af712cb --- /dev/null +++ b/frontend/src/ui/components/plaincopies.ts @@ -0,0 +1,81 @@ +import { api } from "../../engine/api.js"; +import { countFmt } from "../../engine/format.js"; +import { pollJob } from "../../engine/store.js"; +import { h } from "../dom.js"; +import { setText } from "../keyed.js"; +import { openModal } from "../modal.js"; +import { toast } from "../toast.js"; +import { vaultGate } from "./trash.js"; + +interface PlainCopy { id: number; media_id: number; path: string; name: string; size: number } + +function confirmMove(copy: PlainCopy): Promise { + return new Promise((resolve) => { + let answered = false; + const modal = openModal("Move this file into the vault?", 460, () => { if (!answered) resolve(false); }); + const cancel = h("button", { class: "btn", type: "button" }, "Cancel"); + const go = h("button", { class: "btn primary", type: "button" }, "Move into the Vault"); + cancel.addEventListener("click", () => modal.close()); + go.addEventListener("click", () => { + answered = true; + resolve(true); + modal.close(); + }); + modal.body.append( + h("p", { class: "settings-hint" }, `formDAM checks that ${copy.path} is the same file as the protected copy of ${copy.name}, then removes it from its folder. ` + + "Restoring the item later puts it back there."), + h("div", { class: "modal-actions" }, cancel, go)); + }); +} + +export function plainCopiesPanel(): HTMLElement { + const note = h("p", { class: "settings-hint" }, "Items protected before formDAM moved outside originals into the vault may have left a plain copy where you added them. Unlock to see what the scan found."); + const list = h("div", { class: "plain-copies" }); + const scanBtn = h("button", { class: "btn", type: "button" }, "Scan Again") as HTMLButtonElement; + const showBtn = h("button", { class: "btn", type: "button" }, "Show Plain Copies") as HTMLButtonElement; + + const render = (items: PlainCopy[], folders: number) => { + setText(note, items.length + ? `${countFmt(items.length)} plain file${items.length === 1 ? "" : "s"} match protected items (${countFmt(folders)} folders checked). Nothing moves until you choose.` + : `No plain copies of protected items were found in the ${countFmt(folders)} folders formDAM knows about.`); + list.replaceChildren(...items.map((copy) => { + const move = h("button", { class: "btn", type: "button" }, "Move into Vault"); + const ignore = h("button", { class: "btn", type: "button" }, "Ignore"); + move.addEventListener("click", async () => { + if (!(await confirmMove(copy))) return; + try { + await api(`/vault/plain-copies/${copy.id}/move`, { method: "POST" }); + toast("Moved into the vault"); + } catch (err) { + toast((err as Error).message, "error"); + } + void load(); + }); + ignore.addEventListener("click", async () => { + await api(`/vault/plain-copies/${copy.id}/ignore`, { method: "POST" }).catch(() => undefined); + void load(); + }); + return h("div", { class: "plain-copy" }, h("div", { class: "plain-copy-path" }, h("code", {}, copy.path), h("span", { class: "settings-hint" }, copy.name)), + h("div", { class: "row-gap" }, move, ignore)); + })); + }; + + const load = async () => { + if (!(await vaultGate())) return; + const res = await api<{ items: PlainCopy[]; folders: number }>("/vault/plain-copies"); + render(res.items, res.folders); + }; + + showBtn.addEventListener("click", () => void load().catch((err) => toast((err as Error).message, "error"))); + scanBtn.addEventListener("click", async () => { + if (!(await vaultGate())) return; + scanBtn.disabled = true; + const res = await api<{ job_id: string }>("/vault/plain-copies/scan", { method: "POST" }); + pollJob(res.job_id, () => { + scanBtn.disabled = false; + void load(); + }); + }); + return h("div", { class: "settings-plain" }, h("p", { class: "settings-section" }, "Plain copies of protected items"), note, + h("div", { class: "row-gap" }, showBtn, scanBtn), list); +} diff --git a/frontend/src/ui/components/settings.ts b/frontend/src/ui/components/settings.ts index 2ea68f5..ccad46f 100644 --- a/frontend/src/ui/components/settings.ts +++ b/frontend/src/ui/components/settings.ts @@ -10,6 +10,7 @@ import { openModal, textField } from "../modal.js"; import { toast } from "../toast.js"; import { privacyPane } from "./privacy.js"; import { thirdPartyNotices } from "./notices.js"; +import { plainCopiesPanel } from "./plaincopies.js"; export type BackgroundControl = { enable: () => void; disable: () => void; update: (bg: { radius: number; glow: number; bloom: number }) => void }; @@ -450,7 +451,7 @@ export function openSettings(): void { thirdPartyNotices()), ] }, { key: "library", label: "Library", icon: "library", nodes: [libraryInfo] }, - { key: "vault", label: "Vault & Keychain", icon: "lock", nodes: [keychainWrap] }, + { key: "vault", label: "Vault & Keychain", icon: "lock", nodes: [keychainWrap, plainCopiesPanel()] }, { key: "privacy", label: "Privacy", icon: "eyeOff", nodes: [privacyPane()] }, ];