Skip to content

Instantly share code, notes, and snippets.

04653c5ff89014b2594c07f3e988611ba55955a7ad3e19e44bc3eec6b467cd0a26484da2e10fc1e01c9d8bc510fb4fc8007e2e159b653030add8725c2ad2bfa52f
@Brianggalvez
Brianggalvez / CROP.md
Created July 6, 2016 07:55 — forked from FokkeZB/CROP.md
Image (cropping) CommonJS lib for Titanium

Often I need to display a user-provided picture in an ImageView in such a way that the whole ImageView is filled with as much of the picture possible.

This is how I do it:

var image = require('image');

Ti.Media.showCamera({
        mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
 success: function (e) {