{"action":"created","issue":{"url":"https://api.github.com/repos/jmagnusson/Flask-Resize/issues/10","labels_url":"https://api.github.com/repos/jmagnusson/Flask-Resize/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/jmagnusson/Flask-Resize/issues/10/comments","events_url":"https://api.github.com/repos/jmagnusson/Flask-Resize/issues/10/events","html_url":"https://github.com/jmagnusson/Flask-Resize/issues/10","id":112627720,"number":10,"title":"Sugestion: Return orriginal image if resize is same size","user":{"login":"torrentails","id":1060901,"avatar_url":"https://avatars.githubusercontent.com/u/1060901?v=3","gravatar_id":"","url":"https://api.github.com/users/torrentails","html_url":"https://github.com/torrentails","followers_url":"https://api.github.com/users/torrentails/followers","following_url":"https://api.github.com/users/torrentails/following{/other_user}","gists_url":"https://api.github.com/users/torrentails/gists{/gist_id}","starred_url":"https://api.github.com/users/torrentails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torrentails/subscriptions","organizations_url":"https://api.github.com/users/torrentails/orgs","repos_url":"https://api.github.com/users/torrentails/repos","events_url":"https://api.github.com/users/torrentails/events{/privacy}","received_events_url":"https://api.github.com/users/torrentails/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-21T16:24:08Z","updated_at":"2015-10-22T06:40:21Z","closed_at":null,"body":"I noticed that when using a resize size that was the same size as the original file or when specifying a larger size with `upscale=False`, that a hashed cache file was still created.\r\n\r\nI haven't delved into the code enough so I don't know if the cached file is a direct copy but even if it is, at best Flask-Resize is creating excess duplicate files, which could be a problem on a large image cdn and, at worst, is performing excess processing as well to produce the same image, which results in extra cpu usage and possibly a loss in quality.\r\n\r\nI would recommend, if no other transformations of the image need to be performed and the requested size is the same as the original size, then Flask-Resize should serve the original image. perhaps add another possible parameter and call it `force_cache` or similar, and default it to `False`; setting the parameter to `True` will then force Flask-Resize to produce a cached image, even if size is the same as the original."},"comment":{"url":"https://api.github.com/repos/jmagnusson/Flask-Resize/issues/comments/150123173","html_url":"https://github.com/jmagnusson/Flask-Resize/issues/10#issuecomment-150123173","issue_url":"https://api.github.com/repos/jmagnusson/Flask-Resize/issues/10","id":150123173,"user":{"login":"jmagnusson","id":190835,"avatar_url":"https://avatars.githubusercontent.com/u/190835?v=3","gravatar_id":"","url":"https://api.github.com/users/jmagnusson","html_url":"https://github.com/jmagnusson","followers_url":"https://api.github.com/users/jmagnusson/followers","following_url":"https://api.github.com/users/jmagnusson/following{/other_user}","gists_url":"https://api.github.com/users/jmagnusson/gists{/gist_id}","starred_url":"https://api.github.com/users/jmagnusson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmagnusson/subscriptions","organizations_url":"https://api.github.com/users/jmagnusson/orgs","repos_url":"https://api.github.com/users/jmagnusson/repos","events_url":"https://api.github.com/users/jmagnusson/events{/privacy}","received_events_url":"https://api.github.com/users/jmagnusson/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T06:40:21Z","updated_at":"2015-10-22T06:40:21Z","body":"Hi @torrentails,\r\n\r\nThanks for taking your time to think through this. I would imagine that the code still generates a new cache file when `upscale=False` and equal/larger dimensions are encountered. Your idea would be a great addition to the package. I don't have the time right now to implement it, but I'll leave this ticket open for when I do."}}