/// <summary>
        /// Function to determine if this codec can read the image data within the stream or not.
        /// </summary>
        /// <param name="stream">The stream that is used to read the image data.</param>
        /// <returns><b>true</b> if the codec can read the file, <b>false</b> if not.</returns>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="stream"/> parameter is <b>null</b>.</exception>
        /// <exception cref="IOException">Thrown when the <paramref name="stream"/> is write-only or if the stream cannot perform seek operations.</exception>
        /// <remarks>
        /// <para>
        /// When overloading this method, the implementor should remember to reset the stream position back to the original position when they are done reading the data.  Failure to do so may cause
        /// undesirable results or an exception.
        /// </para>
        /// </remarks>
        public override bool IsReadable(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            if (!stream.CanRead)
            {
                throw new IOException(Resources.GORIMG_ERR_STREAM_IS_WRITEONLY);
            }

            if (!stream.CanSeek)
            {
                throw new IOException(Resources.GORIMG_ERR_STREAM_CANNOT_SEEK);
            }

            var wic = new WicUtilities();

            try
            {
                GorgonImageInfo info = wic.GetImageMetaDataFromStream(stream, SupportedFileFormat, null);

                return(info == null ? false : info.Format != BufferFormat.Unknown);
            }
            catch (DX.SharpDXException)
            {
                return(false);
            }
            finally
            {
                wic.Dispose();
            }
        }
        /// <summary>
        /// Function to read file meta data.
        /// </summary>
        /// <param name="stream">Stream used to read the meta data.</param>
        /// <param name="options">Options used for decoding the meta data.</param>
        /// <returns>
        /// The image meta data as a <see cref="GorgonImageInfo"/> value.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="stream"/> parameter is <b>null</b>.</exception>
        /// <exception cref="IOException">Thrown when the stream is write-only.
        /// <para>-or-</para>
        /// <para>Thrown when the stream cannot perform seek operations.</para>
        /// </exception>
        /// <exception cref="EndOfStreamException">Thrown when an attempt to read beyond the end of the stream is made.</exception>
        public IGorgonImageInfo GetMetaData(Stream stream, IGorgonWicDecodingOptions options)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            if (!stream.CanRead)
            {
                throw new IOException(Resources.GORIMG_ERR_STREAM_IS_WRITEONLY);
            }

            if (!stream.CanSeek)
            {
                throw new IOException(Resources.GORIMG_ERR_STREAM_CANNOT_SEEK);
            }

            var wic = new WicUtilities();

            try
            {
                // Get our WIC interface.
                GorgonImageInfo result = wic.GetImageMetaDataFromStream(stream, SupportedFileFormat, options);

                if (result.Format == BufferFormat.Unknown)
                {
                    throw new IOException(string.Format(Resources.GORIMG_ERR_FORMAT_NOT_SUPPORTED, result.Format));
                }

                return(result);
            }
            catch (DX.SharpDXException)
            {
                throw new IOException(string.Format(Resources.GORIMG_ERR_FILE_FORMAT_NOT_CORRECT, Codec));
            }
            finally
            {
                wic.Dispose();
            }
        }