{"action":"created","issue":{"url":"https://api.github.com/repos/burzum/cakephp-file-storage/issues/110","labels_url":"https://api.github.com/repos/burzum/cakephp-file-storage/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/burzum/cakephp-file-storage/issues/110/comments","events_url":"https://api.github.com/repos/burzum/cakephp-file-storage/issues/110/events","html_url":"https://github.com/burzum/cakephp-file-storage/issues/110","id":114484210,"number":110,"title":"Creating versions of images not working","user":{"login":"anto2b","id":3892090,"avatar_url":"https://avatars.githubusercontent.com/u/3892090?v=3","gravatar_id":"","url":"https://api.github.com/users/anto2b","html_url":"https://github.com/anto2b","followers_url":"https://api.github.com/users/anto2b/followers","following_url":"https://api.github.com/users/anto2b/following{/other_user}","gists_url":"https://api.github.com/users/anto2b/gists{/gist_id}","starred_url":"https://api.github.com/users/anto2b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anto2b/subscriptions","organizations_url":"https://api.github.com/users/anto2b/orgs","repos_url":"https://api.github.com/users/anto2b/repos","events_url":"https://api.github.com/users/anto2b/events{/privacy}","received_events_url":"https://api.github.com/users/anto2b/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/burzum/cakephp-file-storage/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"burzum","id":162789,"avatar_url":"https://avatars.githubusercontent.com/u/162789?v=3","gravatar_id":"","url":"https://api.github.com/users/burzum","html_url":"https://github.com/burzum","followers_url":"https://api.github.com/users/burzum/followers","following_url":"https://api.github.com/users/burzum/following{/other_user}","gists_url":"https://api.github.com/users/burzum/gists{/gist_id}","starred_url":"https://api.github.com/users/burzum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burzum/subscriptions","organizations_url":"https://api.github.com/users/burzum/orgs","repos_url":"https://api.github.com/users/burzum/repos","events_url":"https://api.github.com/users/burzum/events{/privacy}","received_events_url":"https://api.github.com/users/burzum/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/burzum/cakephp-file-storage/milestones/1","html_url":"https://github.com/burzum/cakephp-file-storage/milestones/1.0.0","labels_url":"https://api.github.com/repos/burzum/cakephp-file-storage/milestones/1/labels","id":997957,"number":1,"title":"1.0.0","description":"","creator":{"login":"burzum","id":162789,"avatar_url":"https://avatars.githubusercontent.com/u/162789?v=3","gravatar_id":"","url":"https://api.github.com/users/burzum","html_url":"https://github.com/burzum","followers_url":"https://api.github.com/users/burzum/followers","following_url":"https://api.github.com/users/burzum/following{/other_user}","gists_url":"https://api.github.com/users/burzum/gists{/gist_id}","starred_url":"https://api.github.com/users/burzum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burzum/subscriptions","organizations_url":"https://api.github.com/users/burzum/orgs","repos_url":"https://api.github.com/users/burzum/repos","events_url":"https://api.github.com/users/burzum/events{/privacy}","received_events_url":"https://api.github.com/users/burzum/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":7,"state":"open","created_at":"2015-02-26T22:31:55Z","updated_at":"2015-11-02T09:42:08Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-11-01T18:21:14Z","updated_at":"2015-11-02T11:58:13Z","closed_at":null,"body":"Cake PHP 3\r\nPHP Version 5.5.12\r\n\r\nWhen I try to create versions of my image i have an error (without versions it works !). Here is my stackrace : \r\n\r\n```\r\nInvalid log level \"file_storage\"\r\nInvalidArgumentException\r\n\r\n⟩ Cake\\Log\\Log::write\r\nCORE\\src\\Log\\LogTrait.php, line 36\r\n⟩ Burzum\\FileStorage\\Event\\AbstractStorageEventListener->log\r\nROOT\\vendor\\burzum\\file-storage\\src\\Event\\ImageProcessingListener.php, line 287\r\n⟩ Burzum\\FileStorage\\Event\\ImageProcessingListener->afterSave\r\nCORE\\src\\Event\\EventManager.php, line 389\r\n⟩ Cake\\Event\\EventManager->_callListener\r\nCORE\\src\\Event\\EventManager.php, line 355\r\n⟩ Cake\\Event\\EventManager->dispatch\r\nROOT\\vendor\\burzum\\file-storage\\src\\Model\\Table\\ImageStorageTable.php, line 81\r\n⟩ Burzum\\FileStorage\\Model\\Table\\ImageStorageTable->afterSave\r\nCORE\\src\\Event\\EventManager.php, line 389\r\n⟩ Cake\\Event\\EventManager->_callListener\r\nCORE\\src\\Event\\EventManager.php, line 355\r\n⟩ Cake\\Event\\EventManager->dispatch\r\nCORE\\src\\Event\\EventDispatcherTrait.php, line 78\r\n⟩ Cake\\ORM\\Table->dispatchEvent\r\nCORE\\src\\ORM\\Table.php, line 1459\r\n⟩ Cake\\ORM\\Table->_processSave\r\nCORE\\src\\ORM\\Table.php, line 1377\r\n⟩ Cake\\ORM\\Table->Cake\\ORM\\{closure}\r\nCORE\\src\\Database\\Connection.php, line 557\r\n⟩ Cake\\Database\\Connection->transactional\r\nCORE\\src\\ORM\\Table.php, line 1378\r\n⟩ Cake\\ORM\\Table->save\r\nAPP/Model\\Table\\CompanyImagesTable.php, line 32\r\n⟩ App\\Model\\Table\\CompanyImagesTable->uploadImage\r\n[internal function]\r\n⟩ call_user_func_array\r\nCORE\\src\\ORM\\Association.php, line 896\r\n⟩ Cake\\ORM\\Association->__call\r\nAPP/Controller\\CompaniesEditionController.php, line 131\r\n⟩ Cake\\ORM\\Association\\HasMany->uploadImage\r\nAPP/Controller\\CompaniesEditionController.php, line 131\r\n⟩ App\\Controller\\CompaniesEditionController->upload\r\n[internal function]\r\n⟩ call_user_func_array\r\nCORE\\src\\Controller\\Controller.php, line 429\r\n⟩ Cake\\Controller\\Controller->invokeAction\r\nCORE\\src\\Routing\\Dispatcher.php, line 114\r\n⟩ Cake\\Routing\\Dispatcher->_invoke\r\nCORE\\src\\Routing\\Dispatcher.php, line 87\r\n⟩ Cake\\Routing\\Dispatcher->dispatch\r\nROOT\\webroot\\index.php, line 37\r\n\r\n```\r\n\r\nMy file_storage.php in APP/config/\r\n\r\n```\r\n<?php\r\n\r\nuse Burzum\\FileStorage\\Event\\ImageProcessingListener;\r\nuse Burzum\\FileStorage\\Lib\\FileStorageUtils;\r\nuse Cake\\Core\\Configure;\r\nuse Cake\\Event\\EventManager;\r\n\r\n$listener = new ImageProcessingListener();\r\nEventManager::instance()->on($listener);\r\n\r\nConfigure::write('FileStorage', [\r\n    'imageSizes' => [\r\n        'CompanyImage' => [\r\n            'small' => [\r\n                'crop' => [\r\n                    'width' => 50, 'height' => 50\r\n                ],\r\n            ]\r\n        ]\r\n    ]\r\n]);\r\n\r\nFileStorageUtils::generateHashes();\r\n\r\n```\r\n\r\nMy CompanyImagesTable.php\r\n\r\n```\r\n<?php\r\nnamespace App\\Model\\Table;\r\n\r\nuse Burzum\\FileStorage\\Model\\Table\\ImageStorageTable;\r\n\r\nclass CompanyImagesTable extends ImageStorageTable\r\n{\r\n    public function initialize(array $config)\r\n    {\r\n        $this->belongsTo('Companies');\r\n    }\r\n\r\n    public function uploadImage($companyID, $entity)\r\n    {\r\n        $entity = $this->patchEntity($entity, [\r\n            'adapter' => 'Local',\r\n            'model' => 'CompanyImage',\r\n            'company_id' => $companyID\r\n        ]);\r\n\r\n        return $this->save($entity);\r\n    }\r\n\r\n}\r\n\r\n```\r\n\r\nCompaniesTable.php\r\n\r\n```\r\n\r\n<?php\r\n\r\nnamespace App\\Model\\Table;\r\n\r\nuse Cake\\ORM\\Query;\r\nuse Cake\\ORM\\RulesChecker;\r\nuse Cake\\ORM\\Table;\r\nuse Cake\\Validation\\Validator;\r\n\r\nclass CompaniesTable extends Table\r\n{\r\n\r\n    public function initialize(array $config)\r\n    {\r\n        $this->hasMany('CompanyImages');\r\n        ... \r\n    }\r\n\r\n}\r\n\r\n```\r\nMy Controller action\r\n\r\n```\r\npublic function upload()\r\n    {\r\n        if ($this->request->is(['post', 'put']))\r\n        {\r\n            $entity = $this->t_companies->CompanyImages->newEntity($this->request->data());\r\n\r\n            if ($this->t_companies->CompanyImages->uploadImage($this->company->id, $entity))\r\n            {\r\n                echo 'ok';\r\n            }\r\n            else echo 'error';\r\n        }\r\n    }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/burzum/cakephp-file-storage/issues/comments/152998280","html_url":"https://github.com/burzum/cakephp-file-storage/issues/110#issuecomment-152998280","issue_url":"https://api.github.com/repos/burzum/cakephp-file-storage/issues/110","id":152998280,"user":{"login":"anto2b","id":3892090,"avatar_url":"https://avatars.githubusercontent.com/u/3892090?v=3","gravatar_id":"","url":"https://api.github.com/users/anto2b","html_url":"https://github.com/anto2b","followers_url":"https://api.github.com/users/anto2b/followers","following_url":"https://api.github.com/users/anto2b/following{/other_user}","gists_url":"https://api.github.com/users/anto2b/gists{/gist_id}","starred_url":"https://api.github.com/users/anto2b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anto2b/subscriptions","organizations_url":"https://api.github.com/users/anto2b/orgs","repos_url":"https://api.github.com/users/anto2b/repos","events_url":"https://api.github.com/users/anto2b/events{/privacy}","received_events_url":"https://api.github.com/users/anto2b/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T11:58:13Z","updated_at":"2015-11-02T11:58:13Z","body":"Sorry, I forgot to import the plugin in my bootstrap.php. I added this\r\n\r\n```\r\nPlugin::load('Burzum/Imagine');\r\nConfigure::write('Imagine.salt', 'n945nun6ctfzuygh6wpm86f2rtun2gnddd8qxjk2zrpkcvr9g5hcxp3');\r\n```\r\n\r\nNow, I have no errors in my log files but the different versions of my image are not created. \r\n\r\nI have juste the original image in APP/tmp/images/CompanyImage/07/69/58/50/50.jpg "}}