<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muhammad Adil</title>
    <description>The latest articles on DEV Community by Muhammad Adil (@daily-solution).</description>
    <link>https://dev.to/daily-solution</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4211108%2F6405fe6c-497b-4153-88b5-e9b73c4fa402.png</url>
      <title>DEV Community: Muhammad Adil</title>
      <link>https://dev.to/daily-solution</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/daily-solution"/>
    <language>en</language>
    <item>
      <title>I built browser-only image, PDF and video tools – nothing gets uploaded</title>
      <dc:creator>Muhammad Adil</dc:creator>
      <pubDate>Tue, 27 Oct 2026 14:45:24 +0000</pubDate>
      <link>https://dev.to/daily-solution/i-built-browser-only-image-pdf-and-video-tools-nothing-gets-uploaded-8a</link>
      <guid>https://dev.to/daily-solution/i-built-browser-only-image-pdf-and-video-tools-nothing-gets-uploaded-8a</guid>
      <description>&lt;p&gt;Most "free online converters" upload your files to a server. For an iPhone photo of your passport or a scanned ID card, that is not great. So I built &lt;strong&gt;&lt;a href="https://dailysolutions.vercel.app" rel="noopener noreferrer"&gt;Daily Solutions&lt;/a&gt;&lt;/strong&gt; – a set of image, PDF, video and health tools where &lt;strong&gt;nothing leaves your browser&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is how it works under the hood, and a few things that surprised me along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js&lt;/strong&gt; with every tool page statically generated (80+ pages, each with its own title, FAQs and JSON-LD)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Canvas + WebAssembly&lt;/strong&gt; for images&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pdf-lib&lt;/strong&gt; and &lt;strong&gt;PDF.js&lt;/strong&gt; for PDFs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ffmpeg.wasm&lt;/strong&gt; for audio and video&lt;/li&gt;
&lt;li&gt;No backend for file processing at all – the server only serves static files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Images: the browser can do more than you think
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;canvas.toBlob()&lt;/code&gt; already encodes JPG and PNG everywhere, and WebP in most browsers. For the rest I load small codecs only when they are needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HEIC&lt;/strong&gt; (iPhone photos) is decoded with libheif via &lt;code&gt;heic2any&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AVIF/WebP&lt;/strong&gt; fall back to jSquash (Squoosh codecs compiled to WASM) when the browser can't encode them natively&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TIFF&lt;/strong&gt; via UTIF.js, &lt;strong&gt;GIF&lt;/strong&gt; via gifenc, and &lt;strong&gt;BMP&lt;/strong&gt; is a 30-line hand-written encoder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The feature people use most is "compress image to 50 KB" (exam and job portals love strict limits). That is a binary search over the quality setting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;best&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;format&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blob&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;maxBytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;best&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;blob&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seven encodes get within about 1% of the best possible quality. If even the lowest quality doesn't fit, the tool says so and suggests a smaller width instead of silently returning an ugly image.&lt;/p&gt;

&lt;h2&gt;
  
  
  PDFs: pdf-lib for structure, PDF.js for pixels
&lt;/h2&gt;

&lt;p&gt;Merging, splitting, rotating, deleting and reordering pages are pure structural operations – &lt;code&gt;pdf-lib&lt;/code&gt; copies pages without touching their content, so quality is preserved and it is fast.&lt;/p&gt;

&lt;p&gt;Compression is harder. A lossless re-save with object streams helps a little; for scanned documents the real win is re-rendering each page with PDF.js and embedding it as an optimized JPEG. To hit a target like "under 200 KB", I binary-search over a ladder of (scale, quality) steps, so it takes about 3 renders instead of 7.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gotcha:&lt;/strong&gt; PDF.js renders through &lt;code&gt;requestAnimationFrame&lt;/code&gt;. In a background tab rAF is paused, so compression silently stopped whenever a user switched tabs. Rendering with &lt;code&gt;intent: "print"&lt;/code&gt; avoids rAF and fixed it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Video: ffmpeg.wasm
&lt;/h2&gt;

&lt;p&gt;The FFmpeg core is ~30 MB, so it is loaded only when someone presses "Convert" and is then cached by the browser. Two lessons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Bundlers rewrite the worker's dynamic &lt;code&gt;import()&lt;/code&gt;&lt;/strong&gt;, which breaks loading the core. Serving ffmpeg's worker files unbundled from &lt;code&gt;/public&lt;/code&gt; and passing an absolute &lt;code&gt;classWorkerURL&lt;/code&gt; solved it.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ultrafast&lt;/code&gt; x264 makes files bigger than the input; &lt;code&gt;superfast&lt;/code&gt; is a much better speed/size balance for MOV → MP4.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Things I'd tell my past self
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Turbopack hung forever on my Windows machine; webpack builds fine.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;next/font/google&lt;/code&gt; needs network access at build time – system fonts are faster anyway.&lt;/li&gt;
&lt;li&gt;A static site with &lt;code&gt;dynamicParams = false&lt;/code&gt; gives real 404s for unknown URLs (important for SEO).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dailysolutions.vercel.app/compress-image-to-50kb/" rel="noopener noreferrer"&gt;Compress image to 50 KB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dailysolutions.vercel.app/heic-to-jpg/" rel="noopener noreferrer"&gt;HEIC to JPG&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dailysolutions.vercel.app/compress-pdf-to-200kb/" rel="noopener noreferrer"&gt;Compress PDF to 200 KB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dailysolutions.vercel.app/mov-to-mp4/" rel="noopener noreferrer"&gt;MOV to MP4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dailysolutions.vercel.app/all-tools/" rel="noopener noreferrer"&gt;All tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The code is on &lt;a href="https://github.com/muhammadadil-ameer/daily-solutions" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Feedback welcome – which tool should I add next?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webassembly</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
