PetrVys / MotionPhoto2

Mux HEIC and JPG Live Photos into Google/Samsung Motion Photos
MIT License
17 stars 4 forks source link

Error muxing images #1

Closed walent021 closed 1 month ago

walent021 commented 1 month ago

Hello, I have tried to make a motion picture, however I'm getting an error and my original photo has now disappeared (I have them now as IMG_E0489.HEIC.tmp1) I have exiftool in the folder and set it at PATH.

PS I:\IMG> .\MotionPhoto2.ps1 IMG_E0489.HEIC IMG_E0489.MOV IMG_E0489.HEIC
Motion Photo v2 muxer (heic compatible). Free your Live Photos!
(C) 2024 Petr Vyskocil. Licensed under MIT license.

Trying to extract LivePhoto timestamp...
Extracted LivePhoto timestamp 371667us from QuickTime.
Writing MotionPhoto metadata to the image...
File 'IMG_E0489.HEIC.tmp2' does not exist for -tagsFromFile option
LASTEXITCODE: 1
1
At I:\IMG\MotionPhoto2.ps1:16 char:9
+         throw $LASTEXITCODE
+         ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (1:Int32) [], RuntimeException
    + FullyQualifiedErrorId : 1

PS I:\IMG> .\MotionPhoto2.ps1 IMG_E0489.HEIC IMG_E0489.MOV IMG_E0489.HEIC
Motion Photo v2 muxer (heic compatible). Free your Live Photos!
(C) 2024 Petr Vyskocil. Licensed under MIT license.

validateImage : ERROR: source image file IMG_E0489.HEIC does not exist!
At I:\IMG\MotionPhoto2.ps1:165 char:14
+ $imageType = validateImage $imageFile $xmp
+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,validateImage

PS I:\IMG>
PetrVys commented 1 month ago

Ah, I think there’s a problem muxing the image in place. I’ll take a look, but for now select different output file name.

walent021 commented 1 month ago

The same applies when there's a different output name

Trying to extract LivePhoto timestamp...
Extracted LivePhoto timestamp 371667us from QuickTime.
Writing MotionPhoto metadata to the image...
File 'MIMG_E0489.HEIC.tmp2' does not exist for -tagsFromFile option
LASTEXITCODE: 1
1
At I:\IMG\MotionPhoto2.ps1:16 char:9
+         throw $LASTEXITCODE
+         ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (1:Int32) [], RuntimeException
    + FullyQualifiedErrorId : 1
PetrVys commented 1 month ago

Please try now. The file should now not be deleted even if output name is the same as input.

Also, I've expanded all filenames to full path - that should help with exiftool not being able to see the .tmp2 file (XMP tags saved to disk just before call to exiftool that crashes).

If it still crashes in the same way, could you please send me the tmp2 file? And if it does not exist, then the original heic file (I don't need the movie)

walent021 commented 1 month ago

Hello, Now it's looking at the system directory validateImage : ERROR: source image file C:\Windows\system32\IMG_E0489.HEIC does not exist!

When I specify full paths for all the files, it's okay, but it's a bit cumbersome

Update: As far as motion picture is concerned, it works good. My flow was iPhone -> MacBook -> HDD -> Windows -> Android Phone -> Google Photos

PetrVys commented 1 month ago

Ok, now it should hopefully work. You can tell from the code that I'm a .net guy and this is my powershell hello world :-)

PetrVys commented 1 month ago

(Forgot to push the code change, but now it’s in…) :-)

PetrVys commented 1 month ago

Assuming fixed, cannot replicate and root cause identified and adressed