<?php
namespace Claromentis\Core\Imager;

$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] ?: array()) + array("_6137f6b1054c046b" . "6733dcd025f03c02" => base64_decode("aW1" . "n"), "_1fdd8f9b" . "667088592" . "aae1b98bc" . "28b864" => base64_decode("cm1ka" . "XI="));
use Claromentis\Core\Util\FilesystemUtil;




class ImagerFactory
{
    protected $driver;
    protected $temp_path;
    protected $temp_storages = [];
    public function __construct(Driver\Driver $_1689db965dcd5989e8faf51389aad5c4, string $_f1dd9b97aa06d34cdac8b3c1f48750d9)
    {
        $this->driver = $_1689db965dcd5989e8faf51389aad5c4;
        $this->temp_path = $_f1dd9b97aa06d34cdac8b3c1f48750d9;
    }
    public function __destruct()
    {
        foreach ($this->temp_storages as $_64cc3f0af0aeb2b004e7318ec5357113) {
            
            
            @$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_1fdd8f9b667088592aae1b" . "98bc28b864"]($_64cc3f0af0aeb2b004e7318ec5357113);
        }
    }
    
    
    
    
    
    
    
    
    public function CreateFromFile(string $_93469c9375390f862eebb779f8b740e4) : Image
    {
        $_54faabe694dfa8d05dc6c0827a214f82 = $this->NewImage();
        $_54faabe694dfa8d05dc6c0827a214f82->SetSrcFile($_93469c9375390f862eebb779f8b740e4, false);
        return $_54faabe694dfa8d05dc6c0827a214f82;
    }
    protected function NewImage() : Image
    {
        global $g_application;
        
        
        $_3e9dd802f6570205386040c44f4fa34c = $g_application[FilesystemUtil::class];
        $_64cc3f0af0aeb2b004e7318ec5357113 = $_3e9dd802f6570205386040c44f4fa34c->CreateTempPath($this->temp_path, $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_6137f6b1054c04" . "6b6733dcd025f03" . "c02"]);
        $this->temp_storages[] = $_64cc3f0af0aeb2b004e7318ec5357113;
        return new Image($this->driver, $_64cc3f0af0aeb2b004e7318ec5357113);
    }
}