garzj / google-photos-migrate

A tool to fix EXIF data and recover filenames from a Google Photos takeout, preserving albums within the directory structure.
https://npmjs.com/package/google-photos-migrate
MIT License
104 stars 11 forks source link

explain error output plz for renamed wrong extension .heic to .jpeg #25

Closed SteveDevOps closed 6 months ago

SteveDevOps commented 6 months ago

I don't get this error output and why this is a fatal error .. plz advise... thx!

npx google-photos-migrate@latest full 'Takeout' './output' './error' --timeout 60000
Started migration.
Processing photos...
Renamed wrong extension .heic to .jpeg: /home/steve/gphotos/output/Photos/IMG_2443.HEIC
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: ENOENT: no such file or directory, rename '/home/steve/gphotos/output/Photos/IMG_2443.HEIC' -> '/home/steve/gphotos/error/Photos/IMG_2443.HEIC'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'rename',
  path: '/home/steve/gphotos/output/Photos/IMG_2443.HEIC',
  dest: '/home/steve/gphotos/error/Photos/IMG_2443.HEIC'
}

Node.js v18.19.0

the original HEIC is present in the takeout export.

fd IMG_2443
Takeout/Google Photos/Photos from 2022/IMG_2443.HEIC
Takeout/Google Photos/Photos from 2022/IMG_2443.HEIC.json
SteveDevOps commented 6 months ago

nvm, decided to use immich-go cli. thx tho for the efforts.

rafaelliu commented 6 months ago

I'm seeing the same error

garzj commented 6 months ago

should be fixed now

rafaelliu commented 6 months ago

Thanks @garzj. I ended up with a quick and dirty fix of not renaming at all.

If I understood the code right, it tries to rename the file based on the MIME type correct? I had some files with wrong MIME types that ended up renaming some MOV files to JPEG which obviously caused issues.

Assuming that's correct, would it make sense to add an option to opt-in / opt-out of that?

garzj commented 6 months ago

Thanks @garzj. I ended up with a quick and dirty fix of not renaming at all.

If I understood the code right, it tries to rename the file based on the MIME type correct? I had some files with wrong MIME types that ended up renaming some MOV files to JPEG which obviously caused issues.

Assuming that's correct, would it make sense to add an option to opt-in / opt-out of that?

Yep, ExifTool identifies the type by the file contents, comparable with the file command in Linux i guess.

Seems like a good idea, I added a flag.