Comments (3)
Thanks for bringing this issue up!
I think it would be better to rely on exit code from exiftool
For performance reasons, I run exiftool
in "batch" mode, so there's no exit code to check.
The errors (like file not found) are easy to handle, as ExifTool will emit to stderr
--I think it's defensible to throw an error if exiftool renders to stderr.
but if exiftool actually failed (missing binary, input file doesn't exist, etc)...I want to know and parsing error messages from your lib feels like a brittle way to do this.
Totally agreed. So--I could
- throw a custom error with some field you could check to see why it failed, or
- only throw if ExifTool emits to stderr, and update
ExifTool.write
to return aPromise<something>
that indicates the operation was a no-op.
I think I prefer 2. It's a breaking change, but I think it's better than what I've got currently.
So: what's something
look like?
{state: "created" | "updated" | "unchanged"}
{noop: boolean}
{created?: number; updated?: number; unchanged?: number}
- something else (suggestions welcome)
Option 1. allows for discrimination for creates vs updates, but checking a boolean might be a bit simpler than messing with a string enum.
Option 3 requires consumers to query a bunch of fields, but supports writes to filenames with globs, like:
exiftool -Author= foo*.xmp
1 image files updated
6 image files unchanged
from exiftool-vendored.js.
OK, I'm implementing Option 3:
export interface WriteTaskResult {
created: number
updated: number
unchanged: number
warnings?: string[]
}
from exiftool-vendored.js.
Hey! Thanks for the fast response and turnaround on a patch. I appreciate it!
from exiftool-vendored.js.
Related Issues (20)
- `ExifTool.readRaw` incorrectly has return type `Promise<Tags>` HOT 1
- DefaultExifToolOptions HOT 3
- -g vs -G produces different tag values HOT 2
- incorrect video create date HOT 10
- Stuck forever if perl is missing HOT 2
- Asynchronous operations that weren't stopped HOT 2
- Video `Create Date` with GPS inferred timezone HOT 10
- Wrong timezone offset is parsed from `TimeCreated` tag when using `inferTimezoneFromDatestamps` HOT 4
- Adding values to numericTags does not reflect in Tags type, nor is the function allowed to be properly extended to fix the return value HOT 2
- Regression on timezone extraction from an iPhone photo HOT 3
- problem with ignoreShebang HOT 3
- GPSLatitude and GPSLongitude differs from GPSPosition HOT 6
- gitlab CI (bullseye-slim) - Error: end() called before task completed HOT 4
- Treat "exiftool-vendored.exe" and "exiftool-vendored.pl" more as optional dependencies HOT 1
- Delete all tags except specified (returns `TypeError`) HOT 5
- inferTimezoneFromDatestamps does not detect UTC/Z/+00:00 timezones HOT 1
- Hang and then timeout on certain files HOT 3
- Perl not installed error HOT 3
- References to `exiftool.readTags()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exiftool-vendored.js.