HN 日本語サマリー

← 一覧へ戻る
プログラミング

Show HN: Photoc – 写真家向けのコマンドラインツール

Show HN: Photoc – Command-line tools for photographers (github.com)

10 pointsby ahmetomer2 コメント

要約

Photocは、写真家がターミナルから写真のレビュー、整理、準備を行うためのコマンドラインツールです。撮影の要約、メタデータの読み取り、重複ファイルの検出、写真のリネームやフォルダ分け、共有前のGPS情報削除などをサポートします。JPEGファイルに対応し、Sony ARW RAWファイルのメタデータも読み取れますが、元のファイルは明示的に指示しない限り変更されません。

全文翻訳

Quick start · Commands · Workflows · File safety · Scripting · Installation · Troubleshooting · Contributing · License photoc Command-line tools for photographers. photoc helps you review, organize, and prepare photos from the terminal. Summarize a shoot, read metadata, find blurry shots and exact duplicates, rename and sort photos into folders, make contact sheets and smaller copies, or remove GPS location before sharing. Every command works in shell scripts, and most can print JSON. photoc works with JPEG files and reads metadata from Sony ARW RAW files. Other RAW formats (CR3, NEF, RAF, DNG, …) and HEIC are not supported yet. See File-type support. photoc never changes your original files unless you ask it to with --apply (rename, sort) or --in-place (scrub). It never overwrites existing files. Read-only commands only read. Commands that create files write new copies next to your originals or in a folder you choose. See File safety for details. photoc is not a RAW developer, an image editor, a photo catalog, or a replacement for deep metadata editors such as ExifTool. Windows is not supported yet. Quick start Install photoc from its Homebrew tap (macOS or Linux with Homebrew): brew install ahmetomerv/photoc/photoc photoc --version The qualified name adds the tap automatically; Homebrew installs the required libraries. For a prebuilt executable instead, use the shell installer. Then try these read-only commands on your own photos: photoc --help # list commands photoc exif photo.jpg # one photo's metadata photoc stats ./photos --recursive # summarize a folder and its subfolders photoc timeline ./photos # review a shoot by session For example, photoc rename ./shoot --format '{date}_{camera}_{sequence}.{ext}' previews these three sample JPEGs without changing any files: session_1000.jpg -> 2026-09-27_Model S_0001.jpg session_1030.jpg -> 2026-09-27_Model S_0002.jpg session_1200.jpg -> 2026-09-27_Model S_0003.jpg Summary: 3 JPEG, 3 planned, 0 unchanged, 0 blocked, 0 applied, 0 rolled back For help with a specific command, run photoc <command> --help or man photoc. Directory scans look only inside the chosen folder unless you add --recursive, and they do not follow symlinks. Quote paths containing spaces, such as photoc exif "Summer trip/photo.jpg". Put options before -- when a path begins with -, for example photoc exif -- -photo.jpg. Commands Each command name links to its guide with options, examples, limits, and a JSON schema where supported. All guides are listed in the documentation index. Inspect (read-only): Command Purpose exif Show dimensions, camera, exposure, capture time, and GPS for one photo stats Summarize storage, capture dates, cameras, lenses, and exposure settings timeline Group a shoot by date and session query Find photos matching metadata filters such as ISO, aperture, camera, or date duplicates Find byte-identical files and show potential space savings focus Rank JPEGs by sharpness score, lowest first, to help culling check Audit JPEGs for structural and decoding problems Organize (preview by default; add --apply to change files): Command Purpose rename Rename photos using metadata templates such as {date}_{camera}_{sequence}.{ext} sort Move photos into YYYY/MM/DD/ or session-001/ folders Make copies (originals unchanged by default): Command Purpose compress Write smaller JPEG copies at a chosen quality or target file size contact Make paged JPEG contact sheets with filenames and optional exposure data scrub Write copies without GPS, private fields, or descriptive metadata --json works with exif, stats, timeline, query, duplicates, focus, and check. Longer directory operations show progress on stderr; use --no-progress to turn it off. File-type support Command | JPEG | Sony ARW | Other RAW files --------|------|----------|---------------- exif, stats, timeline, rename, sort | Metadata | Metadata | Unsupported/skipped query, check, compress, contact, focus, scrub | Supported | Unsupported/skipped | Unsupported/skipped duplicates | Exact bytes | Exact bytes | Exact bytes ARW support is metadata only: no RAW development, pixel decoding, compression, or GPS rewriting. Files are matched by extension (.jpg, .jpeg, .arw, case-insensitive). See Sony ARW metadata support for fields and limits. Want your camera supported? See Contributing. Workflows These recipes combine commands the way you might use them after a shoot. Commands that change files are shown in two steps: preview, then apply. After a shoot: review, rename, and sort # See how the day breaks into sessions. Adjust --gap to match how you shoot. photoc timeline ./shoot --gap 45m # Preview new names, then apply the same command. photoc rename ./shoot --format '{date}_{camera}_{sequence}.{ext}' photoc rename ./shoot --format '{date}_{camera}_{sequence}.{ext}' --apply # Preview session folders, then apply. photoc sort ./shoot --by session --gap 45m photoc sort ./shoot --by session --gap 45m --apply If any photo lacks the metadata a plan needs, such as a capture date, the whole plan is blocked and nothing changes. The preview lists the blocked files. Culling: find blurry shots and duplicates # Lowest sharpness scores first; show only those below the threshold. photoc focus ./shoot --recursive --threshold 100 --only-blurry # Byte-identical copies, for example from importing a card twice. photoc duplicates ./shoot --recursive Sharpness scores are a review aid, not a verdict: subject detail, noise, and intentional blur all affect them. photoc never deletes files; you decide what to remove. Before sharing: smaller copies without location # Write compressed copies into ./share, keeping the originals. photoc compress ./selects --recursive --target 2MB --output-dir ./share # Remove location and identifying metadata from those copies. photoc scrub ./share --privacy --recursive --in-place # Confirm no copy still has GPS (prints nothing when clean). photoc query ./share --recursive --has-gps compress keeps EXIF, including GPS, by default, so scrub after compressing. --in-place is used here only because ./share contains copies; it replaces files without a backup. --privacy can leave data in opaque MakerNotes; see the scrub limits. Find specific shots photoc query ./photos --recursive --iso ">800" --aperture "<=4" photoc query ./photos --camera "DSC-RX100M7A" photoc query ./photos --after 2026-01-01 --before 2026-12-31 Filters are combined with AND, and date bounds include the named days. See query details for matching rules and NUL-separated output. More examples # Contact sheet with exposure data, sorted by capture time. photoc contact ./shoot --output sheet.jpg --metadata --sort date # Check a folder for corrupt or truncated JPEGs. photoc check ./photos --recursive --only-errors # Save statistics as JSON for your own scripts. photoc stats ./photos --recursive --json > stats.json File safety Command | Changes originals? | Output | Existing files --------|--------------------|--------|---------------- Inspect commands | Never | Report on stdout | Not touched rename, sort | Only with --apply | Renames or moves in place | Never overwritten; whole plan checked first compress | Never | photo.compressed.jpg copies | Skipped (directory) or rejected (single file) contact | Never | sheet.jpg, sheet-001.jpg, … | Never overwritten scrub | Only with --in-place | photo.scrubbed.jpg copies | Rejected Important details: Rename and sort check the whole plan before changing anything. If a rename or move fails, photoc tries to undo earlier changes, but another process changing files at the same time can prevent full recovery. Keep backups of important collections. Compress loses image detail and can produce a larger file. EXIF (including orientation and GPS), ICC color profiles, and XMP are preserved; other APP markers are not copied. If a --target size cannot be reached, photoc still writes a copy at the minimum quality and exits with status 1. 2MB means 2,000,000 bytes; 2MiB means 2,097,152 bytes. See metadata preservation. Scrub copies JPEG image data without recompression. --gps removes EXIF GPS only; --privacy removes supported location and ide