/// <summary>
        /// Add this metadata to an image.
        /// </summary>
        /// <param name="dib">Handle to a FreeImage bitmap.</param>
        /// <returns>True on success, false on failure.</returns>
        public bool AddToImage(FIBITMAP dib)
        {
            CheckDisposed();
            if (dib.IsNull)
            {
                throw new ArgumentNullException("dib");
            }
            if (Key == null)
            {
                throw new ArgumentNullException("Key");
            }
            if (!selfCreated)
            {
                tag = FreeImage.CloneTag(tag);
                if (tag.IsNull)
                {
                    throw new Exception("FreeImage.CloneTag() failed.");
                }
                selfCreated = true;
            }
            if (!FreeImage.SetMetadata(Model, dib, Key, tag))
            {
                return(false);
            }
            FREE_IMAGE_MDMODEL _model = Model;
            string             _key   = Key;

            selfCreated = false;
            FreeImage.DeleteTag(tag);
            return(FreeImage.GetMetadata(_model, dib, _key, out tag));
        }
        /// <summary>
        /// Creates a deep copy of this <see cref="MetadataTag"/>.
        /// </summary>
        /// <returns>A deep copy of this <see cref="MetadataTag"/>.</returns>
        public object Clone()
        {
            CheckDisposed();
            MetadataTag clone = new MetadataTag();

            clone.model       = model;
            clone.tag         = FreeImage.CloneTag(tag);
            clone.selfCreated = true;
            return(clone);
        }