[Frubar Paste] Hosted by SkyLime - Chat with us at XChannel IRC

Posted by file_searchphp on Tue 12th Jun 22:57
download

  1. <?php
  2.  
  3. ini_set('error_reporting', E_ALL);
  4. ini_set('display_errors', true);
  5.  
  6. $return_convert = 0;
  7. $CONVERT='C:/httpd/ImageMagick/convert.exe';
  8. $PIC_BASEDIR='C:/Users/m0nn3/Pictures';
  9. $HTTP_ROOT='C:/httpd/htdocs';
  10. $CAMS=array('02', '03', '04', '05', '06', '07', '08');
  11. //$CAMS=array('7');
  12.  
  13. foreach ($CAMS as $CAM)
  14. {
  15.     $PICS_ORIGINAL[]=$PIC_BASEDIR.'/original/'.$CAM.'/';
  16. }
  17.  
  18. foreach ($PICS_ORIGINAL as $CAMDIR)
  19. {
  20.     $files = scandir($CAMDIR);
  21.     foreach ($files as $file)
  22.     {
  23.           if(is_file($CAMDIR.$file))
  24.             if(!is_file(str_replace('original', 'resized', str_replace('C:/Users/m0nn3/Pictures','C:/httpd/htdocs', $CAMDIR.$file))))
  25.             {
  26.                 system($CONVERT.' -quality 100 -geometry 400 '.$CAMDIR.$file.' '.str_replace('original', 'resized', str_replace('C:/Users/m0nn3/Pictures','C:/httpd/htdocs', $CAMDIR.$file)), $return_convert);
  27.                 if($return_convert != 0)
  28.                     echo 'fehler beim umwandeln von '.$CAMDIR.$file."\n";
  29.  
  30.             }
  31.     }
  32. }
  33.  
  34. $handle = @fopen("C:/httpd/htdocs/pictures.list", "w");
  35.  
  36. foreach ($CAMS as $CAM)
  37. {
  38.     $PICS_RESIZED[]=$HTTP_ROOT.'/resized/'.$CAM.'/';
  39. }
  40.  
  41.  
  42. foreach ($PICS_RESIZED as $CAMDIR)
  43. {
  44.     $files = scandir($CAMDIR);
  45.     foreach ($files as $file)
  46.     {
  47. //        if(finfo_file($finfo, $CAMDIR.$file) == "image/jpeg")
  48.                                         if(is_file($CAMDIR.$file))
  49.             fputs($handle, str_replace($HTTP_ROOT,'',$CAMDIR.$file)."\n");
  50.     }
  51. }
  52.  
  53. fclose($handle);
  54.  
  55. echo '</pre>';
  56. echo '</body></html>';
  57.  
  58. ?>


Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.



Remember my name in a cookie


Code: To highlight particular lines, prefix each line with @@.
Include comments to indicate what you need feedback on.