-
Notifications
You must be signed in to change notification settings - Fork 45
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
Support writing metadata to files + other improvements/fixes #40
Conversation
Hi @dhui ! Thanks a lot for your contribution. That's a great job ! Could you please split this PR in 2 differents PR, one for your improvements concerning metadata extraction, and the other one concerning the new feature that you're adding, the metadata writing capability. About the last one, I'm wondering if it would not be more logical to have another "struct" handling the metadata writing... |
Here's the other PR w/ various improvements. I'll leave this one open until we've decided on the best approach for handling writing metadata
Are you referring to struct different from |
Ok, you've convinced me :) Let's keep a single "tool" / struct :) |
Addresses: barasher#40 (comment)
Use strings.HasSuffix instead of implementing it ourselves Addresses: barasher#40 (comment)
Looks like tests are failing since they're running with Go 1.13. Any objections running tests with Go 1.15? I'd use
|
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.
Tests don't pass on my computer:
barasher@linux:~/go/src/github.com/barasher/go-exiftool$ git log -1
commit 87c8ba7226e5dd9ba92ecccbd1673921ccf54b48 (HEAD -> dhui-write)
Author: Dale Hui <[email protected]>
Date: Sun Jul 18 09:13:20 2021 -0600
Invert default behavior of keeping the original file when writing metadata
Addresses: https://github.com/barasher/go-exiftool/pull/40#discussion_r670768486
barasher@linux:~/go/src/github.com/barasher/go-exiftool$ go test ./...
--- FAIL: TestWriteMetadataClearBeforeWriting (0.29s)
exiftool_test.go:591:
Error Trace: exiftool_test.go:591
exiftool_test.go:672
exiftool_test.go:562
Error: Not equal:
expected: float64(1.5)
actual : <nil>(<nil>)
Test: TestWriteMetadataClearBeforeWriting
--- FAIL: TestWriteMetadata (0.44s)
exiftool_test.go:470:
Error Trace: exiftool_test.go:470
exiftool_test.go:672
exiftool_test.go:410
Error: Not equal:
expected: float64(1.5)
actual : <nil>(<nil>)
Test: TestWriteMetadata
Messages: Field CameraImagingModelPixelAspectRatio differs
FAIL
FAIL github.com/barasher/go-exiftool 1.710s
FAIL
barasher@linux:~/go/src/github.com/barasher/go-exiftool$ exiftool -ver
10.80
barasher@linux:~/go/src/github.com/barasher/go-exiftool$ go version
go version go1.16.2 linux/amd64
Considering golang's backward compatibility policy, that's OK for me. |
Codecov Report
@@ Coverage Diff @@
## master #40 +/- ##
===========================================
- Coverage 89.44% 78.83% -10.61%
===========================================
Files 2 2
Lines 180 241 +61
===========================================
+ Hits 161 190 +29
- Misses 13 35 +22
- Partials 6 16 +10
Continue to review full report at Codecov.
|
I've updated
|
Thanks for the fast responses! |
Thanks for your involvement ! |
Other improvement/fixes (each in own commit):
-common_args
option if there are addition init argsexiftool
command to exit onClose()
NewExiftool
in parallel (for me, test runtimes dropped from 3-4s to ~1s)If you'd prefer, I'm happy to break this PR out into multiple smaller PRs.