Skip to content
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

Draft: First try at parsing the timezone information for the sony A7 camera #188

Merged
merged 2 commits into from
Jul 21, 2024

Conversation

fwsmit
Copy link
Contributor

@fwsmit fwsmit commented Jun 12, 2024

I'm working on creating a PR to fix #187. I've never used typescript before, so I need some help. How can I run the tests in this repository? I could not find documentation about that.

I know that there should be some more code to only do this for some Sony camera's, but first I wanted to check if this works. What would be a reasonable include-list? Only my model of Sony camera (ICLE-7)?

@fwsmit fwsmit marked this pull request as draft June 12, 2024 19:44
@mceachen
Copy link
Member

How can I run the tests in this repository?

yarn test

(you may need to install a recent version of Node.js and run npm i -g yarn).

What would be a reasonable include-list?

It might be safe enough to put this at the very bottom of the timezone inference heuristics -- we'd certainly prefer something like GPS or an explicit TimezoneOffset over this wholly-undocumented, might-be-in-UTC-but-who-knows sony-specific tag.

Also: the tag name will be CamelCased (like all others). Use exiftool -j -struct $file to see what this library is seeing (ish).

This enables timezone detection of images on some Sony camera's like the Sony A7.
@fwsmit fwsmit marked this pull request as ready for review June 16, 2024 20:40
@fwsmit
Copy link
Contributor Author

fwsmit commented Jun 16, 2024

How can I run the tests in this repository?

yarn test

(you may need to install a recent version of Node.js and run npm i -g yarn).

Thank you. I also needed to do a yarn install or npm install and install perl. It would be nice if there was some documenation for how to setup a developer environment.

What would be a reasonable include-list?

It might be safe enough to put this at the very bottom of the timezone inference heuristics -- we'd certainly prefer something like GPS or an explicit TimezoneOffset over this wholly-undocumented, might-be-in-UTC-but-who-knows sony-specific tag.

Also: the tag name will be CamelCased (like all others). Use exiftool -j -struct $file to see what this library is seeing (ish).

I made the name camel cased and added it to the end of the list. Now all tests pass. I don't know what a reasonable test would be to add here, since I'm just adding another name of a UTC tag. Would it be possible to test this on an actual image from my camera?

@fwsmit
Copy link
Contributor Author

fwsmit commented Jun 24, 2024

Hi, any chance you could take a look at this PR?

src/Tags.ts Outdated
@@ -4186,6 +4186,8 @@ export interface MakerNotesTags {
/** ☆☆☆☆ ✔ Example: "n/a" */
SoftSkinEffect?: string
/** ☆☆☆☆ ✔ Example: "2023:05:24 15:18:25" */
SonyDateTime2?: ExifDateTime | string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this file is automatically generated, and this diff (which is required for the other diff to compile) will get reverted.

There's a list of "required" tags in mktags.ts that needs this new tag name added to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I added it to the mktags.ts file. I also removed it from src/Tags.ts, since it should be automatically generated. To rerun the generation, I saw that you need to run yarn run mktags *picture_dir*. Only I don't see which directory of pictures is used to generate the current list.

Copy link
Member

@mceachen mceachen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll write some tests.

@mceachen mceachen merged commit 174b21a into photostructure:main Jul 21, 2024
2 of 12 checks passed
@fwsmit
Copy link
Contributor Author

fwsmit commented Jul 21, 2024

Thanks!

@mceachen
Copy link
Member

The failed GitHub Actions tests were a doozy to fix. I documented it here: https://photostructure.com/coding/node-22-exit-handler-never-called/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infer timezone information for Sony A7 first gen
2 participants