public int getMainImagesCount() {
    int count = 0;
    List<TiffObject> list = new ArrayList<>();
    list.addAll(getMetadataList("IFD"));
    list.addAll(getMetadataList("SubIFDs"));

    for (TiffObject to : list) {
      if (to instanceof IFD) {
        IFD ifd = (IFD) to;
        if (ifd.isImage() && !ifd.isThumbnail())
          count++;
      }
    }

    return count;
  }
public int getMainImagesCount ( ) { int count = 0 ; List < TiffObject > list = new ArrayList < > ( ) ; list . addAll ( getMetadataList ( "IFD" ) ) ; list . addAll ( getMetadataList ( "SubIFDs" ) ) ; for ( TiffObject to : list ) { if ( to instanceof IFD ) { IFD ifd = ( IFD ) to ; if ( ifd . isImage ( ) && ! ifd . isThumbnail ( ) ) count ++ ; } } return count ; }
Gets the main images count.

@return the ifd count