<?php

require '../header.php';

$data = array();
$data["success"] = false;

if ( !isset($_REQUEST['imageid']) ) {
    sendResponse($data);
}

$image = new Image($_REQUEST['imageid']);
if ( $image->getID() == 0 ) {
    sendResponse($data);
}

$data["image"] = $image;

$data["success"] = true;
sendResponse($data);

function sendResponse($data) {
    header('Content-Type: application/json');
    echo json_encode($data);
    exit();
}

exit();

// vim: set ts=4:sw=4
