From 6b65adb1e5c8b0b79fef426d3d57fd9aff048079 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sat, 8 Jun 2024 18:22:33 -0500 Subject: [PATCH] Streamline GPS code --- README.md | 2 +- src/types/piexif.d.ts | 6 ------ src/utility/data.ts | 14 -------------- 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 src/types/piexif.d.ts delete mode 100644 src/utility/data.ts diff --git a/README.md b/README.md index a137c0e2..77d11edf 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Application behavior can be changed by configuring the following environment var - `NEXT_PUBLIC_STATICALLY_OPTIMIZE_OG_IMAGES = 1` enables static optimization for OG images, i.e., renders images at build time (results in increased project usage)—⚠️ _Experimental_ - `NEXT_PUBLIC_MATTE_PHOTOS = 1` constrains the size of each photo, and enables a surrounding border (potentially useful for photos with tall aspect ratios) - `NEXT_PUBLIC_BLUR_DISABLED = 1` prevents image blur data being stored and displayed (potentially useful for limiting Postgres usage) -- `NEXT_PUBLIC_GEO_PRIVACY = 1` disables collection/display of location-based data (⚠️ re-compresses original images in order to remove identifying information) +- `NEXT_PUBLIC_GEO_PRIVACY = 1` disables collection/display of location-based data (⚠️ re-compresses uploaded images in order to remove GPS information) - `NEXT_PUBLIC_IGNORE_PRIORITY_ORDER = 1` prevents `priority_order` field affecting photo order - `NEXT_PUBLIC_PUBLIC_API = 1` enables public API available at `/api` - `NEXT_PUBLIC_HIDE_REPO_LINK = 1` removes footer link to repo diff --git a/src/types/piexif.d.ts b/src/types/piexif.d.ts deleted file mode 100644 index 10ad2c63..00000000 --- a/src/types/piexif.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module 'piexifjs' { - export function load(base64Url: string): Record - export function dump(exifObject: Record): string - export function insert(exifDataWithoutGps: string, base64Url: string): string - export function remove(exifData: string): string -} diff --git a/src/utility/data.ts b/src/utility/data.ts deleted file mode 100644 index df971602..00000000 --- a/src/utility/data.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const b64toBlob = ( - data: string, - type: string = 'image/jpeg', -): Blob => { - const byteString = atob(data.split(',')[1]); - const ab = new ArrayBuffer(byteString.length); - const ia = new Uint8Array(ab); - - for (let i = 0; i < byteString.length; i++) { - ia[i] = byteString.charCodeAt(i); - } - - return new Blob([ab], { type }); -};