<?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: Mern-Umair</title>
    <description>The latest articles on DEV Community by Mern-Umair (@mernumair).</description>
    <link>https://dev.to/mernumair</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%2F4207253%2F2d2b4d69-cc1f-4ee3-9a2e-d7ce053963e3.png</url>
      <title>DEV Community: Mern-Umair</title>
      <link>https://dev.to/mernumair</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mernumair"/>
    <language>en</language>
    <item>
      <title>Pakistan's online passport photo limit is now 20 KB (not 5 MB)</title>
      <dc:creator>Mern-Umair</dc:creator>
      <pubDate>Tue, 17 Nov 2026 13:49:36 +0000</pubDate>
      <link>https://dev.to/mernumair/pakistans-online-passport-photo-limit-is-now-20-kb-not-5-mb-4cii</link>
      <guid>https://dev.to/mernumair/pakistans-online-passport-photo-limit-is-now-20-kb-not-5-mb-4cii</guid>
      <description>&lt;p&gt;If you are applying for or renewing a Pakistani passport online, there is one number that has changed and that many guides still get wrong: the size of the photo file.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the official page says
&lt;/h2&gt;

&lt;p&gt;The photo requirements page of the DGIP e-Services portal (&lt;code&gt;onlinemrp.dgip.gov.pk/photo-requirements&lt;/code&gt;) now says, under "Photograph file size":&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The digital file size of the photograph should not exceed 20KB.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The upload box on the same page reads "Choose file (JPG / PNG max 20KB)". I read the page on 16 and 17 November 2026.&lt;/p&gt;

&lt;p&gt;Several articles and photo services still give 5 MB (and some give 350 KB, which is the limit of the separate NADRA visa portal). That was the figure on the portal earlier. If you follow it with a normal phone photo, which is 2 to 5 MB, the upload fails.&lt;/p&gt;

&lt;h2&gt;
  
  
  What has not changed
&lt;/h2&gt;

&lt;p&gt;The page still asks for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a photo 45 mm high by 35 mm wide (35 × 45 mm),&lt;/li&gt;
&lt;li&gt;a plain white background,&lt;/li&gt;
&lt;li&gt;a photo not more than 6 months old,&lt;/li&gt;
&lt;li&gt;a close-up of your full head and shoulders, facing the camera with a neutral expression.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also says you cannot use a photo that has been cut down from a larger picture, and that the picture must not be edited in other software.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to make a file under 20 KB
&lt;/h2&gt;

&lt;p&gt;A 35 × 45 mm photo at 300 dpi is 413 × 531 pixels. To get below 20 KB you do not need to shrink the picture much, you mainly need to compress the JPG. Two things help a lot:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A plain background.&lt;/strong&gt; A flat white wall compresses to almost nothing, which leaves the bytes for your face.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Good light.&lt;/strong&gt; Even light with no shadow on the wall gives a cleaner picture at a small file size.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to do it in the browser without uploading your photo anywhere, the passport page on FormKB does it on your device: &lt;a href="https://formkb.com/online-passport-photo-size" rel="noopener noreferrer"&gt;https://formkb.com/online-passport-photo-size&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I keep the official wording, the date I checked it and a link to the portal on that page. If the portal changes again, I update the page and list the correction on the &lt;a href="https://formkb.com/about" rel="noopener noreferrer"&gt;About page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  One thing to check yourself
&lt;/h2&gt;

&lt;p&gt;Portals change without notice. Before you upload, open the portal's own page once and read the current number. If it differs from this article, trust the portal and tell me, and I will fix the page.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>pakistan</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I built a free, offline photo resizer for Pakistani government forms (FPSC, PPSC, NADRA) — here's what the forms actually require</title>
      <dc:creator>Mern-Umair</dc:creator>
      <pubDate>Mon, 02 Nov 2026 16:09:50 +0000</pubDate>
      <link>https://dev.to/mernumair/i-built-a-free-offline-photo-resizer-for-pakistani-government-forms-fpsc-ppsc-nadra-heres-1anf</link>
      <guid>https://dev.to/mernumair/i-built-a-free-offline-photo-resizer-for-pakistani-government-forms-fpsc-ppsc-nadra-heres-1anf</guid>
      <description>&lt;p&gt;Every government form in Pakistan has a different photo rule, and none of them explain it well: FPSC wants a JPG under 30 KB, PPSC under 25 KB, Pak Navy under 20 KB, the passport portal 350x467 pixels. A phone photo is 3 MB. Thousands of applications fail at the upload step every week.&lt;/p&gt;

&lt;p&gt;So I built FormKB (&lt;a href="https://formkb.com" rel="noopener noreferrer"&gt;https://formkb.com&lt;/a&gt;), a set of browser-only tools: the photo never leaves the device (Canvas API, no upload), and each form has a preset read from the organisation's own guidelines PDF, quoted on the page.&lt;/p&gt;

&lt;p&gt;A few things I learned building it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The limits on blogs are often wrong. I read the official documents and found PPSC's "140x177" and NTS's "50 KB" repeated everywhere without a source. Every preset on the site links the PDF it came from: &lt;a href="https://formkb.com/photo-size-requirements" rel="noopener noreferrer"&gt;https://formkb.com/photo-size-requirements&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"KB" is not a pixel size. People search "20 KB photo size in pixels" constantly, so I wrote the conversion down with a table instead of a formula that doesn't exist: &lt;a href="https://formkb.com/guides/kb-to-pixels" rel="noopener noreferrer"&gt;https://formkb.com/guides/kb-to-pixels&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Binary search on JPEG quality beats guessing. The resizer picks the largest pixel size and quality that still fits under the limit, in the browser, usually in under a second.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The same engine works for other countries' forms once you have the official spec: UK passport (600x750 px, 50 KB–10 MB), Bangladesh Teletalk (300x300 under 100 KB), India's JEE Main (10–200 KB): &lt;a href="https://formkb.com/jee-main-photo-signature-size" rel="noopener noreferrer"&gt;https://formkb.com/jee-main-photo-signature-size&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Stack: Next.js static export on Cloudflare, no backend, no analytics. Tests run the real tools in headless Chrome against the stated limits (252 checks).&lt;/p&gt;

&lt;p&gt;If you've fought a government upload form, I'd like to hear which one; the next presets come from those stories.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>showdev</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>I lost two days of research tabs to a Chrome update, so I built Tabcove: automatic, local-only tab backups</title>
      <dc:creator>Mern-Umair</dc:creator>
      <pubDate>Sun, 25 Oct 2026 19:38:55 +0000</pubDate>
      <link>https://dev.to/mernumair/i-lost-two-days-of-research-tabs-to-a-chrome-update-so-i-built-tabcove-automatic-local-only-tab-4g70</link>
      <guid>https://dev.to/mernumair/i-lost-two-days-of-research-tabs-to-a-chrome-update-so-i-built-tabcove-automatic-local-only-tab-4g70</guid>
      <description>&lt;p&gt;Last month Chrome restarted for an update while I had two days of research open across three windows. "Restore" brought back one window. Session Buddy had eaten my saved sessions the week before. So I built the thing I wanted and published it this week.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Tabcove does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Backs up every window on a timer (only when something changed) and keeps a window you close so you can bring it back.&lt;/li&gt;
&lt;li&gt;Save all windows as a named session with Ctrl+Shift+S, or "save and close all" to free memory.&lt;/li&gt;
&lt;li&gt;Restore a whole session, one window, or just the tabs you tick. Tabs open lazily, so 200 tabs come back in seconds without eating RAM.&lt;/li&gt;
&lt;li&gt;Search across every saved session and backup.&lt;/li&gt;
&lt;li&gt;Keeps pinned tabs and tab groups.&lt;/li&gt;
&lt;li&gt;No account, no sync server, no analytics. Everything stays in the browser. Export to a file any time; imports OneTab and Session Buddy exports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Free version keeps 24 hours of backups and 5 saved sessions. Pro is a one-time payment, no subscription.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hard part: Manifest V3 service workers
&lt;/h2&gt;

&lt;p&gt;MV3 kills the background service worker after about 30 seconds of inactivity, so "back up every 30 minutes" cannot be a setInterval. Tabcove uses chrome.alarms for the timer and chrome.storage.session for in-memory state, and every backup is written as a complete snapshot rather than a diff, so a worker dying mid-write never leaves a half-saved session. Restores are done in batches of windows with tabs created as discarded, which is what keeps 200-tab restores fast.&lt;/p&gt;

&lt;p&gt;Stack: Preact + Vite + TypeScript, zero runtime dependencies, about 30 KB zipped.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Chrome Web Store: &lt;a href="https://chromewebstore.google.com/detail/tabcove-save-restore-back/ccmjgbajjpimmhdnacanbbhmfjecjnlp" rel="noopener noreferrer"&gt;https://chromewebstore.google.com/detail/tabcove-save-restore-back/ccmjgbajjpimmhdnacanbbhmfjecjnlp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Edge Add-ons: &lt;a href="https://microsoftedge.microsoft.com/addons/detail/dhjlfjgodmjdbnnpaebngfdiplpdegph" rel="noopener noreferrer"&gt;https://microsoftedge.microsoft.com/addons/detail/dhjlfjgodmjdbnnpaebngfdiplpdegph&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;a href="https://github.com/Mern-Umair/tabcove" rel="noopener noreferrer"&gt;https://github.com/Mern-Umair/tabcove&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What is missing for you? I am shipping fixes weekly and would rather build what people actually ask for.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
