Menu

Support to read metadata from buffer, stream?

2002-02-01
2002-05-06
  • Nobody/Anonymous

    Hi everybody,

    I plan to read image files once and store them in a buffer in order to have access to different parts of the file. I also would like to read the metadata from this buffer so that I can reduce the file accesses to the hard disk.

    Is it possible to read the metadata from files stored in a buffer with the PMT? I could not find any support on this topic. If there is no way to read from a buffer, do you have an idea or solution for my problem?

    Thank you for your help.
    Kind regards
    Stefan Moser

     
    • Daniel Rupe

      Daniel Rupe - 2002-02-01

      Stefan,

      The PMT does overload the ostream and istream '<<' and '>>' operators to persist metadata in XML format.

      If you make a readMetadata() call like this to get metadata into a 'root' metadata object:

          PmtLogicalDefinitionInterpreter interp;
          interp.load();

          PmtMetadataPtr root;
          PmtAccessorPtr acc = PmtAccessor::getAccessor("test.jpg");
          root = acc->readMetadata();

      then you can work with an in-memory copy of the metadata in XML form with classes in the iostream library such as basic_stringstream like this:

          basic_stringstream<char> myss;
          myss << root;

      You'll need to refer to the iostream classes more to see which one might work out the best for you.

      Dan

       
      • Daniel Rupe

        Daniel Rupe - 2002-02-01

        Stefan,

        What you probably really want to do is use PMT's metadata objects themselves.

        All PmtMetadata objects reside in memory.

        When the interface methods on a PmtMetadata object are called, no file I/O happens.  File I/O occurs with the PmtAccessor interface.

        The only time the file is hit when an open() or close() is called on a PmtAccessor object.  (A close() happens automatically when a PmtAccessor goes out of scope.)

        If you want to work with multiple files simultaneously, then you can use multiple PmtAccessor objects.

        Dan

         
    • Nobody/Anonymous

      Hi Dan,

      Thank you for your answers I already planned to use the PMT's metadata objects themselves. What I am really interested in is to use PmtAccessor on an istream instead, something like:

      PmtAccessor::getAccessor(istream);

      The reason is that I already have the file in an istream and I would like to access the metadata. I guess that this mechanism is not supported but are there any plans to support this. I think the opentiff and openexif projects support to read from a buffer but I am not sure.

      Thank you very much and I like the PMT.
      Kind regards
      Stefan Moser

      P.S: Does the PMT support the new proposed tags in EXIF 2.2 proposal?

      White Paper: http://tsc.jeita.or.jp/avs/data/cp3451.pdf

       
    • Daniel Rupe

      Daniel Rupe - 2002-05-06

      Stefan,

      There are no current plans to support the accessors like:

      PmtAccessor::getAccessor(istream);

      There are plans to support Exif 2.2.

      Dan

       

Log in to post a comment.

MongoDB Logo MongoDB