From c2b079a89341c92c1b175cae6f3dbe009dd29b21 Mon Sep 17 00:00:00 2001 From: "beryllium@5bc3c32eb8156390f96e363e4ba38976567425ec" Date: Mon, 9 Jun 2025 13:09:25 +0000 Subject: [PATCH] Added a comment --- ..._0785f4683f0e7f9848aced2357ca1ec0._comment | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 doc/special_remotes/compute/comment_6_0785f4683f0e7f9848aced2357ca1ec0._comment diff --git a/doc/special_remotes/compute/comment_6_0785f4683f0e7f9848aced2357ca1ec0._comment b/doc/special_remotes/compute/comment_6_0785f4683f0e7f9848aced2357ca1ec0._comment new file mode 100644 index 0000000000..8606110243 --- /dev/null +++ b/doc/special_remotes/compute/comment_6_0785f4683f0e7f9848aced2357ca1ec0._comment @@ -0,0 +1,58 @@ +[[!comment format=mdwn + username="beryllium@5bc3c32eb8156390f96e363e4ba38976567425ec" + nickname="beryllium" + avatar="http://cdn.libravatar.org/avatar/62b67d68e918b381e7e9dd6a96c16137" + subject="comment 6" + date="2025-06-09T13:09:25Z" + content=""" +I'm getting acquainted with this special remote. I cannot praise it enough. It is brilliant. + +This is my first cut git-annex-compute-stripexif: + +[[!format bash \"\"\" +#!/bin/bash + +set -e + +if [ -z \"$1\" ]; then + echo \"Specify the input image file, followed by the output image file.\" >&2 + echo \"Example: foo.jpg foo.gif\" >&2 + exit 1 +fi + +echo REPRODUCIBLE +echo \"INPUT $1\" +read input + +if [ -n \"$input\" ]; then + tf=$(mktemp) + cp \"$input\" \"$tf\" >&2 + exiftool -overwrite_original -ALL= \"$tf\" >&2 + outfile=\"SANSEXIF-\"$(git-annex calckey \"$tf\") +fi +echo \"OUTPUT $outfile\" +read output + +cp -v \"$tf\" \"$outfile\" >&2 +rm -v \"$tf\" >&2 +\"\"\"]] + +Along the way, I've learnt that EXIF metadata isn't the only metadata stored in a jpeg, so the name is now a bit of a misnomer. Also, as it was more proof-of-concept, the target name and location is not well thought out, and there's no preservation of file extension. It's indicative for now. + +The aim is to aid (only) in the identifying two copies of the same jpeg, where only the metadata has been changed (eg. either by adjustments I made by script eons ago, or by apps like Microsoft photoviewer where orientation changes were made via metadata). I say aid only, because it's not going to help if the image is resized, etc. and I understand that. + +To that end, I do have some questions. The first is... is it wise (or possible) to try to set metadata on the source files whilst in the script? (since writing this, I have come to understand that the compute script is not run within the working directory, and the implication is that you're not meant to run any git-annex commands) + +Obviously, the idea would be to tag the source file with the computed key. I have already verified that if two copies of a jpeg that differ only by metadata, the computed file and key will be the same. + +But what I found is, if I don't have that option to set metadata, then respectfully, git-annex-findcomputed may have some deficiencies. + +From what I can gather, git-annex-findcomputed will not list the subsequent input file that when added, computes it. Only the first one. + +So trying to post process the computed files to perform the setting of metadata on the source files would likely not work. + +Also, I was curious about what happens if the input file moves within the archive? I haven't tried... but from what I can see, you wouldn't be able to backtrack from the computed file, because you won't know the key of the input file, in turn to go searching for it (eg. git-annex-whereused). + +Is my use case way off base as to why you should use the compute remote? + +"""]] -- 2.30.2