{"action":"created","issue":{"url":"https://api.github.com/repos/kubenstein/middleman-simple-thumbnailer/issues/7","labels_url":"https://api.github.com/repos/kubenstein/middleman-simple-thumbnailer/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/kubenstein/middleman-simple-thumbnailer/issues/7/comments","events_url":"https://api.github.com/repos/kubenstein/middleman-simple-thumbnailer/issues/7/events","html_url":"https://github.com/kubenstein/middleman-simple-thumbnailer/pull/7","id":65727093,"number":7,"title":"Use cached thumbnails in build step if they exist.","user":{"login":"workergnome","id":34536,"avatar_url":"https://avatars.githubusercontent.com/u/34536?v=3","gravatar_id":"","url":"https://api.github.com/users/workergnome","html_url":"https://github.com/workergnome","followers_url":"https://api.github.com/users/workergnome/followers","following_url":"https://api.github.com/users/workergnome/following{/other_user}","gists_url":"https://api.github.com/users/workergnome/gists{/gist_id}","starred_url":"https://api.github.com/users/workergnome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workergnome/subscriptions","organizations_url":"https://api.github.com/users/workergnome/orgs","repos_url":"https://api.github.com/users/workergnome/repos","events_url":"https://api.github.com/users/workergnome/events{/privacy}","received_events_url":"https://api.github.com/users/workergnome/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-01T16:38:50Z","updated_at":"2015-04-06T22:17:50Z","closed_at":"2015-04-06T21:41:03Z","pull_request":{"url":"https://api.github.com/repos/kubenstein/middleman-simple-thumbnailer/pulls/7","html_url":"https://github.com/kubenstein/middleman-simple-thumbnailer/pull/7","diff_url":"https://github.com/kubenstein/middleman-simple-thumbnailer/pull/7.diff","patch_url":"https://github.com/kubenstein/middleman-simple-thumbnailer/pull/7.patch"},"body":"When cached images exist, the build script skips the resize step.  This means that it copies properly named, but full-sized images into the `build` directory.\r\n\r\nThis change will copy the cached images if they exist."},"comment":{"url":"https://api.github.com/repos/kubenstein/middleman-simple-thumbnailer/issues/comments/90262354","html_url":"https://github.com/kubenstein/middleman-simple-thumbnailer/pull/7#issuecomment-90262354","issue_url":"https://api.github.com/repos/kubenstein/middleman-simple-thumbnailer/issues/7","id":90262354,"user":{"login":"noniq","id":244158,"avatar_url":"https://avatars.githubusercontent.com/u/244158?v=3","gravatar_id":"","url":"https://api.github.com/users/noniq","html_url":"https://github.com/noniq","followers_url":"https://api.github.com/users/noniq/followers","following_url":"https://api.github.com/users/noniq/following{/other_user}","gists_url":"https://api.github.com/users/noniq/gists{/gist_id}","starred_url":"https://api.github.com/users/noniq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noniq/subscriptions","organizations_url":"https://api.github.com/users/noniq/orgs","repos_url":"https://api.github.com/users/noniq/repos","events_url":"https://api.github.com/users/noniq/events{/privacy}","received_events_url":"https://api.github.com/users/noniq/received_events","type":"User","site_admin":false},"created_at":"2015-04-06T22:17:50Z","updated_at":"2015-04-06T22:17:50Z","body":"That's indeed a nasty bug introduced by my pull request – sorry for that! :frowning: \r\n\r\nI think I'd slightly prefer to completely ignore any cached thumbnails on build – don't have a real reason for it, it just feels a bit “cleaner” to me.\r\n\r\nTo clean up this mess I'd propose a small restructuring roughly along those lines: \r\n\r\n * Remove `Image#resize!`\r\n * Make sure `Image#base64_data` always returns data for resized image (using cache).\r\n * Make sure `Image#save!` always saves resized image (not using cache).\r\n\r\nI think this would make the code a bit more easier to follow, like “an instance of `Image` represents a resized image always” (whereas currently it’s more “an instance of `Image` represents the original image, until you call `resize!`, from which on it represents the resized image”).\r\n\r\nShould I prepare a pull request for this?"}}