go-exiftool icon indicating copy to clipboard operation
go-exiftool copied to clipboard

Custom extraInitArgs

Open agorman opened this issue 3 years ago • 3 comments

Would you be open to a pull request that allowed a user of the module to set their own extraInitArgs? Something like:

func Args(args ...string) func(*Exiftool) error {
	return func(e *Exiftool) error {
		e.extraInitArgs = append(e.extraInitArgs, args...)
		return nil
	}
}

That way a user that knows what they're doing could put any fields they want. For example if I wanted to get the Orientation tag as a number.

et, err := exiftool.NewExiftool(
	exiftool.Args("-Orientation#"),
)

agorman avatar Jun 21 '22 22:06 agorman

Hi,

That could be interesting for "power users" but documentation should explicitly mention that unsuitable parameter can break go-exiftool. For instance, if a parameter that change exiftool's formating (JSON), go-exiftool won't be able to unmarshal exiftool's responses.

I also won't be able to fix any issue involving such extra parameters.

So, don't hesitate to send a PR :)

barasher avatar Jun 22 '22 20:06 barasher

@agorman , do you still want to send a PR for this feature ?

barasher avatar Jul 03 '22 18:07 barasher

@barasher I got a bit sidetracked with something else. Looking at all the options that will break things I'm not so sure it's a good idea. You can close this issue and if I figure something out I'll create a pill request. Thanks!

agorman avatar Jul 03 '22 18:07 agorman