Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

void TagLib::Jpeg::File::ReadCOMSegment ( int  length  )  [inline, private]

Reads a COM segment to find the JPEG comment.

Parameters:
length The length of the segment that will be read.

Definition at line 599 of file File.cs.

References TagLib::ByteVector::Find(), TagLib::ByteVector::Mid(), TagLib::File::ReadBlock(), TagLib::File::Tell, and TagLib::ByteVector::ToString().

            {
                  if ((ImageTag.TagTypes & TagLib.TagTypes.JpegComment) != 0x00)
                        return;

                  long position = Tell;

                  JpegCommentTag com_tag;

                  if (length == 0) {
                         com_tag = new JpegCommentTag ();
                  } else {
                        ByteVector data = ReadBlock (length);

                        int terminator = data.Find ("\0", 0);

                        if (terminator < 0)
                              com_tag = new JpegCommentTag (data.ToString ());
                        else
                              com_tag = new JpegCommentTag (data.Mid (0, terminator).ToString ());
                  }

                  ImageTag.AddTag (com_tag);
                  AddMetadataBlock (position - 4, length + 4);
            }


Generated by  Doxygen 1.6.0   Back to index