Skip to content

Instantly share code, notes, and snippets.

View bpanahij's full-sized avatar

Brian P Johnson bpanahij

  • San Francisco, CA
View GitHub Profile
#!/usr/bin/zsh
count=0
zeroos="0000"
find $(cd "$CWD") -depth -iname "*.json" | while read filename;
do
neighborhood=$((jq ".[0].GPSLatitude" $filename && echo "," && jq ".[0].GPSLongitude" $filename) | tr -d '\n' | geocoder | jq .neighborhood | sed -re 's/"//g' -re 's/ /_/g')
datetime=$(jq ".[0].CreateDate" $filename | sed -re "s/\"([^:]*):([^:]*):([^ ]*).*/\1-\2-\3/")
echo "${neighborhood}_$datetime"
original_filepath=$(jq ".[0].SourceFile" $filename | sed -re 's/"//g')
#! /bin/bash
#07/06/18 A BASH script to collect EXIF metadata
#07/06/18 create metadata directory, create text file output for each file, append basename, place output in metadata directory
#07/06/18 create script.log to verify processing of files and place in metadata directory
#07/06/18 Author: Sandy Lynn Ortiz - Stanford University Libraries - Born Digital Forensics Lab
#08/21/18 TO RUN: Place the script in the working directory. The script will search sub-dir's.
# Open a terminal window (command prompt) and navigate to the working directory
# i.e. cd /path/to/directory. Type ./SAA.sh and hit enter.
# The script will take a few min to run (start with a small set of testing files), depending on the number of files.
# It will prompt you when it completes. Try different commands in place of EXIFTOOL per your need.
#!/usr/bin/zsh
extract_metadata.sh
geocode_from_metadata.sh
@bpanahij
bpanahij / convert_to_webp.sh
Last active October 25, 2023 18:49
Image Pre-processing Pipeline for my NextJS App
#!/bin/bash
# Set the directory to search for files in
dir="../assets/public/images/originals"
# Recursively loop through all JPG and PNG files in the directory
find "$dir" -type f \( -iname \*.jpg \) -print0 | while read -d $'\0' file; do
# Run the command on each file
convert "$file" -auto-orient "$file"
newfile="${file%.*}.webp"
import {Fragment, useState, useCallback, useEffect} from 'react';
import "maplibre-gl/dist/maplibre-gl.css";
import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";
import {API, Geo, graphqlOperation, Storage} from 'aws-amplify';
import {searchOriginalImages} from "@/graphql/queries"
import ImageGrid from "@/components/ImageGrid";
import {Dialog, Transition} from "@headlessui/react";
import {XMarkIcon} from "@heroicons/react/24/outline";
import DroneCalibrator from "@/components/DroneCalibrator";