Ejemplo n.º 1
0
 public static function getImages()
 {
     // get plist
     $plist = iPhoto::getPlist();
     if ($plist == null) {
         return null;
     }
     // build images array
     $images = array();
     foreach ($plist['Master Image List'] as $id => $plist_image) {
         // check
         if (in_array($plist_image['MediaType'], array('Image', 'Movie')) == false) {
             continue;
         }
         // build image
         $image = Image::FromPlist($plist_image);
         // done
         $images[$id] = $image;
     }
     // done
     return $images;
 }
Ejemplo n.º 2
0
<?php

// needed
require_once 'includes/iphoto2mac.php';
// specials
$id = $_REQUEST['id'];
if ($id == 'all') {
    // more complex
    $rolls = iPhoto::getRolls();
    Globals::$History = array_keys($rolls);
} else {
    if ($id == 'none') {
        // clear
        Globals::$History = array();
    } else {
        // push value
        Globals::$History[] = $_REQUEST['id'];
    }
}
// save history
save_history();
Ejemplo n.º 3
0
function _log($msg)
{
    error_log($msg . PHP_EOL, 3, LOG_FILE);
}
// make sure we clean up properly
function update_status()
{
    if ($_SESSION[SESSION_STATUS] != STATUS_COMPLETED) {
        $_SESSION[SESSION_STATUS] = STATUS_ABORTED;
    }
}
register_shutdown_function('update_status');
// need that
$reports = array();
$rolls = iPhoto::getRolls();
$images = iPhoto::getImages();
// progress management
function inc_session_progress($current, $count = 1)
{
    $_SESSION[SESSION_PROCESSED] = $_SESSION[SESSION_PROCESSED] + $count;
    $_SESSION[SESSION_CURRENT_THUMB] = $current;
    session_write_close();
    session_start();
}
// start
$_SESSION[SESSION_STATUS] = STATUS_RUNNING;
// iterate
$rolls = $_SESSION[SESSION_TODO];
foreach ($rolls as $roll) {
    // update title
    $_SESSION[SESSION_CURRENT_TITLE] = $roll->name;