{"id":15685708,"url":"https://github.com/skypanther/picatsize","last_synced_at":"2025-08-01T05:32:55.116Z","repository":{"id":30500637,"uuid":"34054920","full_name":"skypanther/picatsize","owner":"skypanther","description":"Titanium Android camera module that lets you specify the size of the photo to take","archived":false,"fork":false,"pushed_at":"2019-01-17T19:38:03.000Z","size":126416,"stargazers_count":9,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T12:22:08.098Z","etag":null,"topics":["appcelerator","appcelerator-android","camera","titanium-mobile"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skypanther.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-16T12:38:25.000Z","updated_at":"2020-02-19T18:53:22.000Z","dependencies_parsed_at":"2022-08-17T18:10:27.473Z","dependency_job_id":null,"html_url":"https://github.com/skypanther/picatsize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skypanther%2Fpicatsize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skypanther%2Fpicatsize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skypanther%2Fpicatsize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skypanther%2Fpicatsize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skypanther","download_url":"https://codeload.github.com/skypanther/picatsize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252927319,"owners_count":21826458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appcelerator","appcelerator-android","camera","titanium-mobile"],"created_at":"2024-10-03T17:29:20.376Z","updated_at":"2025-05-07T17:40:44.851Z","avatar_url":"https://github.com/skypanther.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"PicAtSize\n===========================================\n\nNote: Initial support for Titanium 6.0 Beta added. \n\nPicAtSize is an Android module that lets you take a \"_PIC_\u0026#65279;ture _AT_ a _SIZE_\" you specify. By taking a  photo smaller than the camera's native size, you create smaller files which are faster to upload, faster to process (resize, crop, rotate), and which create less memory-related issues. It was the memory issue that inspired this module.\n\nNatively, Android supports the `camera.getParameters.setPictureSize()` method. But Titanium's Ti.Media module does not expose this functionality. This module makes that available for you to use.\n\nA few notes:\n\n* With this module, you must use a camera overlay or you'll get the native camera which has no size-specifying support.\n* You will get a photo at the closest, next larger size supported by the device's camera. It may not, and probably won't match the exact size you specify. (Reportedly, some Android devices will not take any photo if you were to specify a size that the camera doesn't support.)\n\nI want to send a huge thanks to @olivier_morandi who helped me get this module working. I was close, but could never have finished it without his help. Thanks!!!\n\n\n\n\n## INSTALL THE MODULE\n\n### Use GitTio\n\nUse GitTio, as it will download, unzip, and install the module for you.\n\n```shell\ngittio install com.skypanther.picatsize\n```\n\n### Manually\n\nDownload the zip from the dist folder, unzip, place in your project's modules folder.\n\nRegister in the tiapp.xml:\n\n```xml\n\u003cmodules\u003e\n\t\u003cmodule platform=\"android\"\u003ecom.skypanther.picatsize\u003c/module\u003e\n\u003c/modules\u003e\n```\n\n\n\n## USING THE MODULE IN CODE\n\nSee the included sample app (in the example directory).\n\n```javascript\n// instantiate and specify your target size\nvar pascam = require('com.skypanther.picatsize');\nvar targetWidth = 1024;\nvar targetHeight = 800;\n\n// create the necessary overlay\nvar overlay = Ti.UI.createView();\n\nvar clickBt = Ti.UI.createButton({\n\ttitle: \"Take Photo\",\n\tbottom: 10,\n\tright: 20\n});\noverlay.add(clickBt);\nclickBt.addEventListener('click', function() {\n\tpascam.takePicture();\n});\nvar closeBt = Ti.UI.createButton({\n\ttitle: \"Cancel\",\n\tbottom: 10,\n\tleft: 20\n});\noverlay.add(closeBt);\ncloseBt.addEventListener('click', function() {\n\tpascam.hideCamera();\n});\n\n// show the camerapascam.showCamera({\n\toverlay: overlay, // setting the overlay makes the module start PASCameraActivity\n\tautohide: false, // autohide must be false for takePicture() to work\n\tsuccess: function (e) {\n\t\tTi.API.info(\"bytes: \" + e.media.length);\n\t\tTi.API.info(\"height: \" + e.media.height);\n\t\tTi.API.info(\"width: \" + e.media.width);\n\t\tpascam.hideCamera();\n\t},\n\terror: function (e) {\n\t\tTi.API.info(JSON.stringify(e));\n\t},\n\tsaveToPhotoGallery: false,\n\tmediaTypes: [pascam.MEDIA_TYPE_PHOTO],\n\ttargetWidth: targetWidth,\n\ttargetHeight: targetHeight\n});\n\n```\n\n# License\n\nApache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskypanther%2Fpicatsize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskypanther%2Fpicatsize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskypanther%2Fpicatsize/lists"}