File Engine is a high-performance, ultra-premium client-side application designed to dynamically compress or expand files (Images & PDFs) to an exact target kilobyte threshold. Built using an architectural philosophy of complete privacy and local computation, it utilizes a synchronized bi-directional binary-search optimization loop to match constraints directly inside the user's browser.
Featuring a hyper-responsive, fluid iOS-inspired Glassmorphism UI with full persistent configuration mapping across sessions.
- 100% Client-Side Prototyping: Zero server uploads. Data never leaves the browser, ensuring complete security and zero data leaks.
- Dual-Engine Pipeline: Synchronized handling of bitmap image formats (
.jpg,.png,.webp) alongside complex multi-page document streams (.pdf). - Bi-Directional Optimization: * Shrink Mode: Recursively calculates dimensions and image-quantization scales across multiple canvas rendering steps to match down-scaled limits.
- Grow Mode: Formats structural ASCII buffer paddings inside standard file schemas to exactly hit expanded size targets safely.
- Session Persistence: Deep state-tracking mapping via
localStorage. Retains targets, filenames, structural parameters, and structural UI preferences seamlessly through hard page reloads.
- Apple System Gradients: 1:1 reflection of iOS Light Canvas (
#f2f2f7) and iOS System Dark Canvas (#1c1c1e). - Smoked Glass Interfaces: Dynamic structural saturation (160%) and heavy surface blur filters (30px) balanced for extreme high-contrast readability.
- Zero-Flash State Initialization: The system evaluates user-configured configurations prior to parsing DOM nodes to eliminate structural layout shifts or color flashing on load.
- Languages: Semantic HTML5, CSS3 Variable Architectures, Vanilla ECMAScript (ES6+).
- Compilation Libraries: * PDF.js v3.4 — Async low-level document rasterization layer.
- PDF-Lib v1.17 — Binary array-buffer reconstruction and vector page modification.
- jQuery v3.6 — Clean async state event normalization.
When a file is loaded, the engine isolates the file extension header arrays, updates the runtime status block, and stores system keys into memory.
For compression actions, the application deploys an iterative parameters loop:
- Generates a virtual offscreen
<canvas>instance. - Determines structural dimension scaling boundaries (
$W \times H$ ). - Performs numerical adjustments via: $$\text{Quality}{\text{new}} = \frac{\text{Quality}{\text{min}} + \text{Quality}_{\text{max}}}{2}$$
- Evaluates target constraints recursively until convergence limits (
$<1%$ margin of error) are satisfied.
For expansion actions, the engine intercepts the underlying ArrayBuffer, preserves structural trailer blocks, and writes exact, safe alphanumeric characters to the trailing data segment to scale up the file volume neatly.
As a true pure-client utility, this application requires zero build compilation setups or package-manager footprints.
- Clone the repository into your ecosystem:
git clone [https://github.com/harsh-dev-live/file-engine.git](https://github.com/harsh-dev-live/file-engine.git)