CAPA Image Compliance Scripts
Camera 35 members can use these BASH shell scripts to check image files before submission and correct common technical issues. These tools are designed to support CAPA competition requirements, including dimensions, file size, colour space, and metadata preservation.
Scripts included:
- capacheck.sh — validates JPEG files
- capafix.sh — creates corrected JPEG copies
Overview
These scripts help members:
- Validate images before submission
- Identify technical failures early
- Automate resizing and corrections
- Preserve and verify metadata
They are intended to be run in a folder containing your final exported JPEG files.
Script Details
capacheck.sh — Validate JPEG Files
Scans JPEG files and reports whether they meet CAPA requirements.
Checks include:
- Maximum width: 1400 px
- Maximum height: 1050 px
- Maximum file size: 1.8 MB (1,800,000 bytes)
- Colour space: sRGB
- Camera metadata present
- Software metadata present
- At least one dimension at maximum size
Features
- Summary report (pass/fail)
- Option to display only failed files
- Detailed per-file output
- Interactive confirmation before scan
capafix.sh — Resize and Fix Images
Creates corrected JPEG copies for non-compliant files.
Functions:
- Resize to fit within 1400 × 1050
- Uses best methods for image resizing
- Preserve metadata
- Add metadata comment noting script use
- Output new file with suffix (e.g.,
-fixed) - Batch processing support
Options:
- JPEG quality
- Resize filter
- Output suffix
- Overwrite behavior
Sample Output
capacheck.sh (example)
$ capacheck.sh --failed *.jpg
CAPA JPEG Validation Script
Author : Robert Miller
Purpose: Validate JPEG files for dimensions, colour space, file size, and metadata
Requirements:
Max width : 1400 px
Max height : 1050 px
Max file size (MB) : 1.80 MB
Required colour space: sRGB
Require camera meta : yes
Require software meta: yes
name dimensions colorspace size camera software status
---------------------------- ------------ ------------ ---------- ------------ ------------ -------
image02.jpg 1320x990 AdobeRGB 2.08 MiB Sony A7R IV Capture One FAIL
image03.jpg 1400x933 sRGB 1.24 MiB GIMP 2.10 FAIL
Summary:
Total files : 3
Passed : 1
Failed : 2
capafix.sh (example)
$ capafix.sh --quality 92 *.jpg
Processing: image02.jpg
Output: ./image02-fixed.jpg
Processing: image03.jpg
Output: ./image03-fixed.jpg
Summary:
Processed: 2
Failed: 0
Skipped: 0
Installation
macOS (Recommended)
1. Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Install required tools
brew install exiftool
brew install imagemagick
3. Install scripts
mkdir -p ~/bin
cp capacheck.sh ~/bin/
cp capafix.sh ~/bin/
chmod +x ~/bin/capacheck.sh ~/bin/capafix.sh
4. Add to PATH (if required)
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zprofile
source ~/.zprofile
5. Verify installation
which capacheck.sh
which capafix.sh
which exiftool
which magick
Important macOS Note
On Apple Silicon systems, Homebrew installs tools to:
/opt/homebrew/bin
If scripts fail to locate tools, edit paths near top of script:
IDENTIFY="/opt/homebrew/bin/identify"
EXIFTOOL="/opt/homebrew/bin/exiftool"
MAGICK="/opt/homebrew/bin/magick"
Windows
Windows does not natively support BASH scripts.
Recommended: WSL (Windows Subsystem for Linux)
1. Install WSL
wsl --install
2. Install dependencies
sudo apt update
sudo apt install exiftool imagemagick
3. Install scripts
mkdir -p ~/bin
cp /mnt/c/path/to/scripts/*.sh ~/bin/
chmod +x ~/bin/*.sh
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
4. Verify
capacheck.sh --help
capafix.sh --help
Alternate: Git Bash (Limited Compatibility)
- Install Git for Windows
- Install ExifTool (Windows executable)
- Install ImageMagick (Windows installer)
- Add tools to PATH
Some commands may require modification to work correctly.
Linux
Most Linux systems support BASH and required tools natively.
Install dependencies
Ubuntu/Debian:
sudo apt update
sudo apt install exiftool imagemagick
Fedora:
sudo dnf install perl-Image-ExifTool ImageMagick
Arch:
sudo pacman -S perl-image-exiftool imagemagick
Install scripts
mkdir -p ~/bin
cp capacheck.sh ~/bin/
cp capafix.sh ~/bin/
chmod +x ~/bin/*.sh
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Verify
which capacheck.sh
which capafix.sh
Usage Examples
Validate all JPEGs
capacheck.sh
Show only failed files
capacheck.sh --failed *.jpg
Save report to file
capacheck.sh --report save *.jpg
Fix images
capafix.sh *.jpg
Fix with custom quality
capafix.sh --quality 92 *.jpg
Compatibility Notes
- Designed primarily for macOS and Linux
- Windows requires WSL
- Hard-coded tool paths may require script editing
- Some commands may differ between macOS (BSD) and Linux (GNU)
Download
Provide direct downloads on Camera 35 site:
capacheck.shcapafix.sh
After downloading:
chmod +x capacheck.sh capafix.sh
Support Notes
These tools are intended for users comfortable with:
- Terminal / command-line usage
- File system navigation
- Minor script editing if required
Always test on copies of images before processing originals.
Disclaimer
The CAPA Image Compliance Scripts (capacheck.sh, capafix.sh) and all associated installation instructions are provided as-is for informational and convenience purposes only.
By downloading or using these scripts, you acknowledge and agree to the following:
No Warranty
These scripts are provided without any warranty, express or implied, including but not limited to warranties of performance, accuracy, reliability, merchantability, or fitness for a particular purpose.Use at Your Own Risk
You assume full responsibility for the use of these scripts. Camera 35 St. John’s, its members, and contributors are not responsible for any loss, damage, data corruption, or unintended results arising from their use.No Guarantee of Compliance
While these tools are intended to assist with CAPA-style requirements, they do not guarantee acceptance in any competition. Final responsibility for compliance rests with the submitting photographer.User Responsibility
You are responsible for:- Reviewing script behavior before use
- Verifying outputs and metadata
- Maintaining backups of original files
System Compatibility
Scripts may behave differently across operating systems and environments. Modifications may be required for proper operation.
If you are unsure about any aspect of these scripts or their impact, do not use them.