<?php
$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] ?: array()) + array("_e20b559a1b414495c43a" . "4fbbf2e5015e" => base64_decode("aHR0cF9zZW5kX2ZpbG" . "U="), "_3ce655ae4a14421967cc023a6e" . "907ed5" => base64_decode("aXNf" . "Zmls" . "ZQ=="), "_4d707fa" . "b93bebb0" . "0bbe69e8" . "159697c9" . "0" => base64_decode(""), "_3be5fb553" . "18614a35b1" . "1119662d2e" . "169" => base64_decode("cGxh" . "Y2Vo" . "b2xk" . "ZXI="), "i" . "d" => base64_decode("a" . "W" . "Q" . "="), "_f705bcbe9557715c78f1" . "1a9a576dfda3" => base64_decode("aW1hZ2VzL3BsYWNlaG9sZGVyL3BsYWNla" . "G9sZGVyLnBuZw=="), "_c330b85d625b10fb446" . "f351cc78b4d05" => base64_decode("c3RyaXBVbmFsbG93ZWRXaW4zM" . "kNoYXJhY3RlcnM="), "pr" . "ef" . "ix" => base64_decode("cH" . "Jl" . "Zm" . "l4"), "_3d0fad80d1698b9bcb5742bd" . "a96db9f8" => base64_decode("Tm8gcmln" . "aHRz"), "_af66268e41c5634df3c880" . "07939cbf33" => base64_decode("ZG93bmxvYW" . "Q="), "act" . "ion" => base64_decode("YWN0" . "aW9u"), "_f920f0bf40dcf69c4daab1426e0564d" . "6" => base64_decode("V3JvbmcgcGFyYW1ldGVy" . "cw=="), "_11ff9bccdcd23cd6bf9d92884ea6cc" . "39" => base64_decode("Li4vY29tbW9uL2Nvbm5lY3Qu" . "cGhw"), "_2713fc125a2798f62a71e906" . "6f396da7" => base64_decode("Li4vY29tbW9uL2ZpbGVzeXN0ZW0ucGh" . "w"), "_23e3a19ac3ae2" . "de10c19a9b0017" . "556f0" => base64_decode("SW1hZ2UgZmlsZSBkb2Vzbid0I" . "GV4aXN0"), "_2e062cfc" . "10183d31f" . "0f0848e59" . "bfd2b3" => base64_decode("Z2V0X2" . "ZpbGVf" . "ZXh0ZW" . "5zaW9u"), "_5717b327f1f9b8b82a4c07e8" . "006c2719" => base64_decode("cG" . "5n"), "_a62d761f3e831ff9d9da39f9c26ec" . "ddc" => base64_decode("Li4vY29tbW9u" . "L2NvcmUucGhw"), "_20a7dc91" . "60360d28b" . "227a735cd" . "62a71d" => base64_decode("Li4vY29tbW9u" . "L250bG1fc2Vz" . "c2lvbnN0YXJ0" . "LnBocA=="), "_605dec66bbd43fd43b" . "6b2abff58a62ef" => base64_decode("bmF0aXZ" . "l"), "_4be135064c4d5" . "5c13e6af60c45c" . "b1fda" => base64_decode("Z2FsbGVyeS5w" . "ZXJtaXNzaW9u" . "cw=="));










use Claromentis\Gallery\GalleryPermissions;
global $prefix, $action, $default_prefix;
$NO_LOCALIZATION = true;
require_once $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_20a7dc9160360d" . "28b227a735cd62a" . "71d"];
require_once $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_a62d761f3e831ff" . "9d9da39f9c26ecdd" . "c"];
require_once $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_11ff9bccdcd23c" . "d6bf9d92884ea6c" . "c39"];
AuthUser::I()->SetMode(AuthUser::MODE_POPUP)->Init();
\Claromentis\Core\Services::I()->session->save();


require_once $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_2713fc125a2798f62a71e9" . "066f396da7"];
$id = gpc::GetIntOrNull($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["i" . "d"]);
if (!isset($prefix)) {
    $prefix = gpc::GetStringOrNull($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["pref" . "ix"]);
}
if (!isset($action)) {
    $action = gpc::GetStringOrNull($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["acti" . "on"]);
}
if (!$id || gpc::IsError()) {
    die($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_f920f0bf40dcf69c4d" . "aab1426e0564d6"]);
}
if ($prefix != $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_605dec66bbd43fd43b6b2abff58" . "a62ef"]) {
    $thumbnail = new ImageFiles();
    $thumbnail->Load(0, $id, $prefix);
    if (isset($default_prefix) && $thumbnail->GetPrefix() != $prefix) {
        $prefix = $default_prefix;
    }
}
$placeholder_path = $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_f705bcbe9557715c78f11a9a576dfd" . "a3"];
$placeholder_title = $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_3be5fb55318614a35b111" . "19662d2e169"];
$placeholder_type = $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_5717b327f1f9b8b82" . "a4c07e8006c2719"];
if ($prefix == $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_605dec66bbd43fd43b6b" . "2abff58a62ef"]) {
    $image_obj = new Image($id);
    $imagefile = $image_obj->GetImageFilePath();
    $file_title = $image_obj->GetTitle();
    $file_type = $image_obj->GetFileType();
    if (!$image_obj->ImageFileExists()) {
        $imagefile = $placeholder_path;
        $file_title = $placeholder_title;
        $file_type = $placeholder_type;
    }
    $album_id = $image_obj->GetAlbumId();
} else {
    
    
    $imagefile = $thumbnail->GetImageFilePath();
    $file_title = $thumbnail->parent_image->GetTitle();
    $file_type = $thumbnail->parent_image->GetFileType();
    if (!$thumbnail->parent_image->ImageFileExists()) {
        
        
        $imagefile = $placeholder_path;
        $file_title = $placeholder_title;
        $file_type = $placeholder_type;
    } else {
        if (!$imagefile) {
            
            
            
            $imagefile = $placeholder_path;
        }
    }
    $album_id = $thumbnail->parent_image->GetAlbumId();
}
$gallery_perms = $g_application[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_4be135064c4" . "d55c13e6af60" . "c45cb1fda"]];


if (!$gallery_perms->CanIViewAlbum($album_id)) {
    die($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_3d0fad80d1698b9bc" . "b5742bda96db9f8"]);
}
if (!$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_3ce655ae4a14421967cc023a" . "6e907ed5"]($imagefile)) {
    die($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_23e3a19ac3a" . "e2de10c19a9b" . "0017556f0"]);
}
$file_extension = !$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_2e062cfc" . "10183d31f" . "0f0848e59" . "bfd2b3"]($file_title, true) ? Image::ImageTypeToExtension($file_type, true) : $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_4d707fab93bebb00bbe69" . "e8159697c90"];
$full_name = $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_c330b85d625b10fb44" . "6f351cc78b4d05"]($file_title . $file_extension);
$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_e20b559a1b414495c43a" . "4fbbf2e5015e"]($full_name, $imagefile, $action == $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_af66268e41c5634df3c8" . "8007939cbf33"] ? DOWNLOAD : INLINE);