public static (ProcessState state, SKImage image) ExpandRegion(HttpClient httpClient, ILogger log, Uri imageUri, ImageRequest request, bool allowSizeAboveFull)
 {
     if (imageUri.IsFile)
     {
         using (var tiff = T.Tiff.Open(imageUri.LocalPath, "r"))
         {
             return(ReadFullImage(tiff, request, allowSizeAboveFull));
         }
     }
     else
     {
         var stream = new TiffHttpSource(httpClient, log, imageUri, request.RequestId);
         using (var tiff = T.Tiff.ClientOpen("custom", "r", null, stream))
         {
             return(ReadFullImage(tiff, request, allowSizeAboveFull));
         }
     }
 }
 public static Metadata GetMetadata(HttpClient httpClient, ILogger log, Uri imageUri, int defaultTileWidth, string requestId)
 {
     if (imageUri.IsFile)
     {
         if (!File.Exists(imageUri.LocalPath))
         {
             throw new FileNotFoundException();
         }
         using (var tiff = T.Tiff.Open(imageUri.LocalPath, "r"))
         {
             return(ReadMetadata(tiff, defaultTileWidth));
         }
     }
     else
     {
         var stream = new TiffHttpSource(httpClient, log, imageUri, requestId);
         using (var tiff = T.Tiff.ClientOpen("custom", "r", null, stream))
         {
             return(ReadMetadata(tiff, defaultTileWidth));
         }
     }
 }