@@ -107,7 +107,7 @@ function cleanExifData(exifHash: any): any {
107107}
108108
109109// The heart of the app, removing exif data from the image.
110- // This uses the Perl binary "exiftool" from .resources with it.
110+ // This uses the Perl binary "exiftool" the app's ` .resources` dir
111111//
112112// Opening and Closing
113113//
@@ -135,7 +135,9 @@ async function removeExif({
135135 . open ( )
136136 // .then((pid) => console.log('Started exiftool process %s', pid))
137137 . then ( ( ) => {
138- return ep . writeMetadata ( filePath , { all : "" } , [ "overwrite_original" ] ) ;
138+ const args = [ "charset filename=UTF8" , "overwrite_original" ] ;
139+
140+ return ep . writeMetadata ( filePath , { all : "" } , args ) ;
139141 } )
140142 . catch ( console . error ) ;
141143
@@ -155,26 +157,21 @@ async function getExif({
155157 . open ( )
156158 // .then((pid) => console.log('Started exiftool process %s', pid))
157159 . then ( ( ) => {
158- return exiftoolProcess
159- . readMetadata ( filePath , [
160- "-File:all" ,
161- "-ExifToolVersion" ,
162- "-x FileSize" ,
163- "-x SourceFile"
164- ] )
165- . then (
166- exifData => {
167- if ( exifData . data === null ) {
168- return { } ;
169- }
170-
171- const hash = exifData . data [ 0 ] ;
172- return cleanExifData ( hash ) ;
173- } ,
174- err => {
175- console . error ( err ) ;
160+ const args = [ "charset filename=UTF8" , "-File:all" , "-ExifToolVersion" ] ;
161+
162+ return exiftoolProcess . readMetadata ( filePath , args ) . then (
163+ exifData => {
164+ if ( exifData . data === null ) {
165+ return { } ;
176166 }
177- ) ;
167+
168+ const hash = exifData . data [ 0 ] ;
169+ return cleanExifData ( hash ) ;
170+ } ,
171+ err => {
172+ console . error ( err ) ;
173+ }
174+ ) ;
178175 } )
179176 . catch ( console . error ) ;
180177
0 commit comments