{"id":16103518,"url":"https://github.com/dbrant/fileviewer","last_synced_at":"2025-10-26T06:43:42.996Z","repository":{"id":68742738,"uuid":"51278464","full_name":"dbrant/fileviewer","owner":"dbrant","description":"Javascript framework for parsing and viewing the internal binary structure of various file formats.","archived":false,"fork":false,"pushed_at":"2025-02-22T23:05:26.000Z","size":180,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-19T15:59:36.318Z","etag":null,"topics":["file-format","fileviewer","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbrant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-08T04:03:27.000Z","updated_at":"2025-09-08T12:42:28.000Z","dependencies_parsed_at":"2024-10-27T17:26:48.465Z","dependency_job_id":"7ec0a940-f7de-49ab-85f3-d9a8b2862af9","html_url":"https://github.com/dbrant/fileviewer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dbrant/fileviewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrant%2Ffileviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrant%2Ffileviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrant%2Ffileviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrant%2Ffileviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbrant","download_url":"https://codeload.github.com/dbrant/fileviewer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrant%2Ffileviewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281069074,"owners_count":26438554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-format","fileviewer","javascript"],"created_at":"2024-10-09T18:57:51.489Z","updated_at":"2025-10-26T06:43:42.966Z","avatar_url":"https://github.com/dbrant.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fileviewer.js\nJavascript framework for parsing and viewing the internal binary structure of various file formats.\n\nThis allows the user to drag and drop local files onto the browser, and see a complete breakdown of the file's binary structure (using the FileReader API found in modern browsers). This also implies that we can:\n- Decode and display graphics formats not supported natively by the browser.\n- Show all kinds of metadata from files, such as Exif data from photos.\n- Detect the correct internal format of the file, even if its extension is wrong.\n- Assist digital preservation experts by ensuring that obsolete formats continue to be supported, in an open-source way.\n\nAvailable at http://dbrant.github.io/fileviewer/\n\n## Current support\n\nThis currently supports the following formats: AMR, BMP, BPG, DICOM, GIF, JPG, MOV, MP3, OGG (OGA, OGV), OLE, PCX, PNG, PNM (PPM, PGM, PBM), PSD, RAF, RAR, RAS, RIFF, SGI, TGA, TIFF, WEBP, XPM, ZIP.\n\n## Adding a custom format\n\nThis framework is intended to be extensible. That is, I've tried to make it as easy as possible to add a new file format:\n- If you look in the `fileformats.js` file, you'll see the master `FileFormatList` structure that is composed of `FileFormat` objects.\n- Make a duplicate of one of the `FileFormat` objects, and add it to the end of the `FileFormatList` structure.\n- The parameters for the `FileFormat` are as follows, in order:\n    - File extension associated with this format.\n    - Short description of this format (preferably without HTML).\n    - Long description of this format (HTML encouraged).\n    - List of scripts to be loaded for processing this format. One of these scripts must contain a `parseFormat` function (see below).\n    - Detector function for detecting whether a given file matches this format. This is where you can test the first few bytes of the file for any \"magic\" header that positively identifies the file as having your format. Return `true` for a positive match, or `false` otherwise.\n\n### The `parseFormat` function\n\nAt least one of the scripts for processing your file format must contain a `parseFormat` function, with a single parameter that will be a `DataReader` object (see `datareader.js`).\nThe `DataReader` provides convenient, abstract methods for reading all kinds of data fields (in either endianness) from the file, at absolute offsets. You can also create a `DataStream` object (with a `DataReader` in the constructor) and read data sequentially, as in a stream.\n\nThe return value of the `parseFormat` function must be an instance of `ResultNode`, which is a key-value pair object (both of which are strings, which can contain HTML), which will be displayed in the output page. A `ResultNode` can have child `ResultNode`s, meaning that you can create a tree of resulting key-value pairs that fully describe the binary format that you're parsing.\n\n----\n\nCopyright \u0026copy; 2016 Dmitry Brant\n\nhttp://dmitrybrant.com\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrant%2Ffileviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbrant%2Ffileviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrant%2Ffileviewer/lists"}