{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/13609","labels_url":"https://api.github.com/repos/owncloud/core/issues/13609/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/13609/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/13609/events","html_url":"https://github.com/owncloud/core/issues/13609","id":55176551,"number":13609,"title":"Fixing preview caching","user":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/31","labels_url":"https://api.github.com/repos/owncloud/core/milestones/31/labels","id":912160,"number":31,"title":"8.1-next","description":"","creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":244,"closed_issues":0,"state":"open","created_at":"2014-12-22T12:04:01Z","updated_at":"2015-01-22T16:56:05Z","due_on":"2015-04-02T22:00:00Z","closed_at":null},"comments":6,"created_at":"2015-01-22T16:43:04Z","updated_at":"2015-01-22T17:37:46Z","closed_at":null,"body":"This is a meta ticket for OC8.1 used to reference all the various problems that need sorting so that preview generation and caching works quickly in all situations. The current solution is unbearably slow as soon as large images are involved.\r\n\r\n## Current situation\r\n### Asking for the first preview\r\nThis can be a Files thumbnail or a Gallery image per example, depending on how the picture was uploaded\r\n#### The preview class collapses https://github.com/owncloud/core/issues/13493\r\n* [ ] One step is to move the preview system to app framework https://github.com/owncloud/core/issues/13610. This would not solve all problems as some apps use the AppFramwork's PreviewManager internally\r\n\r\n#### Large previews are returned by some preview providers https://github.com/owncloud/core/issues/13607\r\n* [ ] Introduce maximum dimensions in the config https://github.com/owncloud/core/pull/13582\r\n* [ ] Force providers to use that setting \r\n\r\n#### Thumbnails of large files result in a time-out https://github.com/owncloud/core/issues/13218\r\n* [ ] Introduce a max file size setting https://github.com/owncloud/core/pull/13449\r\n* [ ] Fix the PHP Fatal error. https://github.com/owncloud/core/blob/master/lib/private/image.php#L470\r\n\r\n#### Save memory by streaming  large previews straight from disk https://github.com/owncloud/core/issues/13611\r\n* [ ] Waiting for StreamedResponse to land in AppFramework\r\n\r\n### Asking for a new preview of different size\r\n#### Caching seems to not be working https://github.com/owncloud/core/issues/13516\r\nMany PRs touching on thumbnail generation performance are affected by this, but the people most affected are the ones using large images, especially in formats which need to be converted by ImageMagick\r\n* [ ] Cache the largest possible preview and use that for all subsequent resizing requests https://github.com/owncloud/core/pull/13582\r\n* [ ] Use preview categories to fulfil requests https://github.com/owncloud/core/issues/8196\r\n\r\n## How things will work\r\nOnce all those issues are fixed, we should have something that works like this\r\n### Asking for the first preview\r\n* Is size less than 50MB? Only process those\r\n* Do we have a max preview? If not, ask the provider for a 2048x2048 preview and it will return exactly that\r\n* Store that max preview, resize it to fulfil the request and send it back\r\n\r\n### Asking for a new preview of different size\r\n* Is a preview of that exact dimension stored already? Use that\r\n* If not, do we have a preview for this preview category? Use that\r\n* If not let's create a new preview for that category from the max preview and store it in the cache\r\n\r\n@georgehrke Feel free to add any missing issues and PRs.\r\nPeople who might be interested in this: @libasys @icewind1991 \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/71062254","html_url":"https://github.com/owncloud/core/issues/13609#issuecomment-71062254","issue_url":"https://api.github.com/repos/owncloud/core/issues/13609","id":71062254,"user":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T17:37:46Z","updated_at":"2015-01-22T17:37:46Z","body":"I guess if OC_Image doesn't need to load the data in memory to do its processing, it would be a good thing to have, yes.\r\n"}}