{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/154527393","pull_request_review_id":80704510,"id":154527393,"diff_hunk":"@@ -347,10 +349,60 @@ def build_title_images(max_width, max_height)\n           i.interline_spacing interline_spacing if interline_spacing\n           i.fill fetch_config[key.to_s]['color']\n         end\n-        title_image.trim # remove white space\n+\n+        # title_image.trim # remove white space\n \n         results[key] = title_image\n+\n+        # Trimming of each individual image will result in the loss of the common baseline between both texts.\n+        # Hence retrieve the calculated trim bounding box, which can be used later to apply a crop on both images, while maintaining the same vertical top offset based on the smallest value from the trim box:\n+        calculated_trim_box = title_image.identify do |b|\n+          b.format(\"%@\") # CALCULATED: trim bounding box (without actually trimming), see: http://www.imagemagick.org/script/escape.php\n+        end\n+\n+        # Get minimum vertical top offset from both trim boxes by converting it from string to an integer array:","path":"frameit/lib/frameit/editor.rb","position":25,"original_position":25,"commit_id":"30d1e649c5e19238fa184a67f24e94049690fb64","original_commit_id":"30d1e649c5e19238fa184a67f24e94049690fb64","user":{"login":"janpio","id":183673,"avatar_url":"https://avatars0.githubusercontent.com/u/183673?v=4","gravatar_id":"","url":"https://api.github.com/users/janpio","html_url":"https://github.com/janpio","followers_url":"https://api.github.com/users/janpio/followers","following_url":"https://api.github.com/users/janpio/following{/other_user}","gists_url":"https://api.github.com/users/janpio/gists{/gist_id}","starred_url":"https://api.github.com/users/janpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpio/subscriptions","organizations_url":"https://api.github.com/users/janpio/orgs","repos_url":"https://api.github.com/users/janpio/repos","events_url":"https://api.github.com/users/janpio/events{/privacy}","received_events_url":"https://api.github.com/users/janpio/received_events","type":"User","site_admin":false},"body":"only working on one of them right now","created_at":"2017-12-03T15:41:00Z","updated_at":"2017-12-03T15:51:05Z","html_url":"https://github.com/fastlane/fastlane/pull/11096#discussion_r154527393","pull_request_url":"https://api.github.com/repos/fastlane/fastlane/pulls/11096","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/154527393"},"html":{"href":"https://github.com/fastlane/fastlane/pull/11096#discussion_r154527393"},"pull_request":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/11096"}}},"pull_request":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/11096","id":156064881,"html_url":"https://github.com/fastlane/fastlane/pull/11096","diff_url":"https://github.com/fastlane/fastlane/pull/11096.diff","patch_url":"https://github.com/fastlane/fastlane/pull/11096.patch","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/11096","number":11096,"state":"open","locked":false,"title":"[WIP] Solution for Frameit trim issue #10440","user":{"login":"funnel20","id":2139844,"avatar_url":"https://avatars3.githubusercontent.com/u/2139844?v=4","gravatar_id":"","url":"https://api.github.com/users/funnel20","html_url":"https://github.com/funnel20","followers_url":"https://api.github.com/users/funnel20/followers","following_url":"https://api.github.com/users/funnel20/following{/other_user}","gists_url":"https://api.github.com/users/funnel20/gists{/gist_id}","starred_url":"https://api.github.com/users/funnel20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funnel20/subscriptions","organizations_url":"https://api.github.com/users/funnel20/orgs","repos_url":"https://api.github.com/users/funnel20/repos","events_url":"https://api.github.com/users/funnel20/events{/privacy}","received_events_url":"https://api.github.com/users/funnel20/received_events","type":"User","site_admin":false},"body":"<!-- Thanks for contributing to _fastlane_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (do: [x], don't: [x ], [ x], [✔️]) -->\r\n\r\n### Checklist\r\n- [x] I've run `bundle exec rspec` from the root directory to see all new and existing tests pass\r\nOutput: \r\n```\r\nFinished in 6 minutes 46 seconds (files took 3.7 seconds to load)\r\n4675 examples, 0 failures\r\n```\r\n- [x] I've followed the _fastlane_ code style and run `bundle exec rubocop -a` to ensure the code style is valid\r\nOutput: \r\n```\r\n973 files inspected, no offenses detected\r\n```\r\n- [x] I've read the [Contribution Guidelines](https://github.com/fastlane/fastlane/blob/master/CONTRIBUTING.md)\r\n- [x] I've updated the documentation if necessary.\r\nNot applicable\r\n\r\n### Motivation and Context\r\n<!-- Why is this change required? What problem does it solve? -->\r\nThis solves issue https://github.com/fastlane/fastlane/issues/10440\r\n<!-- If it fixes an open issue, please link to the issue here. -->\r\nThe current implementation applies a `.trim` to both images for Keyword and Title.\r\nDue to typography differences (for example the \"L\" that needs more vertical space than an \"e\") the generic baseline between 2 texts is lost. This can be seen in the excellent analysis of @janpio in this comment: https://github.com/fastlane/fastlane/issues/10440#issuecomment-348010988\r\n\r\n_Before_\r\n![iphone6-01_remotetab_framed](https://user-images.githubusercontent.com/2139844/33526905-fee7d936-d847-11e7-8fba-85fb829fc25d.png)\r\n\r\nThis solution requests the calculated trim box and offset without applying it.\r\nBy comparing the vertical top offsets of both trim boxes, the vertical offset between them can be calculated. The box with the biggest offset will be compensated to equal the same of the other, so their text baseline will be equal.\r\nFinally a `.crop` will be applied with the (compensated) trim boxes.\r\n\r\n_After_\r\n![iphone6-01_remotetab_framed](https://user-images.githubusercontent.com/2139844/33526915-2c586160-d848-11e7-9a26-a0bd6ca78ad9.png)\r\n\r\n<!-- Please describe in detail how you tested your changes. -->\r\nTest results can be found in issue comment: https://github.com/fastlane/fastlane/issues/10440#issuecomment-348760923\r\n\r\n### Description\r\n<!-- Describe your changes in detail -->\r\nThe changes can be found in issue comment: https://github.com/fastlane/fastlane/issues/10440#issuecomment-348760717\r\n\r\nPlease note that:\r\n\r\n- I've no Ruby skills, so this might not be proper Production code. But the description and the code show the intended behaviour.\r\n- All `print` commands are for debugging, so can be removed.\r\n- Hence @janpio offered to help, so I added [WIP] to the title of the PR.\r\n- The current code aligns the trimmed/cropped images to the top. To make this fix robust for any future changes (for example align to bottom), the height of both trim boxes (parameter 2) should be made equal: the largest after the current vertical top offset compensations is leading.","created_at":"2017-12-03T15:17:49Z","updated_at":"2017-12-03T15:51:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2606ce9d21a58db847bb989e1a50a61ca0c6e2f1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/fastlane/pulls/11096/commits","review_comments_url":"https://api.github.com/repos/fastlane/fastlane/pulls/11096/comments","review_comment_url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/11096/comments","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/30d1e649c5e19238fa184a67f24e94049690fb64","head":{"label":"funnel20:frameit-vertical-text-offset","ref":"frameit-vertical-text-offset","sha":"30d1e649c5e19238fa184a67f24e94049690fb64","user":{"login":"funnel20","id":2139844,"avatar_url":"https://avatars3.githubusercontent.com/u/2139844?v=4","gravatar_id":"","url":"https://api.github.com/users/funnel20","html_url":"https://github.com/funnel20","followers_url":"https://api.github.com/users/funnel20/followers","following_url":"https://api.github.com/users/funnel20/following{/other_user}","gists_url":"https://api.github.com/users/funnel20/gists{/gist_id}","starred_url":"https://api.github.com/users/funnel20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funnel20/subscriptions","organizations_url":"https://api.github.com/users/funnel20/orgs","repos_url":"https://api.github.com/users/funnel20/repos","events_url":"https://api.github.com/users/funnel20/events{/privacy}","received_events_url":"https://api.github.com/users/funnel20/received_events","type":"User","site_admin":false},"repo":{"id":112796327,"name":"fastlane","full_name":"funnel20/fastlane","owner":{"login":"funnel20","id":2139844,"avatar_url":"https://avatars3.githubusercontent.com/u/2139844?v=4","gravatar_id":"","url":"https://api.github.com/users/funnel20","html_url":"https://github.com/funnel20","followers_url":"https://api.github.com/users/funnel20/followers","following_url":"https://api.github.com/users/funnel20/following{/other_user}","gists_url":"https://api.github.com/users/funnel20/gists{/gist_id}","starred_url":"https://api.github.com/users/funnel20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funnel20/subscriptions","organizations_url":"https://api.github.com/users/funnel20/orgs","repos_url":"https://api.github.com/users/funnel20/repos","events_url":"https://api.github.com/users/funnel20/events{/privacy}","received_events_url":"https://api.github.com/users/funnel20/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/funnel20/fastlane","description":"🚀 The easiest way to automate building and releasing your iOS and Android apps","fork":true,"url":"https://api.github.com/repos/funnel20/fastlane","forks_url":"https://api.github.com/repos/funnel20/fastlane/forks","keys_url":"https://api.github.com/repos/funnel20/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/funnel20/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/funnel20/fastlane/teams","hooks_url":"https://api.github.com/repos/funnel20/fastlane/hooks","issue_events_url":"https://api.github.com/repos/funnel20/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/funnel20/fastlane/events","assignees_url":"https://api.github.com/repos/funnel20/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/funnel20/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/funnel20/fastlane/tags","blobs_url":"https://api.github.com/repos/funnel20/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/funnel20/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/funnel20/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/funnel20/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/funnel20/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/funnel20/fastlane/languages","stargazers_url":"https://api.github.com/repos/funnel20/fastlane/stargazers","contributors_url":"https://api.github.com/repos/funnel20/fastlane/contributors","subscribers_url":"https://api.github.com/repos/funnel20/fastlane/subscribers","subscription_url":"https://api.github.com/repos/funnel20/fastlane/subscription","commits_url":"https://api.github.com/repos/funnel20/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/funnel20/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/funnel20/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/funnel20/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/funnel20/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/funnel20/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/funnel20/fastlane/merges","archive_url":"https://api.github.com/repos/funnel20/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/funnel20/fastlane/downloads","issues_url":"https://api.github.com/repos/funnel20/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/funnel20/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/funnel20/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/funnel20/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/funnel20/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/funnel20/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/funnel20/fastlane/deployments","created_at":"2017-12-01T23:20:37Z","updated_at":"2017-12-01T23:20:48Z","pushed_at":"2017-12-03T15:05:01Z","git_url":"git://github.com/funnel20/fastlane.git","ssh_url":"git@github.com:funnel20/fastlane.git","clone_url":"https://github.com/funnel20/fastlane.git","svn_url":"https://github.com/funnel20/fastlane","homepage":"https://fastlane.tools","size":59162,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastlane:master","ref":"master","sha":"dd68e47a5384ba38d1b59e4c1547a015868a2d60","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars2.githubusercontent.com/u/11098337?v=4","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"name":"fastlane","full_name":"fastlane/fastlane","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars2.githubusercontent.com/u/11098337?v=4","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/fastlane","description":"🚀 The easiest way to automate building and releasing your iOS and Android apps","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/fastlane/deployments","created_at":"2014-12-02T17:00:38Z","updated_at":"2017-12-03T15:41:15Z","pushed_at":"2017-12-03T15:17:50Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":59156,"stargazers_count":19529,"watchers_count":19529,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2973,"mirror_url":null,"archived":false,"open_issues_count":350,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2973,"open_issues":350,"watchers":19529,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/11096"},"html":{"href":"https://github.com/fastlane/fastlane/pull/11096"},"issue":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/11096"},"comments":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/11096/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/11096/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/11096/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/fastlane/statuses/30d1e649c5e19238fa184a67f24e94049690fb64"}},"author_association":"NONE"}}
{"actor":{"display_login":"janpio"}}