Skip to content

Commit

Permalink
Update Image Sharp Image (#3080)
Browse files Browse the repository at this point in the history
* update image sharp

* update test cases

* remove private assets
  • Loading branch information
abdullah248 authored Oct 13, 2023
1 parent 1663c9d commit 02a488f
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="Polly" Version="8.0.0" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.6" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// -------------------------------------------------------------------------------------------------

namespace Microsoft.Health.Dicom.Blob;

public static class Constants
public static class BlobConstants
{
public const string BlobStoreConfigurationSection = "DicomWeb:DicomStore";
public const string BlobContainerConfigurationName = "dicomBlob";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public BlobMetadataStore(
_blobRetrieveMeter = EnsureArg.IsNotNull(blobRetrieveMeter, nameof(blobRetrieveMeter));

BlobContainerConfiguration containerConfiguration = namedBlobContainerConfigurationAccessor
.Get(Constants.MetadataContainerConfigurationName);
.Get(BlobConstants.MetadataContainerConfigurationName);

_container = client.GetBlobContainerClient(containerConfiguration.ContainerName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public BlobWorkitemStore(
_logger = EnsureArg.IsNotNull(logger, nameof(logger));

var containerConfiguration = namedBlobContainerConfigurationAccessor
.Get(Constants.WorkitemContainerConfigurationName);
.Get(BlobConstants.WorkitemContainerConfigurationName);

_container = client.GetBlobContainerClient(containerConfiguration.ContainerName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public InternalBlobClient(
ILogger<InternalBlobClient> logger)
{
_client = EnsureArg.IsNotNull(blobServiceClient, nameof(blobServiceClient));
_containerName = EnsureArg.IsNotNull(optionsMonitor.Get(Constants.BlobContainerConfigurationName).ContainerName, nameof(optionsMonitor));
_containerName = EnsureArg.IsNotNull(optionsMonitor.Get(BlobConstants.BlobContainerConfigurationName).ContainerName, nameof(optionsMonitor));
_logger = EnsureArg.IsNotNull(logger, nameof(logger));
_logger.LogInformation("Internal blob client registered.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static IDicomFunctionsBuilder AddBlobStorage(
.AddTransient<IStoreConfigurationSection>(sp => sp.GetRequiredService<MetadataStoreConfigurationSection>())
.AddPersistence<IMetadataStore, BlobMetadataStore>()
.AddScoped<DicomFileNameWithPrefix>()
.AddOptions<BlobContainerConfiguration>(Constants.MetadataContainerConfigurationName)
.AddOptions<BlobContainerConfiguration>(BlobConstants.MetadataContainerConfigurationName)
.Configure<IOptionsMonitor<DicomBlobContainerOptions>>((c, o) => c.ContainerName = o.CurrentValue.Metadata);

// Blob Files
Expand Down Expand Up @@ -86,7 +86,7 @@ public static IDicomFunctionsBuilder AddBlobStorage(
.AddSingleton<BlobStoreConfigurationSection>()
.AddTransient<IStoreConfigurationSection>(sp => sp.GetRequiredService<BlobStoreConfigurationSection>())
.AddPersistence<IFileStore, BlobFileStore>()
.AddOptions<BlobContainerConfiguration>(Constants.BlobContainerConfigurationName)
.AddOptions<BlobContainerConfiguration>(BlobConstants.BlobContainerConfigurationName)
.Configure<IOptionsMonitor<DicomBlobContainerOptions>>((c, o) => c.ContainerName = o.CurrentValue.File);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Health.Dicom.Blob.Utilities;
internal sealed class BlobStoreConfigurationSection : StoreConfigurationSection
{
public BlobStoreConfigurationSection()
: base(Constants.BlobStoreConfigurationSection, Constants.BlobContainerConfigurationName)
: base(BlobConstants.BlobStoreConfigurationSection, BlobConstants.BlobContainerConfigurationName)
{
}
}
Expand All @@ -22,7 +22,7 @@ public BlobStoreConfigurationSection()
internal sealed class MetadataStoreConfigurationSection : StoreConfigurationSection
{
public MetadataStoreConfigurationSection()
: base(Constants.MetadataStoreConfigurationSection, Constants.MetadataContainerConfigurationName)
: base(BlobConstants.MetadataStoreConfigurationSection, BlobConstants.MetadataContainerConfigurationName)
{
}
}
Expand All @@ -33,7 +33,7 @@ public MetadataStoreConfigurationSection()
internal sealed class WorkitemStoreConfigurationSection : StoreConfigurationSection
{
public WorkitemStoreConfigurationSection()
: base(Constants.WorkitemStoreConfigurationSection, Constants.WorkitemContainerConfigurationName)
: base(BlobConstants.WorkitemStoreConfigurationSection, BlobConstants.WorkitemContainerConfigurationName)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NSubstitute" />
<PackageReference Include="SixLabors.ImageSharp" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Common primitives and utilities used by Microsoft's DICOMweb APIs.</Description>
Expand Down Expand Up @@ -32,6 +32,7 @@
<PackageReference Include="Microsoft.Health.Operations" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="SixLabors.ImageSharp" />
<PackageReference Include="System.Linq.Async" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public DataStoreTestsFixture()
public async Task InitializeAsync()
{
IOptionsMonitor<BlobContainerConfiguration> optionsMonitor = Substitute.For<IOptionsMonitor<BlobContainerConfiguration>>();
optionsMonitor.Get(Constants.BlobContainerConfigurationName).Returns(_blobContainerConfiguration);
optionsMonitor.Get(Constants.MetadataContainerConfigurationName).Returns(_metadataContainerConfiguration);
optionsMonitor.Get(BlobConstants.BlobContainerConfigurationName).Returns(_blobContainerConfiguration);
optionsMonitor.Get(BlobConstants.MetadataContainerConfigurationName).Returns(_metadataContainerConfiguration);

_blobClient = BlobClientFactory.Create(_blobDataStoreConfiguration);

Expand Down

0 comments on commit 02a488f

Please sign in to comment.