Photo Location Guard

Photo Location Guard is a copy-paste React component that stops photo leaked my home location before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/photo-location-guard
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsPhoto leaked my home location

Was this component page useful?

How do I install Photo Location Guard?

pnpm dlx shadcn@latest add @bollard/photo-location-guard

The files land in your project. They're yours to edit.

How do I use Photo Location Guard in React?

photo-location-guard-usage.tsx
import { PhotoLocationGuard } from "@/components/ui/photo-location-guard"

<PhotoLocationGuard label="Add a photo to your post" value={photo} onValueChange={setPhoto} describeLocation={placeName} />

What input mistakes does Photo Location Guard catch?

  • GPS coordinates, with how precise they are
  • Capture time and time zone
  • Camera serial number and owner name
  • Embedded preview that can show the uncropped original
  • XMP location fields

What props does Photo Location Guard accept?

PhotoLocationGuard props
PropTypeDefault
value

Controlled photo.

File | null—
defaultValue

Initial photo when uncontrolled.

File | nullnull
onValueChange

Called with the chosen photo, and with the cleaned copy after "Remove location".

(file: File | null) => void—
describeLocation

Optional reverse geocoder, e.g. `(lat, lon) => "Shivajinagar, Pune"`. Without it only coordinates are shown.

(latitude: number, longitude: number) => string | Promise<string>—
mapUrl

Map link for the coordinates. Return "" to hide it.

(latitude: number, longitude: number) => stringosm
locale

Locale for the capture time.

string—
quality

JPEG quality of the cleaned copy, 0–1.

number0.92
label

Visible label.

string"Photo"
chooseLabel

Button text to choose a photo.

string"Choose a photo"
changeLabel

Button text to pick a different photo.

string"Change"
title

Heading over the findings when the photo has a location.

string"This photo shows where it was taken"
detailsTitle

Heading when there's no location but other details.

string"This photo carries hidden details"
removeLabel

Button text to remove location data.

string"Remove location"
removeHint

Explains what removing does.

string"Also removes the time, camera details and hidden preview."
removingLabel

Button text while removing.

string"Removing…"
removedText

Shown after location is removed.

string"Location removed. Checked the new file: nothing left to …
cleanText

Shown when nothing revealing is found.

string"No location or camera details in this photo."
errorText

Shown when the file can't be read.

string"Couldn't clean this photo. Try exporting it without loca…
unsupportedText

Shown for a file type it can't read.

string"Only JPEG photos are checked for location."
labels

Row names and small texts in the findings list.

Partial<typeof DEFAULT_LABELS>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Photo Location Guard accessible?

  • File input has a visible label and buttons to choose or change
  • Findings are in a polite live region; the details list is labelled
  • Remove shows aria-busy while working; errors use role=alert

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Strip metadata on the server too before publishing uploads; a client-side strip can be skipped.

  • Reads JPEG metadata; other formats show an unsupported notice
  • Re-encoding drops all metadata and slightly changes image quality
  • Can't remove location visible in the picture itself (street signs, landmarks)

What expensive mistakes does Photo Location Guard stop?

Photo leaked my home location

Also known as

exif · gps · photo upload · image metadata · privacy · location · avatar upload · marketplace photos

Field type

What dependencies does Photo Location Guard require?

Photo Location Guard facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePhoto Location Guard
Registry identifier@bollard/photo-location-guard
Install commandnpx shadcn@latest add @bollard/photo-location-guard
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Photo Location Guard

What form validation mistake does Photo Location Guard catch?

Photo Location Guard prevents photo leaked my home location. Reads a photo's EXIF and XMP before upload and offers one-tap location removal, so a picture doesn't reveal where and when it was taken. Catches: GPS coordinates, with how precise they are, Capture time and time zone, Camera serial number and owner name, Embedded preview that can show the uncropped original, XMP location fields. Limitation: validate photo-location-guard schemas on backend.

How do I install photo-location-guard with shadcn?

Run `npx shadcn@latest add @bollard/photo-location-guard`. Sources added: registry/default/photo-location-guard/exif.ts, registry/default/photo-location-guard/photo-location-guard.tsx. Package requirements: lucide-react.

What props customize Photo Location Guard?

Photo Location Guard accepts `value`, `defaultValue`, `onValueChange`, `describeLocation`, `mapUrl`. Configures exif, gps, photo upload behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of photo-location-guard?

Reads JPEG metadata; other formats show an unsupported notice. Re-encoding drops all metadata and slightly changes image quality. Can't remove location visible in the picture itself (street signs, landmarks) Server requirement: Strip metadata on the server too before publishing uploads; a client-side strip can be skipped.

How does Photo Location Guard meet accessibility guidelines?

File input has a visible label and buttons to choose or change. Findings are in a polite live region; the details list is labelled. Remove shows aria-busy while working; errors use role=alert. Minimizes errors: photo gps location leaked, exif data in upload.

Which components pair with Photo Location Guard?