Ignore:
Timestamp:
Mar 18, 2010, 11:47:11 PM (14 years ago)
Author:
grum
Message:

database is partially filled during the install process, and fill database picture per picture each time a page is displayed (and until all the database is filled)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/amd_pip.class.inc.php

    r4909 r5183  
    6464    $path=dirname(dirname(dirname(__FILE__)));
    6565    $filename="";
     66    $analyzed='n';
    6667
    67     $sql="SELECT path FROM ".IMAGES_TABLE." WHERE id=".$page['image_id'].";";
     68    $sql="SELECT ti.path, tai.analyzed FROM ".IMAGES_TABLE." ti
     69            LEFT JOIN ".$this->tables['images']." tai ON tai.imageId = ti.id
     70          WHERE ti.id=".$page['image_id'].";";
    6871    $result=pwg_query($sql);
    6972    if($result)
     
    7275      {
    7376        $filename=$row['path'];
     77        $analyzed=$row['analyzed'];
    7478      }
    7579      $filename=$path."/".$filename;
    7680    }
    7781
    78     $JpegMD = new JpegMetaData(
     82    $this->jpegMD->load(
    7983      $filename,
    8084      Array(
     
    113117    $group=null;
    114118
    115     $picturesTags=$JpegMD->getTags();
     119    $picturesTags=$this->jpegMD->getTags();
    116120
    117121    foreach($tagsList as $key => $val)
     
    160164    }
    161165
    162     unset($JpegMD);
     166
     167    if($analyzed=='n' and
     168       $this->my_config['amd_FillDataBaseContinuously']=='y' and
     169       $this->my_config['amd_AllPicturesAreAnalyzed']=='n')
     170    {
     171      /* if picture is not analyzed, do analyze
     172       *
     173       * note : the $loaded parameter is set to true, in this case the function
     174       *        analyzeImageFile uses data from the $this->jpegMD object which
     175       *        have data already loaded => the picture is not analyzed twice,
     176       *        the function only do the database update
     177       */
     178      $this->analyzeImageFile($filename, $page['image_id'], true);
     179      $this->makeStatsConsolidation();
     180    }
    163181
    164182    $template->assign('metadata', $metadata);
Note: See TracChangeset for help on using the changeset viewer.