ConvertTo-Jpeg icon indicating copy to clipboard operation
ConvertTo-Jpeg copied to clipboard

Exception calling "Wait" with "0" argument(s): "One or more errors occurred." ---> System.AggregateEx

Open ernestofersa opened this issue 3 years ago • 4 comments

First of all thanks for sharing your coding (the power of the commons! ;-) ). Somehow I am getting a very complex error message. This was my command after downloading the powershell coding: PS C:\Users\fernaer> dir C:\0PRIVATES\EF_Bilder\EF_Bilder_2021_Hdy_Checken\heic | .\ConvertTo-Jpeg.ps1

This is the result, I wonder if you can guide me toward a solution (my smartphone stored the pictures as heic during several months without me noticing it).:

C:\0PRIVATES\EF_Bilder\EF_Bilder_2021_Hdy_Checken\heic\20210618_180259.heicdir : System.Management.Automation.MethodInvocationException: Exception calling "Wait" with "0" argument(s): "One or more errors occurred." ---> System.AggregateException: One or more errors occurred. ---> System.Exception: No suitable transform was found to encode or decode the content. (Exception from HRESULT: 0xC00D5212) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at CallSite.Target(Closure , CallSite , Object ) --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at lambda_method(Closure , Object[] , StrongBox`1[] , InterpretedFrame ) At line:1 char:1

  • dir C:\0PRIVATES\EF_Bilder\EF_Bilder_2021_Hdy_Checken\heic | .\Conver ...
  •   + CategoryInfo          : OperationStopped: (System.Manageme...erpretedFrame ):String) [Get-ChildItem], RuntimeException
      + FullyQualifiedErrorId : System.Management.Automation.MethodInvocationException: Exception calling "Wait" with "0" argument(s): "One or more errors occurred." ---> System.AggregateEx
     ception: One or more errors occurred. ---> System.Exception: No suitable transform was found to encode or decode the content. (Exception from HRESULT: 0xC00D5212)
     --- End of inner exception stack trace ---
     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
     at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
     at CallSite.Target(Closure , CallSite , Object )
     --- End of inner exception stack trace ---
     at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
     at lambda_method(Closure , Object[] , StrongBox`1[] , InterpretedFrame ),Microsoft.PowerShell.Commands.GetChildItemCommand
    

ernestofersa avatar Nov 07 '21 09:11 ernestofersa

This sounds like you do not have a HEIC codec installed or it's not working: No suitable transform was found to encode or decode the content.

Please see the README for more info, or check the closed issues for similar things. Make sure Windows Photos can open the images before trying this script.

DavidAnson avatar Nov 07 '21 13:11 DavidAnson

Running into the same issue.

The extensions referenced in the README are no longer free. Are there any free alternatives?

grantwforsythe avatar Oct 04 '23 02:10 grantwforsythe

After doing some searching, I discovered ImageMagick which is free and open source.

grantwforsythe avatar Oct 04 '23 03:10 grantwforsythe

Well my workaround is to install WSL (Ubuntu) and use the linux convert Tool to do this job.

frankdetzer avatar Oct 04 '23 11:10 frankdetzer