コード例 #1
0
ファイル: main.php プロジェクト: daskleinesys/slimpd
 public function destroyExtractedImageDupes()
 {
     $this->jobPhase = 4;
     $this->beginJob(array('msg' => "searching extracted image-dupes in database ..."), __FUNCTION__);
     $app = \Slim\Slim::getInstance();
     $query = "SELECT count(id) AS itemCountTotal FROM  bitmap WHERE error=0 AND trackId > 0";
     $this->itemCountTotal = (int) $app->db->query($query)->fetch_assoc()['itemCountTotal'];
     $query = "\n\t\t\tSELECT\n\t\t\t\tid,\n\t\t\t\ttrackId,\n\t\t\t\tembedded,\n\t\t\t\tCONCAT(albumId, '.', width, '.', height, '.', filesize) as dupes,\n\t\t\t\trelativePath,\n\t\t\t\tfilesize\n\t\t\tFROM  bitmap\n\t\t\tWHERE error=0 AND embedded=1\n\t\t\tORDER BY albumId;";
     $result = $app->db->query($query);
     $images = array();
     $previousKey = '';
     $deletedFilesize = 0;
     $msgKeep = $app->ll->str('importer.image.keep');
     $msgDestroy = $app->ll->str('importer.image.destroy');
     $msgProcessing = $app->ll->str('importer.image.dupecheck.processing');
     while ($record = $result->fetch_assoc()) {
         $this->updateJob(array('msg' => $msgProcessing, 'currentItem' => $record['relativePath']));
         $this->itemCountChecked++;
         if ($this->itemCountChecked === 1) {
             $previousKey = $record['dupes'];
             cliLog($app->ll->str('importer.image.keep', array($record['relativePath'])), 3);
             continue;
         }
         if ($record['dupes'] === $previousKey) {
             $msg = $app->ll->str('importer.image.destroy', array($record['relativePath']));
             $bitmap = new \Slimpd\Bitmap();
             $bitmap->setId($record['id']);
             $bitmap->setTrackId($record['trackId']);
             $bitmap->setEmbedded($record['embedded']);
             $bitmap->setRelativePath($record['relativePath']);
             $bitmap->destroy();
             $this->itemCountProcessed++;
             $deletedFilesize += $record['filesize'];
         } else {
             $msg = $app->ll->str('importer.image.keep', array($record['relativePath']));
         }
         cliLog($msg, 3);
         $previousKey = $record['dupes'];
     }
     $msg = $app->ll->str('importer.destroyimages.result', array($this->itemCountProcessed, formatByteSize($deletedFilesize)));
     cliLog($msg);
     $this->finishJob(array('msg' => $msg, 'deletedFileSize' => formatByteSize($deletedFilesize)), __FUNCTION__);
     return;
 }
コード例 #2
0
ファイル: details.php プロジェクト: rechner/taxidi-web
</a>
    <a class="btn btn-success disabled" id="multicheckin">Check in</a>
  </div>
</div>

<div id="photouploadModal" class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">&times;</button>
    <h3><?php 
echo _('Upload New Photo');
?>
</h3>
  </div>
  <div class="modal-body">
    <p><?php 
echo sprintf(_("Uploads are limited to %s and must be in " . "jpeg or png format"), formatByteSize($photo_maxsize));
?>
</p>
    <div>
      <div class="thumbnail" style="width: 250px; margin: 0 auto;">
        <img id="photopreview" style="width: 250px;" src="photo.php<?php 
echo "?id=" . $edata["picture"];
?>
">
      </div>
      <img id="tarimg"></canvas>  
    </div>
    <br>
    <div id="fileselecterror" class="alert alert-error" style="display: none;">
      <?php 
echo _('Error: File type not supported.');