The problem
Many exam and recruitment forms ask for a photograph and a signature with exact
requirements. A form might say the photo must be 200 by 230 pixels, between 20 KB
and 50 KB, and in JPEG format. The signature often has a different size.
If the file does not match, the form rejects it. The applicant has to fix the
image and try again.
Finding the requirements is also hard. They are usually inside a long PDF notice
or on a portal page. Many people then upload their photo to a random website to
resize it. That is a privacy risk for an identity document.
What PakkaPix does
PakkaPix is a web app that prepares one image for one form. It runs in the
browser. The image is never uploaded.
The user picks an exam or form, or types the width and height. Then the user
adds a photo or signature, crops it, resizes it, compresses it to the required
file size, and checks the result before downloading.
How it works
There are two parts.
The first part is the browser app. It does all image work: decoding, cropping,
resizing, encoding to JPEG, PNG or WebP, file-size fitting, DPI metadata, and a
final check. The final check re-decodes the file that was produced and confirms
its format, size and dimensions. The image bytes never leave the device.
The second part is a small server. It is a Cloudflare Worker with a D1 database.
It keeps a catalogue of exam requirements. Each catalogue entry links to the
public source it came from, so the app can show why a value is used. The server
only returns public metadata. It has no image upload endpoint.
The app also works offline. It is an installable PWA, and the converter keeps
working without a network.
How it uses SerpApi
PakkaPix uses SerpApi in two ways.
Google AI Mode. When a user types an exam name that is not in the catalogue,
the Worker calls the Google AI Mode API (engine=google_ai_mode) with the exam
name and an India context. It asks for one table with photograph and signature
requirements: minimum and maximum resolution in pixels, and minimum and maximum
file size in KB. SerpApi returns text_blocks with a table and a
reconstructed_markdown field. The Worker reads the table rows, converts values
into a preset, and saves it to the database. If the answer covers more than one
exam, each exam becomes its own preset and the user chooses.
This data matters because the numbers are the whole point of the app. Without a
structured answer, the user would have to read a long PDF and copy the values by
hand.
Google Search for corrections. On a schedule, the Worker uses the Google
Search API (engine=google, gl=in, hl=en) to check whether an official
notice has been changed. It looks for correction or amendment keywords and
flags possible updates for review. Search results are cached, and each search
is counted against a monthly budget.
PakkaPix also uses SerpApi AI Mode as a fallback when it reads a notice the user
selected. The Worker first fetches the page or PDF and extracts text with simple
rules. If that does not find both values, it asks AI Mode with the exam name as
context, then checks every returned number against the fetched text. Numbers
that cannot be checked are marked as unverified.
All AI answers are saved as presets that are marked needs review. They are
searchable and usable, but they are never labelled as official. The user
confirms the values before applying them.
To control cost, results are cached per notice URL and per exam name, and the
deployment reserves at most 50 SerpApi attempts per month.
What we store and what we do not
The server stores public exam metadata, source passages, cached answers, and
search terms. It does not store images and it does not receive measurements from
the user's device. The browser stores a theme preference, a service-worker
cache, and local preset settings.
Limits
PakkaPix checks technical conformance. It cannot promise that a portal will
accept a file.
AI answers can be incomplete or wrong. Some notices only list file sizes and no
pixel sizes, in which case the app uses a working size and says so. Some PDFs do
not extract cleanly, so the app falls back to AI Mode or asks the user to enter
the values manually.
Links
- App: https://pakkapix.sumeetnaik.com/
- Source: https://github.com/sumeetweb/PakkaPix
- App flow and diagrams: https://github.com/sumeetweb/PakkaPix/blob/main/docs/app-flow.md
Top comments (2)
Re-decoding the produced file is a useful final boundary. I'd pair it with a preset-provenance fixture: the original notice says 20-50 KB, then a correction changes only the signature limit while an offline client still has the old preset. Keep the source passage/version and verification state attached to the selected preset, and flag that a newer correction exists rather than letting technical conformance look like current official conformance. Does that provenance survive the service-worker cache and preset update?
Thanks for the example. The local cache currently keeps one preset version per exam, so opening a newer version replaces the previous cached snapshot. The exact signature correction plus offline client fixture you described isn’t covered yet. Preserving the older selected version and showing the correction alongside it would make that update path clearer.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.