nullpainter/sanchez

Directory path as output when processing single image

Closed this issue · 2 comments

Fails to save image when using an absolute path to an image file as input and absolute path to a directory as output.

Expected behavior

Save image in the specified output directory with the same name (or with -FC suffix) as the input file.

Real behavior

Unable to save image file due to missing output file extension parameter.
"Parameter "extension" must not be empty or whitespace"

Environment:

  • OS: Windows 10 64-bit
  • Version: 20H2
> Sanchez -s F:\rx\20201212\FD\IMG_FD_001_IR105_20201212_001006.jpg -o F:\rx\20201212\FD\enh -v
[16:21:36 INF] Sanchez starting with arguments: -s F:\rx\20201212\FD\IMG_FD_001_IR105_20201212_001006.jpg -o F:\rx\20201212\FD\enh -v
[16:21:36 INF] Using Bilinear interpolation
[16:21:36 INF] Normalising images to 4 km spatial resolution
[16:21:36 INF] Using underlay path C:\Users\Sam\Downloads\sanchez-v1.0.13.1-win-x64\Resources\world.200411.3x10848x5424.jpg
[16:21:36 INF] Using satellite definitions C:\Users\Sam\Downloads\sanchez-v1.0.13.1-win-x64\Resources\Satellites.json
[16:21:36 INF] Apply 0.2 haze
[16:21:36 INF] Beginning database upgrade
[16:21:36 INF] Checking whether journal table exists..
[16:21:36 INF] Fetching list of already executed scripts.
[16:21:36 INF] No new scripts need to be executed - completing.
[16:21:36 INF] Database migrated
[16:21:36 INF] Matched GEO-KOMPSAT-2A handler for IMG_FD_001_IR105_20201212_001006.jpg
[16:21:36 INF] Loading source images
[16:21:36 INF] Cropped image to 2172 x 2172 px
[16:21:37 INF] Retrieving underlay
[16:21:37 INF] GEO-KOMPSAT-2A Using cached underlay
[16:21:37 INF] Tinting and normalising IR imagery
[16:21:38 INF] Blending with underlay
[16:21:38 ERR] Workflow ddab5838-ba30-4f68-adab-745b1752b592 raised error on step 18 Message: extension (Parameter 'Parameter "extension" must not be empty or whitespace.')
System.ArgumentException: extension (Parameter 'Parameter "extension" must not be empty or whitespace.')
   at SixLabors.ThrowHelper.ThrowArgumentException(String message, String name)
   at SixLabors.ThrowHelper.ThrowArgumentExceptionForNotNullOrWhitespace(String value, String name)
   at SixLabors.ImageSharp.Formats.ImageFormatManager.FindFormatByFileExtension(String extension)
   at SixLabors.ImageSharp.Advanced.AdvancedImageExtensions.DetectEncoder(Image source, String filePath)
   at SixLabors.ImageSharp.ImageExtensions.SaveAsync(Image source, String path, CancellationToken cancellationToken)
   at Sanchez.Processing.Extensions.Images.ImageExtensions.SaveWithExifAsync(Image`1 image, String path)
   at Sanchez.Workflow.Steps.Common.SaveImage.RunAsync(IStepExecutionContext context)
   at WorkflowCore.Services.WorkflowExecutor.ExecuteStep(WorkflowInstance workflow, WorkflowStep step, ExecutionPointer pointer, WorkflowExecutorResult wfResult, WorkflowDefinition def, CancellationToken cancellationToken)
   at WorkflowCore.Services.WorkflowExecutor.Execute(WorkflowInstance workflow, CancellationToken cancellationToken)
[16:21:38 ERR] Unhandled failure in workflow
System.ArgumentException: extension (Parameter 'Parameter "extension" must not be empty or whitespace.')
   at SixLabors.ThrowHelper.ThrowArgumentException(String message, String name)
   at SixLabors.ThrowHelper.ThrowArgumentExceptionForNotNullOrWhitespace(String value, String name)
   at SixLabors.ImageSharp.Formats.ImageFormatManager.FindFormatByFileExtension(String extension)
   at SixLabors.ImageSharp.Advanced.AdvancedImageExtensions.DetectEncoder(Image source, String filePath)
   at SixLabors.ImageSharp.ImageExtensions.SaveAsync(Image source, String path, CancellationToken cancellationToken)
   at Sanchez.Processing.Extensions.Images.ImageExtensions.SaveWithExifAsync(Image`1 image, String path)
   at Sanchez.Workflow.Steps.Common.SaveImage.RunAsync(IStepExecutionContext context)
   at WorkflowCore.Services.WorkflowExecutor.ExecuteStep(WorkflowInstance workflow, WorkflowStep step, ExecutionPointer pointer, WorkflowExecutorResult wfResult, WorkflowDefinition def, CancellationToken cancellationToken)
   at WorkflowCore.Services.WorkflowExecutor.Execute(WorkflowInstance workflow, CancellationToken cancellationToken)

This also doing it on Linux.

Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

Fixed in v1.0.15.