{"action":"created","comment":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/73524894","id":73524894,"diff_hunk":"@@ -207,8 +212,47 @@ protected void initFile(String id) throws FormatException, IOException {\n         }\n \n         HashMap<String, String> tags = exif.getTags();\n-        for (String tagName : tags.keySet()) {\n-          addGlobalMeta(tagName, tags.get(tagName));\n+        String unitsTagName = exif.getTagName(ExifSubIFDDirectory.TAG_RESOLUTION_UNIT);\n+        String unitsTag = tags.get(unitsTagName);\n+        Unit<Length> units = UNITS.MICROMETER;\n+        if (unitsTag != null) {\n+          if (unitsTag.toLowerCase().contains(\"inch\")) { \n+            units = UNITS.INCH;\n+          }\n+          else if (unitsTag.toLowerCase().contains(\"centimeter\")) { \n+            units = UNITS.CENTIMETER;\n+          }\n+          else if (Integer.parseInt(unitsTag) == 2) { \n+            units = UNITS.INCH;\n+          }\n+          else if (Integer.parseInt(unitsTag) == 3) { \n+            units = UNITS.CENTIMETER;\n+          }\n+        }\n+        for (String tagName : tags.keySet()) {  \n+          if (tagName.equals(exif.getTagName(ExifSubIFDDirectory.TAG_X_RESOLUTION))) {\n+            try {\n+              double resolutionX = Double.parseDouble(tags.get(tagName));\n+              Length sizeX = FormatTools.getPhysicalSizeX((1/resolutionX),units);\n+              store.setPixelsPhysicalSizeX(sizeX, 0);\n+            }\n+            catch(NumberFormatException e) {\n+              LOGGER.warn(\"EXIF Tag - Resolution X not in correct format, expected double, found : \" + tags.get(tagName));","path":"components/formats-bsd/src/loci/formats/in/JPEGReader.java","position":45,"original_position":45,"commit_id":"b3f8156488954896f9bdef03241171168158a712","original_commit_id":"b3f8156488954896f9bdef03241171168158a712","user":{"login":"sbesson","id":1355463,"avatar_url":"https://avatars.githubusercontent.com/u/1355463?v=3","gravatar_id":"","url":"https://api.github.com/users/sbesson","html_url":"https://github.com/sbesson","followers_url":"https://api.github.com/users/sbesson/followers","following_url":"https://api.github.com/users/sbesson/following{/other_user}","gists_url":"https://api.github.com/users/sbesson/gists{/gist_id}","starred_url":"https://api.github.com/users/sbesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbesson/subscriptions","organizations_url":"https://api.github.com/users/sbesson/orgs","repos_url":"https://api.github.com/users/sbesson/repos","events_url":"https://api.github.com/users/sbesson/events{/privacy}","received_events_url":"https://api.github.com/users/sbesson/received_events","type":"User","site_admin":false},"body":"My main concern with the usage of `WARN` level is that it can be invasive e.g. in the Fiji console and/or OMERO logs. Alternatively we could use `DataTools.parseDouble()` which will log incorrect formatting at `DEBUG` level.","created_at":"2016-08-04T13:49:54Z","updated_at":"2016-08-04T13:49:54Z","html_url":"https://github.com/openmicroscopy/bioformats/pull/2473#discussion_r73524894","pull_request_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473","_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/73524894"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/2473#discussion_r73524894"},"pull_request":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473"}}},"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473","id":75497087,"html_url":"https://github.com/openmicroscopy/bioformats/pull/2473","diff_url":"https://github.com/openmicroscopy/bioformats/pull/2473.diff","patch_url":"https://github.com/openmicroscopy/bioformats/pull/2473.patch","issue_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2473","number":2473,"state":"open","locked":false,"title":"JPEG - Read Physical Size X and Y","user":{"login":"dgault","id":1628865,"avatar_url":"https://avatars.githubusercontent.com/u/1628865?v=3","gravatar_id":"","url":"https://api.github.com/users/dgault","html_url":"https://github.com/dgault","followers_url":"https://api.github.com/users/dgault/followers","following_url":"https://api.github.com/users/dgault/following{/other_user}","gists_url":"https://api.github.com/users/dgault/gists{/gist_id}","starred_url":"https://api.github.com/users/dgault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgault/subscriptions","organizations_url":"https://api.github.com/users/dgault/orgs","repos_url":"https://api.github.com/users/dgault/repos","events_url":"https://api.github.com/users/dgault/events{/privacy}","received_events_url":"https://api.github.com/users/dgault/received_events","type":"User","site_admin":false},"body":"This is a reworked version of an old PR - https://github.com/openmicroscopy/bioformats/pull/2036\r\nOriginal thread - https://www.openmicroscopy.org/community/viewtopic.php?f=13&t=7877&p=16128#p16128\r\n\r\nThis PR adds functionality to read the Exif tags TAG_Y_RESOLUTION and TAG_X_RESOLUTION.\r\nOriginally this PR was closed as these tags were not supported by the metadata-extractor library we were using and suitable replacements could not be found.\r\n\r\nI have since updated the library to the latest revision enabling us to access the required tags.\r\n\r\nTo test:\r\nWe currently are not using the Physical Size X and Y, this PR simply provides users the ability to set the values on the Exif tags and have them remain as part of their metadata. The main change here is the upgrade of the metadata-extractor jar. As such it is important that this has no side affects and previous functionality is unchanged.  Ensuring that all builds and repo runs remain green would be a good indictor that the upgraded jar is working as expected.","created_at":"2016-06-28T15:22:58Z","updated_at":"2016-08-04T13:49:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6623cd3e99874d3c79041ab0a1616eb7f50bbf43","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473/commits","review_comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473/comments","review_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2473/comments","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/b3f8156488954896f9bdef03241171168158a712","head":{"label":"dgault:jpeg_physical_dims","ref":"jpeg_physical_dims","sha":"b3f8156488954896f9bdef03241171168158a712","user":{"login":"dgault","id":1628865,"avatar_url":"https://avatars.githubusercontent.com/u/1628865?v=3","gravatar_id":"","url":"https://api.github.com/users/dgault","html_url":"https://github.com/dgault","followers_url":"https://api.github.com/users/dgault/followers","following_url":"https://api.github.com/users/dgault/following{/other_user}","gists_url":"https://api.github.com/users/dgault/gists{/gist_id}","starred_url":"https://api.github.com/users/dgault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgault/subscriptions","organizations_url":"https://api.github.com/users/dgault/orgs","repos_url":"https://api.github.com/users/dgault/repos","events_url":"https://api.github.com/users/dgault/events{/privacy}","received_events_url":"https://api.github.com/users/dgault/received_events","type":"User","site_admin":false},"repo":{"id":42044740,"name":"bioformats","full_name":"dgault/bioformats","owner":{"login":"dgault","id":1628865,"avatar_url":"https://avatars.githubusercontent.com/u/1628865?v=3","gravatar_id":"","url":"https://api.github.com/users/dgault","html_url":"https://github.com/dgault","followers_url":"https://api.github.com/users/dgault/followers","following_url":"https://api.github.com/users/dgault/following{/other_user}","gists_url":"https://api.github.com/users/dgault/gists{/gist_id}","starred_url":"https://api.github.com/users/dgault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgault/subscriptions","organizations_url":"https://api.github.com/users/dgault/orgs","repos_url":"https://api.github.com/users/dgault/repos","events_url":"https://api.github.com/users/dgault/events{/privacy}","received_events_url":"https://api.github.com/users/dgault/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgault/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":true,"url":"https://api.github.com/repos/dgault/bioformats","forks_url":"https://api.github.com/repos/dgault/bioformats/forks","keys_url":"https://api.github.com/repos/dgault/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgault/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgault/bioformats/teams","hooks_url":"https://api.github.com/repos/dgault/bioformats/hooks","issue_events_url":"https://api.github.com/repos/dgault/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/dgault/bioformats/events","assignees_url":"https://api.github.com/repos/dgault/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/dgault/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/dgault/bioformats/tags","blobs_url":"https://api.github.com/repos/dgault/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgault/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgault/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgault/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgault/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/dgault/bioformats/languages","stargazers_url":"https://api.github.com/repos/dgault/bioformats/stargazers","contributors_url":"https://api.github.com/repos/dgault/bioformats/contributors","subscribers_url":"https://api.github.com/repos/dgault/bioformats/subscribers","subscription_url":"https://api.github.com/repos/dgault/bioformats/subscription","commits_url":"https://api.github.com/repos/dgault/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgault/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgault/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgault/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgault/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/dgault/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgault/bioformats/merges","archive_url":"https://api.github.com/repos/dgault/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgault/bioformats/downloads","issues_url":"https://api.github.com/repos/dgault/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/dgault/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/dgault/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/dgault/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgault/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/dgault/bioformats/releases{/id}","deployments_url":"https://api.github.com/repos/dgault/bioformats/deployments","created_at":"2015-09-07T09:44:20Z","updated_at":"2015-09-07T09:44:33Z","pushed_at":"2016-08-04T08:51:23Z","git_url":"git://github.com/dgault/bioformats.git","ssh_url":"git@github.com:dgault/bioformats.git","clone_url":"https://github.com/dgault/bioformats.git","svn_url":"https://github.com/dgault/bioformats","homepage":"http://www.openmicroscopy.org/site/products/bio-formats","size":262680,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"develop"}},"base":{"label":"openmicroscopy:develop","ref":"develop","sha":"a9bd04a9182768cb90fbe03aa7d68ba795e40791","user":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"repo":{"id":2510503,"name":"bioformats","full_name":"openmicroscopy/bioformats","owner":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmicroscopy/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":false,"url":"https://api.github.com/repos/openmicroscopy/bioformats","forks_url":"https://api.github.com/repos/openmicroscopy/bioformats/forks","keys_url":"https://api.github.com/repos/openmicroscopy/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmicroscopy/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmicroscopy/bioformats/teams","hooks_url":"https://api.github.com/repos/openmicroscopy/bioformats/hooks","issue_events_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/openmicroscopy/bioformats/events","assignees_url":"https://api.github.com/repos/openmicroscopy/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/openmicroscopy/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/tags","blobs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/openmicroscopy/bioformats/languages","stargazers_url":"https://api.github.com/repos/openmicroscopy/bioformats/stargazers","contributors_url":"https://api.github.com/repos/openmicroscopy/bioformats/contributors","subscribers_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscribers","subscription_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscription","commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmicroscopy/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/openmicroscopy/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmicroscopy/bioformats/merges","archive_url":"https://api.github.com/repos/openmicroscopy/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmicroscopy/bioformats/downloads","issues_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/openmicroscopy/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/openmicroscopy/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmicroscopy/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/openmicroscopy/bioformats/releases{/id}","deployments_url":"https://api.github.com/repos/openmicroscopy/bioformats/deployments","created_at":"2011-10-04T08:06:14Z","updated_at":"2016-08-03T09:39:51Z","pushed_at":"2016-08-04T08:51:24Z","git_url":"git://github.com/openmicroscopy/bioformats.git","ssh_url":"git@github.com:openmicroscopy/bioformats.git","clone_url":"https://github.com/openmicroscopy/bioformats.git","svn_url":"https://github.com/openmicroscopy/bioformats","homepage":"http://www.openmicroscopy.org/site/products/bio-formats","size":288155,"stargazers_count":106,"watchers_count":106,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":12,"forks":130,"open_issues":12,"watchers":106,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/2473"},"issue":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2473"},"comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2473/comments"},"review_comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473/comments"},"review_comment":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2473/commits"},"statuses":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/b3f8156488954896f9bdef03241171168158a712"}}}}
{"actor":{"display_login":"sbesson"}}