{"action":"created","issue":{"url":"https://api.github.com/repos/AppWerft/TiJSPDF/issues/9","labels_url":"https://api.github.com/repos/AppWerft/TiJSPDF/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/AppWerft/TiJSPDF/issues/9/comments","events_url":"https://api.github.com/repos/AppWerft/TiJSPDF/issues/9/events","html_url":"https://github.com/AppWerft/TiJSPDF/issues/9","id":108981821,"number":9,"title":"Images embedded from the camera are rotated 90 degrees on iOS","user":{"login":"raefa","id":665520,"avatar_url":"https://avatars.githubusercontent.com/u/665520?v=3","gravatar_id":"","url":"https://api.github.com/users/raefa","html_url":"https://github.com/raefa","followers_url":"https://api.github.com/users/raefa/followers","following_url":"https://api.github.com/users/raefa/following{/other_user}","gists_url":"https://api.github.com/users/raefa/gists{/gist_id}","starred_url":"https://api.github.com/users/raefa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raefa/subscriptions","organizations_url":"https://api.github.com/users/raefa/orgs","repos_url":"https://api.github.com/users/raefa/repos","events_url":"https://api.github.com/users/raefa/events{/privacy}","received_events_url":"https://api.github.com/users/raefa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-29T23:40:48Z","updated_at":"2015-09-30T22:15:08Z","closed_at":"2015-09-30T22:15:08Z","body":"If you add an image that you have saved from the camera and embed it in a PDF, it rotates 90 degrees on iOS (not Android).\r\n\r\n```\r\nvar imageFile = Ti.Filesystem.getFile(Ti.Filesystem.tempDirectory, \"file-from-camera.png\"); \r\nvar tempFile = Ti.Filesystem.createTempFile(Ti.Filesystem.tempDirectory);\r\ntempFile.write(ImageFactory.compress(imageFile.read(), 1));\r\npdf.addImage(tempFile.nativePath, 'JPEG', imageX, imageY, imageWidth, imageHeight);\r\n```\r\n\r\nAs a workaround, I am adding the image to a view and using toImage() and creating a new image. It appears the right way up then! "},"comment":{"url":"https://api.github.com/repos/AppWerft/TiJSPDF/issues/comments/144559576","html_url":"https://github.com/AppWerft/TiJSPDF/issues/9#issuecomment-144559576","issue_url":"https://api.github.com/repos/AppWerft/TiJSPDF/issues/9","id":144559576,"user":{"login":"raefa","id":665520,"avatar_url":"https://avatars.githubusercontent.com/u/665520?v=3","gravatar_id":"","url":"https://api.github.com/users/raefa","html_url":"https://github.com/raefa","followers_url":"https://api.github.com/users/raefa/followers","following_url":"https://api.github.com/users/raefa/following{/other_user}","gists_url":"https://api.github.com/users/raefa/gists{/gist_id}","starred_url":"https://api.github.com/users/raefa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raefa/subscriptions","organizations_url":"https://api.github.com/users/raefa/orgs","repos_url":"https://api.github.com/users/raefa/repos","events_url":"https://api.github.com/users/raefa/events{/privacy}","received_events_url":"https://api.github.com/users/raefa/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T22:15:08Z","updated_at":"2015-09-30T22:15:08Z","body":"Ahhh. Understood. I used that class to extract the orientation. I then rotated this image using ImageFactory (https://github.com/collinprice/ti.imagefactory/blob/stable/ios/documentation/index.md) ... but by rotating the image it strips the Exif/header data from the JPEG and you therefore can't embed it in the PDF. So I am back to my workaround from above - adding the image to a view and using toImage() and creating a new image. I am sharing this in case anyone else has this issue."}}