Photochk 1.0.0 — 類似写真を探して整理する macOS アプリ
フォルダ内の写真から、中身が同じものと見た目が似ているものを検出して グループにまとめ、残す1枚を選んでほかをゴミ箱へ送れるようにする。 検出は安い判定から順に4段: - ファイルサイズが同じものだけ SHA-256 でバイト一致を確定 - dHash(知覚ハッシュ)のハミング距離で候補ペアを抽出 - 候補に出てくる画像だけ Vision の feature print で精査 - Union-Find で連結成分をグループ化 判定のしきい値は実写画像で距離を実測して決めた(docs/calibration.md)。 tools/release-update.sh で Gitea のリリースを更新する。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import SwiftUI
|
||||
|
||||
/// QuickLook のサムネイルを非同期で読み込んで表示する。
|
||||
struct ThumbnailView: View {
|
||||
let url: URL
|
||||
let size: CGFloat
|
||||
|
||||
@State private var image: NSImage?
|
||||
|
||||
/// 読み込み済みならキャッシュから直接描く。プレースホルダの一瞬のちらつきを防ぐ。
|
||||
private var displayImage: NSImage? {
|
||||
image ?? ThumbnailLoader.shared.cached(for: url, size: size)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
RoundedRectangle(cornerRadius: 6, style: .continuous)
|
||||
.fill(.quaternary)
|
||||
|
||||
if let image = displayImage {
|
||||
Image(nsImage: image)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
} else {
|
||||
ProgressView()
|
||||
.controlSize(.small)
|
||||
}
|
||||
}
|
||||
.frame(width: size, height: size)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6, style: .continuous))
|
||||
.task(id: url) {
|
||||
image = await ThumbnailLoader.shared.thumbnail(for: url, size: size)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user