0 Replies Latest reply: Mar 27, 2012 8:14 PM by alexhuang999 RSS

    ISOSpeedRatings is an array item now?

    alexhuang999

      In XMP SDK 5.2.

       

      in function PhotoDataUtils::ExportExif

       

      it asks ISOSpeedRatings to be an array item, but it is not. Any special consideration to make it this way? Thanks.

       

       

       

       

      haveXMP = xmp->DoesPropertyExist ( kXMP_NS_EXIF, "ISOSpeedRatings" );

      if ( haveXMP ) {

      XMP_Index i, count;

      std::string isoValue;

      bool haveHighISO = false;

      for ( i = 1, count = xmp->CountArrayItems ( kXMP_NS_EXIF, "ISOSpeedRatings" ); i <= count; ++i ) {

      xmp->GetArrayItem ( kXMP_NS_EXIF, "ISOSpeedRatings", i, &isoValue, 0 );

      if ( SXMPUtils::ConvertToInt ( isoValue.c_str() ) > 0xFFFF ) { haveHighISO = true; break; }

      }

       

      if ( ! haveHighISO ) {

      haveExif = exif->GetTag ( kTIFF_ExifIFD, kTIFF_ISOSpeedRatings, 0 );

      if ( ! haveExif ) { // ISOSpeedRatings has an inject-only mapping.

      ExportArrayTIFF ( exif, kTIFF_ExifIFD, kISOSpeedMapping, exif->IsNativeEndian(), *xmp, kXMP_NS_EXIF, "ISOSpeedRatings" );

      }

      xmp->DeleteProperty ( kXMP_NS_EXIF, "ISOSpeedRatings");

      }

       

      }