I investigated this a bit by myself.
I found that actually all my files were added to the library but the “missing” files from the ./photostructure list
command are visible with ./photostructure list --where "Asset.shown = 0"
Then with ./photostructure list --where "Asset.shown = 0" | ./photostructure sync-file --force --info
I can find why exactly my files are not shown
Some of my jpg files have
2021-03-27T12:11:07.906Z sync-file-25956 warn ImageHash(F:\SynologyDrive\Photos\0006\5242.jpg) Failed to imageHash(F:\SynologyDrive\Photos\0006\5242.jpg) { stack:
[ 'Error: VipsJpeg: Invalid SOS parameters for sequential JPEG',
'VipsJpeg: out of order read at line 0',
'' ] }
While it is awesome to know that some of your files are corrupted and I think you should definitely keep such information and show in the asset info UI. But those file are perfectly viewable and you can still show them. Moreover, I think it is unacceptable that running sync-file
without --info
flag doesn’t show that those images are somehow broken.
./photostructure sync-file f:/SynologyDrive/Photos/0006/5245.jpg
{"path":"psfile://32hPdZdkz/SynologyDrive/Photos/0006/5245.jpg","assetFileId":19851,"assetId":19674,"memMb":38,"rssMb":110}
{"ready":true}
It seems, that you could fix the missing file via adding failOnError: false
to your sharp
calls. There is also a way to subscribe to the warning
event Access Libvips failure/warnings with failOnError flagged false · Issue #2032 · lovell/sharp · GitHub not to lose them.
I am willing to be more helpful and make a Pull Request but I fail to find unminimized sources of your project.
Some files have a bit different issue
[ 'Error: VipsJpeg: Corrupt JPEG data: premature end of data segment',
'VipsJpeg: out of order read at line 1760',
'' ] }
And, yes, those images are really corrupted at least partially. But all my comments above - apply.
Regards, problematic mp4 files, they have the following error
2021-03-27T12:11:31.263Z sync-file-25956 info ExifTool onStderr(20692):Error: Format error in file - C:/Users/mnaou/AppData/Local/Temp/PhotoStructure/imgcache/5w/wn/9j6z8p5hz5kfw7pbpkx1/wip-frame.jpg
2021-03-27T12:11:31.272Z sync-file-25956 warn ExifTool onError() (ending or ignorable): failed to run -charset
filename=utf8
-codedcharacterset=utf8
-sep
-E
-all=
C:\Users\mnaou\AppData\Local\Temp\PhotoStructure\imgcache\5w\wn\9j6z8p5hz5kfw7pbpkx1\wip-frame.jpg
-ignoreMinorErrors
-execute { stack:
[ 'Error: Format error in file - C:/Users/mnaou/AppData/Local/Temp/PhotoStructure/imgcache/5w/wn/9j6z8p5hz5kfw7pbpkx1/wip-frame.jpg',
' at WriteTask.parser (C:\\Users\\mnaou\\photostructure-for-servers\\node_modules\\exiftool-vendored\\dist\\ExifToolTask.js:69:23)',
' at WriteTask.<anonymous> (C:\\Users\\mnaou\\photostructure-for-servers\\node_modules\\batch-cluster\\dist\\Task.js:122:51)',
' at step (C:\\Users\\mnaou\\photostructure-for-servers\\node_modules\\batch-cluster\\dist\\Task.js:33:23)',
' at Object.next (C:\\Users\\mnaou\\photostructure-for-servers\\node_modules\\batch-cluster\\dist\\Task.js:14:53)',
' at C:\\Users\\mnaou\\photostructure-for-servers\\node_modules\\batch-cluster\\dist\\Task.js:8:71' ] }
While when I run exiftool.exe on my mp4 files manually, I see no problem