{"action":"closed","number":5,"pull_request":{"url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/5","id":55185798,"html_url":"https://github.com/haydenbleasel/gulp-jimp/pull/5","diff_url":"https://github.com/haydenbleasel/gulp-jimp/pull/5.diff","patch_url":"https://github.com/haydenbleasel/gulp-jimp/pull/5.patch","issue_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/issues/5","number":5,"state":"closed","locked":false,"title":"Retain the source directory structure when creating new files","user":{"login":"bensmithett","id":771396,"avatar_url":"https://avatars.githubusercontent.com/u/771396?v=3","gravatar_id":"","url":"https://api.github.com/users/bensmithett","html_url":"https://github.com/bensmithett","followers_url":"https://api.github.com/users/bensmithett/followers","following_url":"https://api.github.com/users/bensmithett/following{/other_user}","gists_url":"https://api.github.com/users/bensmithett/gists{/gist_id}","starred_url":"https://api.github.com/users/bensmithett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensmithett/subscriptions","organizations_url":"https://api.github.com/users/bensmithett/orgs","repos_url":"https://api.github.com/users/bensmithett/repos","events_url":"https://api.github.com/users/bensmithett/events{/privacy}","received_events_url":"https://api.github.com/users/bensmithett/received_events","type":"User","site_admin":false},"body":":construction_worker: I don't really know what I'm doing with gulp plugin development, so this may not be the best way to achieve this :construction_worker: but it works for me!\r\n\r\nI wanted to use gulp-jimp like so:\r\n\r\n```es6\r\n  gulp.src('original_photos/**/*.jpg', {base: 'original_photos'})\r\n    .pipe(jimp({\r\n      '@1x': {\r\n        resize: {width: 500}\r\n      },\r\n      '@2x': {\r\n        resize: {width: 1000}\r\n      }\r\n    }))\r\n    .pipe(gulp.dest('dist/photos'))\r\n```\r\n\r\nGiven these original files...\r\n\r\n```\r\noriginal_photos/foo/a.jpg\r\noriginal_photos/bar/b.jpg\r\n```\r\n\r\n... I expected this output...\r\n\r\n```\r\ndist/photos/foo/a@1x.jpg\r\ndist/photos/foo/a@2x.jpg\r\ndist/photos/bar/b@1x.jpg\r\ndist/photos/bar/b@2x.jpg\r\n```\r\n\r\n...but got this:\r\n\r\n```\r\ndist/photos/a@1x.jpg\r\ndist/photos/a@2x.jpg\r\ndist/photos/b@1x.jpg\r\ndist/photos/b@2x.jpg\r\n```\r\n\r\nEverything gets flattened, which (for me at least) wasn't desirable. Flattening is pretty easy with [gulp-flatten](https://github.com/armed/gulp-flatten) for those cases where it is desirable.\r\n\r\nWhen creating the new files, the plugin wasn't passing through the `base` and `dirname` of the source file, which is necessary if you want to retain the source directory structure in your output. I just added those options.\r\n\r\nCheers for the excellent plugin :smile: ","created_at":"2016-01-06T07:46:58Z","updated_at":"2016-08-18T11:55:59Z","closed_at":"2016-08-18T11:55:58Z","merged_at":"2016-08-18T11:55:58Z","merge_commit_sha":"e7b8782936ea737338fe167889812ddc0a9d59dc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/5/commits","review_comments_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/5/comments","review_comment_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/issues/5/comments","statuses_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/statuses/ff8164158e3f8ae96ab64951e1fe9343402f4e4d","head":{"label":"bensmithett:retain-path","ref":"retain-path","sha":"ff8164158e3f8ae96ab64951e1fe9343402f4e4d","user":{"login":"bensmithett","id":771396,"avatar_url":"https://avatars.githubusercontent.com/u/771396?v=3","gravatar_id":"","url":"https://api.github.com/users/bensmithett","html_url":"https://github.com/bensmithett","followers_url":"https://api.github.com/users/bensmithett/followers","following_url":"https://api.github.com/users/bensmithett/following{/other_user}","gists_url":"https://api.github.com/users/bensmithett/gists{/gist_id}","starred_url":"https://api.github.com/users/bensmithett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensmithett/subscriptions","organizations_url":"https://api.github.com/users/bensmithett/orgs","repos_url":"https://api.github.com/users/bensmithett/repos","events_url":"https://api.github.com/users/bensmithett/events{/privacy}","received_events_url":"https://api.github.com/users/bensmithett/received_events","type":"User","site_admin":false},"repo":{"id":49120310,"name":"gulp-jimp","full_name":"bensmithett/gulp-jimp","owner":{"login":"bensmithett","id":771396,"avatar_url":"https://avatars.githubusercontent.com/u/771396?v=3","gravatar_id":"","url":"https://api.github.com/users/bensmithett","html_url":"https://github.com/bensmithett","followers_url":"https://api.github.com/users/bensmithett/followers","following_url":"https://api.github.com/users/bensmithett/following{/other_user}","gists_url":"https://api.github.com/users/bensmithett/gists{/gist_id}","starred_url":"https://api.github.com/users/bensmithett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensmithett/subscriptions","organizations_url":"https://api.github.com/users/bensmithett/orgs","repos_url":"https://api.github.com/users/bensmithett/repos","events_url":"https://api.github.com/users/bensmithett/events{/privacy}","received_events_url":"https://api.github.com/users/bensmithett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bensmithett/gulp-jimp","description":"A JIMP wrapper for Gulp","fork":true,"url":"https://api.github.com/repos/bensmithett/gulp-jimp","forks_url":"https://api.github.com/repos/bensmithett/gulp-jimp/forks","keys_url":"https://api.github.com/repos/bensmithett/gulp-jimp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bensmithett/gulp-jimp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bensmithett/gulp-jimp/teams","hooks_url":"https://api.github.com/repos/bensmithett/gulp-jimp/hooks","issue_events_url":"https://api.github.com/repos/bensmithett/gulp-jimp/issues/events{/number}","events_url":"https://api.github.com/repos/bensmithett/gulp-jimp/events","assignees_url":"https://api.github.com/repos/bensmithett/gulp-jimp/assignees{/user}","branches_url":"https://api.github.com/repos/bensmithett/gulp-jimp/branches{/branch}","tags_url":"https://api.github.com/repos/bensmithett/gulp-jimp/tags","blobs_url":"https://api.github.com/repos/bensmithett/gulp-jimp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bensmithett/gulp-jimp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bensmithett/gulp-jimp/git/refs{/sha}","trees_url":"https://api.github.com/repos/bensmithett/gulp-jimp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bensmithett/gulp-jimp/statuses/{sha}","languages_url":"https://api.github.com/repos/bensmithett/gulp-jimp/languages","stargazers_url":"https://api.github.com/repos/bensmithett/gulp-jimp/stargazers","contributors_url":"https://api.github.com/repos/bensmithett/gulp-jimp/contributors","subscribers_url":"https://api.github.com/repos/bensmithett/gulp-jimp/subscribers","subscription_url":"https://api.github.com/repos/bensmithett/gulp-jimp/subscription","commits_url":"https://api.github.com/repos/bensmithett/gulp-jimp/commits{/sha}","git_commits_url":"https://api.github.com/repos/bensmithett/gulp-jimp/git/commits{/sha}","comments_url":"https://api.github.com/repos/bensmithett/gulp-jimp/comments{/number}","issue_comment_url":"https://api.github.com/repos/bensmithett/gulp-jimp/issues/comments{/number}","contents_url":"https://api.github.com/repos/bensmithett/gulp-jimp/contents/{+path}","compare_url":"https://api.github.com/repos/bensmithett/gulp-jimp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bensmithett/gulp-jimp/merges","archive_url":"https://api.github.com/repos/bensmithett/gulp-jimp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bensmithett/gulp-jimp/downloads","issues_url":"https://api.github.com/repos/bensmithett/gulp-jimp/issues{/number}","pulls_url":"https://api.github.com/repos/bensmithett/gulp-jimp/pulls{/number}","milestones_url":"https://api.github.com/repos/bensmithett/gulp-jimp/milestones{/number}","notifications_url":"https://api.github.com/repos/bensmithett/gulp-jimp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bensmithett/gulp-jimp/labels{/name}","releases_url":"https://api.github.com/repos/bensmithett/gulp-jimp/releases{/id}","deployments_url":"https://api.github.com/repos/bensmithett/gulp-jimp/deployments","created_at":"2016-01-06T07:32:09Z","updated_at":"2016-01-06T07:32:10Z","pushed_at":"2016-01-06T07:35:19Z","git_url":"git://github.com/bensmithett/gulp-jimp.git","ssh_url":"git@github.com:bensmithett/gulp-jimp.git","clone_url":"https://github.com/bensmithett/gulp-jimp.git","svn_url":"https://github.com/bensmithett/gulp-jimp","homepage":null,"size":79,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"haydenbleasel:master","ref":"master","sha":"7eb00db26a112c4d6f7d5a9c7f1b9bbd05a17400","user":{"login":"haydenbleasel","id":4142719,"avatar_url":"https://avatars.githubusercontent.com/u/4142719?v=3","gravatar_id":"","url":"https://api.github.com/users/haydenbleasel","html_url":"https://github.com/haydenbleasel","followers_url":"https://api.github.com/users/haydenbleasel/followers","following_url":"https://api.github.com/users/haydenbleasel/following{/other_user}","gists_url":"https://api.github.com/users/haydenbleasel/gists{/gist_id}","starred_url":"https://api.github.com/users/haydenbleasel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haydenbleasel/subscriptions","organizations_url":"https://api.github.com/users/haydenbleasel/orgs","repos_url":"https://api.github.com/users/haydenbleasel/repos","events_url":"https://api.github.com/users/haydenbleasel/events{/privacy}","received_events_url":"https://api.github.com/users/haydenbleasel/received_events","type":"User","site_admin":false},"repo":{"id":47042871,"name":"gulp-jimp","full_name":"haydenbleasel/gulp-jimp","owner":{"login":"haydenbleasel","id":4142719,"avatar_url":"https://avatars.githubusercontent.com/u/4142719?v=3","gravatar_id":"","url":"https://api.github.com/users/haydenbleasel","html_url":"https://github.com/haydenbleasel","followers_url":"https://api.github.com/users/haydenbleasel/followers","following_url":"https://api.github.com/users/haydenbleasel/following{/other_user}","gists_url":"https://api.github.com/users/haydenbleasel/gists{/gist_id}","starred_url":"https://api.github.com/users/haydenbleasel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haydenbleasel/subscriptions","organizations_url":"https://api.github.com/users/haydenbleasel/orgs","repos_url":"https://api.github.com/users/haydenbleasel/repos","events_url":"https://api.github.com/users/haydenbleasel/events{/privacy}","received_events_url":"https://api.github.com/users/haydenbleasel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/haydenbleasel/gulp-jimp","description":"A JIMP wrapper for Gulp","fork":false,"url":"https://api.github.com/repos/haydenbleasel/gulp-jimp","forks_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/forks","keys_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/teams","hooks_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/hooks","issue_events_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/issues/events{/number}","events_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/events","assignees_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/assignees{/user}","branches_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/branches{/branch}","tags_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/tags","blobs_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/git/refs{/sha}","trees_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/statuses/{sha}","languages_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/languages","stargazers_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/stargazers","contributors_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/contributors","subscribers_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/subscribers","subscription_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/subscription","commits_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/commits{/sha}","git_commits_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/git/commits{/sha}","comments_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/comments{/number}","issue_comment_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/issues/comments{/number}","contents_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/contents/{+path}","compare_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/merges","archive_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/downloads","issues_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/issues{/number}","pulls_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls{/number}","milestones_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/milestones{/number}","notifications_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/labels{/name}","releases_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/releases{/id}","deployments_url":"https://api.github.com/repos/haydenbleasel/gulp-jimp/deployments","created_at":"2015-11-28T23:13:01Z","updated_at":"2016-07-22T07:52:37Z","pushed_at":"2016-08-18T11:55:58Z","git_url":"git://github.com/haydenbleasel/gulp-jimp.git","ssh_url":"git@github.com:haydenbleasel/gulp-jimp.git","clone_url":"https://github.com/haydenbleasel/gulp-jimp.git","svn_url":"https://github.com/haydenbleasel/gulp-jimp","homepage":null,"size":84,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/5"},"html":{"href":"https://github.com/haydenbleasel/gulp-jimp/pull/5"},"issue":{"href":"https://api.github.com/repos/haydenbleasel/gulp-jimp/issues/5"},"comments":{"href":"https://api.github.com/repos/haydenbleasel/gulp-jimp/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/haydenbleasel/gulp-jimp/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/haydenbleasel/gulp-jimp/statuses/ff8164158e3f8ae96ab64951e1fe9343402f4e4d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"haydenbleasel","id":4142719,"avatar_url":"https://avatars.githubusercontent.com/u/4142719?v=3","gravatar_id":"","url":"https://api.github.com/users/haydenbleasel","html_url":"https://github.com/haydenbleasel","followers_url":"https://api.github.com/users/haydenbleasel/followers","following_url":"https://api.github.com/users/haydenbleasel/following{/other_user}","gists_url":"https://api.github.com/users/haydenbleasel/gists{/gist_id}","starred_url":"https://api.github.com/users/haydenbleasel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haydenbleasel/subscriptions","organizations_url":"https://api.github.com/users/haydenbleasel/orgs","repos_url":"https://api.github.com/users/haydenbleasel/repos","events_url":"https://api.github.com/users/haydenbleasel/events{/privacy}","received_events_url":"https://api.github.com/users/haydenbleasel/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":4,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"haydenbleasel"}}