Ejemplo n.º 1
0
        foreach ($size as &$s) {
            $s *= 2;
        }
        unset($s);
        $size = implode('x', $size);
    }
}
wa()->getStorage()->close();
if ($file && file_exists($protected_path . $file) && !file_exists($public_path . $request_file)) {
    $main_thumb_file_path = $public_path . $main_thumb_file;
    $target_dir_path = dirname($public_path . $request_file);
    if (!file_exists($target_dir_path)) {
        waFiles::create($target_dir_path . '/');
    }
    $max_size = $app_config->getOption('max_size');
    $image = photosPhoto::generateThumb(array('path' => $main_thumb_file_path, 'size' => $main_thumbnail_size), $protected_path . $file, $size, $app_config->getOption('sharpen'), $max_size ? $enable_2x ? 2 * $max_size : $max_size : false);
    if ($image) {
        $quality = $app_config->getSaveQuality($enable_2x);
        $image->save($public_path . $request_file, $quality);
        clearstatcache();
    }
}
if ($file && file_exists($public_path . $request_file)) {
    waFiles::readFile($public_path . $request_file);
} else {
    /*
    $url = wa()->getRootUrl();
    $url = substr($url, 0, -strlen('/wa-data/public/photo/'));
    header("Location: ".$url."wa-apps/photos/img/image-not-found.png");
    */
    header("HTTP/1.0 404 Not Found");