Image storage and processing system using GitHub Pages as a CDN for the Straypath website.
This repository functions as a content delivery network (CDN) for images. It includes:
- Image storage in the
/imagesdirectory - Local image processing with
remove_metadata.shfor optimization - Automated image processing via GitHub Actions workflow
- CDN delivery through GitHub Pages
- Add your images to the
/imagesdirectory - Run the image optimization script
- Commit and push to GitHub
- The GitHub workflow will automatically create and deploy multiple resolutions
Images can be accessed at:
https://straypathcom.github.io/cdn/[size]/[filename]
Available sizes:
thumbnail(188x96px)small(292x256px)medium(395x192px)hero(1720x677px)square(500x500px, center-cropped)
Example:
https://straypathcom.github.io/cdn/medium/example.jpg
The remove_metadata.sh script optimizes images before committing:
- Removes EXIF metadata
- Removes macOS extended attributes
- Resizes images to maximum width of 1800px while preserving aspect ratio
- Maintains image quality (95%)
- Reports which files were modified
- By default, only processes recently modified files to save time
- macOS or Linux with Bash
- ImageMagick (
brew install imagemagick) - ExifTool (
brew install exiftool)
# Process images modified in the last day (default behavior)
./remove_metadata.sh
# Process all images regardless of modification time
./remove_metadata.sh -a
# Process images modified in the last N days (e.g., 7 days)
./remove_metadata.sh -d 7
# Display help information
./remove_metadata.sh -h
# Process a single image
./remove_metadata.sh ./images/example.jpgThe .github/workflows/resize.yml workflow:
- Triggers on push to the main branch
- Creates multiple resolution versions of each image
- Deploys them to the
gh-pagesbranch - Makes them accessible via GitHub Pages
All rights reserved.