BitMiracle.LibTiff.Classic.Tiff.okToChangeTag C# (CSharp) Method

okToChangeTag() private method

private okToChangeTag ( TiffTag tag ) : bool
tag TiffTag
return bool
        private bool okToChangeTag(TiffTag tag)
        {
            TiffFieldInfo fip = FindFieldInfo(tag, TiffType.ANY);
            if (fip == null)
            {
                // unknown tag
                ErrorExt(this, m_clientdata, "SetField", "{0}: Unknown {1}tag {2}",
                    m_name, isPseudoTag(tag) ? "pseudo-" : string.Empty, tag);
                return false;
            }

            if (tag != TiffTag.IMAGELENGTH &&
                (m_flags & TiffFlags.BEENWRITING) == TiffFlags.BEENWRITING &&
                !fip.OkToChange)
            {
                // Consult info table to see if tag can be changed after we've
                // started writing. We only allow changes to those tags that
                // don't / shouldn't affect the compression and / or format of
                // the data.
                ErrorExt(this, m_clientdata, "SetField", "{0}: Cannot modify tag \"{1}\" while writing",
                    m_name, fip.Name);
                return false;
            }

            return true;
        }
Tiff