Skip to content

Commit 63c268c

Browse files
committed
fix: actually write new buffer to file (gps removal)
1 parent 6e2da52 commit 63c268c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/gps/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// heavily modified from @xoi/gps-metadata-remover to fit the needs of zipline
22

3-
import { readFileSync } from 'fs';
3+
import { readFileSync, writeFileSync } from 'fs';
44
import {
55
PNG_TAG,
66
PNG_IEND,
@@ -136,5 +136,9 @@ export function removeGps(input: Buffer | string): boolean {
136136
removed = stripGpsFromTiff(buffer, tiffIfdOffset, littleEndian);
137137
}
138138

139+
if (removed && typeof input === 'string') {
140+
writeFileSync(input, buffer);
141+
}
142+
139143
return removed;
140144
}

0 commit comments

Comments
 (0)