Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: get the creation date from original, set to converted #2
base: main
Are you sure you want to change the base?
feat: get the creation date from original, set to converted #2
Changes from all commits
e3bcaed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we get the date&time from the EXIF instead? That would make more sense to me than relying on the file system itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In different script of mine, I successfully used the
exiv2
tool for similar thing.In this case running
exiv2 -T -F rename *.jpg
would do the trick. Wouldn't it be worth adding this to the docker image?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file date is used by other photos management apps. Let's make sure we set the file date as the original created date, or use EXIF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if you got me right. I think the creation date of JPG file should be set from EXIF, rather than copying it from creation date of HEIF file.
That is exactly what
exiv2 -T -F rename *.jpg
is doing. It will go thru all *.jpg files, reads the date from EXIF, and sets it to the file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
What I'm saying is that it depends of the photo management system. There are two places where the date is stored. Some uses the filesystem creation date, others from EXIF. Let's make both of them have the same date.
Let's make the converted file to have the same date at both places. AVOID having the converted file to have created date of today.
I'll adjust my PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't had time to try it, but isn't
touch -r
exactly for that? For copying date from one file to another?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure touch can use date from another file.
But date can read, and extract in any format, so that's what I did.
Now that you raise the idea that maybe touch can be used. I'm curious