Add an OriginalImageFormat property onto ImageMetadata #2090
-
My proposal is to add an new property to This will allow us to remove (obsolete & hide) all the overloads on namespace SixLabors.ImageSharp.Metadata
{
public sealed partial class ImageMetadata
{
+ public IImageFormat OriginalImageFormat { get; set; }
}
}
namespace SixLabors.ImageSharp
{
public sealed partial class Image
{
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static IImageInfo Identify(Configuration, Byte[], out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static IImageInfo Identify(Configuration, Stream, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static IImageInfo Identify(Configuration, String, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static IImageInfo Identify(Byte[], out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static IImageInfo Identify(Stream, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static IImageInfo Identify(String, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task<(IImageInfo info, IImageFormat format)> IdentifyWithFormatAsync(Configuration, Stream, CancellationToken);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task<(IImageInfo info, IImageFormat format)> IdentifyWithFormatAsync(Configuration, String, CancellationToken);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task<(IImageInfo info, IImageFormat format)> IdentifyWithFormatAsync(Stream, CancellationToken);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task<(IImageInfo info, IImageFormat format)> IdentifyWithFormatAsync(String, CancellationToken);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(Configuration, Byte[], out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(Configuration, Stream, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(Configuration, ReadOnlySpan<Byte>, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(Configuration, String, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(Byte[], out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(Stream, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(ReadOnlySpan<Byte>, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image Load(String, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(Configuration, Byte[], out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(Configuration, Stream, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(Configuration, ReadOnlySpan<Byte>, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(Configuration, String, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(Byte[], out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(Stream, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(ReadOnlySpan<Byte>, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Image<TPixel> Load<TPixel>(String, out IImageFormat);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task(Image<TPixel> image, IImageFormat format)> LoadWithFormatAsync(Configuration, Stream, CancellationToken);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task(Image<TPixel> image, IImageFormat format)> LoadWithFormatAsync(Stream, CancellationToken);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task(Image<TPixel> image, IImageFormat format)> LoadWithFormatAsync<TPixel>(Configuration, Stream, CancellationToken);
+ [Obsolete("Format accessable from Metadata.OriginalImageFormat"),EditorBrowsable(EditorBrowsableState.Never)]
public static Task(Image<TPixel> image, IImageFormat format)> LoadWithFormatAsync<TPixel>(Stream, CancellationToken);
}
} obviously we could just delete these overloads too but I would rather not break back compatability for a when we don't have to... we wont add any more overloads in this shape but no real harm in keeping these ones around until they break. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Interesting.... I originally wanted a property on the metadata but was concerned about having a nullable property there. I'd delete the overloads. I don't want to do much work at all on the V2 line and move immediately to V3 where we can finally drop the old target frameworks. |
Beta Was this translation helpful? Give feedback.
-
#2092 shows the impact on the code to make this change |
Beta Was this translation helpful? Give feedback.
-
This was added as |
Beta Was this translation helpful? Give feedback.
This was added as
ImageMetadata.DecodedImageFormat
in v3.0