Skip to content

Commit

Permalink
Make sure the current settings are using when creating new MagickRead…
Browse files Browse the repository at this point in the history
…Settings (#1495)
  • Loading branch information
dlemstra committed Dec 25, 2023
1 parent 999f477 commit ac7805a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Magick.NET/MagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4750,7 +4750,7 @@ public void Read(byte[] data, int offset, int count)
/// <param name="format">The format to use.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void Read(byte[] data, int offset, int count, MagickFormat format)
=> Read(data, offset, count, new MagickReadSettings { Format = format });
=> Read(data, offset, count, new MagickReadSettings(_settings) { Format = format });

/// <summary>
/// Read single image frame.
Expand Down Expand Up @@ -4781,7 +4781,7 @@ public void Read(byte[] data, MagickFormat format)
{
Throw.IfNullOrEmpty(nameof(data), data);

Read(data, 0, data.Length, new MagickReadSettings { Format = format }, false);
Read(data, 0, data.Length, new MagickReadSettings(_settings) { Format = format }, false);
}

/// <summary>
Expand Down Expand Up @@ -4829,7 +4829,7 @@ public void Read(FileInfo file, MagickFormat format)
{
Throw.IfNull(nameof(file), file);

Read(file.FullName, new MagickReadSettings { Format = format });
Read(file.FullName, new MagickReadSettings(_settings) { Format = format });
}

/// <summary>
Expand Down Expand Up @@ -4875,7 +4875,7 @@ public void Read(Stream stream)
/// <param name="format">The format to use.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void Read(Stream stream, MagickFormat format)
=> Read(stream, new MagickReadSettings { Format = format });
=> Read(stream, new MagickReadSettings(_settings) { Format = format });

/// <summary>
/// Read single image frame.
Expand Down Expand Up @@ -4922,7 +4922,7 @@ public void Read(string fileName, int width, int height)
/// <param name="format">The format to use.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void Read(string fileName, MagickFormat format)
=> Read(fileName, new MagickReadSettings { Format = format });
=> Read(fileName, new MagickReadSettings(_settings) { Format = format });

/// <summary>
/// Read single image frame.
Expand Down Expand Up @@ -4971,7 +4971,7 @@ public Task ReadAsync(FileInfo file, MagickFormat format)
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public Task ReadAsync(FileInfo file, MagickFormat format, CancellationToken cancellationToken)
=> ReadAsync(file, new MagickReadSettings { Format = format }, cancellationToken);
=> ReadAsync(file, new MagickReadSettings(_settings) { Format = format }, cancellationToken);

/// <summary>
/// Read single image frame.
Expand Down Expand Up @@ -5036,7 +5036,7 @@ public Task ReadAsync(Stream stream, MagickFormat format)
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public Task ReadAsync(Stream stream, MagickFormat format, CancellationToken cancellationToken)
=> ReadAsync(stream, new MagickReadSettings { Format = format }, cancellationToken);
=> ReadAsync(stream, new MagickReadSettings(_settings) { Format = format }, cancellationToken);

/// <summary>
/// Read single image frame.
Expand Down Expand Up @@ -5102,7 +5102,7 @@ public Task ReadAsync(string fileName, MagickFormat format)
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public Task ReadAsync(string fileName, MagickFormat format, CancellationToken cancellationToken)
=> ReadAsync(fileName, new MagickReadSettings { Format = format }, cancellationToken);
=> ReadAsync(fileName, new MagickReadSettings(_settings) { Format = format }, cancellationToken);

/// <summary>
/// Read single image frame.
Expand Down

0 comments on commit ac7805a

Please sign in to comment.