I'm evaluating Appcelerator Titanium for a project. The one feature that I'm concerned is that my project will require me to crop images. Using comple开发者_如何学Pythonte image processing would be amazing, but cropping would be the minimum ability I currently need.
I've searched the forums and found out that there is a enhancement request posted on their bugtracker asking for this particular feature, but no ETA is available at this time.
Is this possible to do it some other way? Anyone tried with success to use the PIL (Python Imaging Library) with Titanium? Any solution with Ruby?
Other approach I was thinking is to bundle some image processing open source executable withing the app itself and call it as a shell command. Is it possible to invoke bundled executable in a cross platform way? (I know this would require multiple executables compiled specifically to each platform, but that's ok)
The standard Titanium image (TiBlob) object has an imageAsCropped
function to do cropping.
Here is a post by Amir Lazarovich on the built in TiBlob manipulation you can do:
http://developer.appcelerator.com/question/118694/image-resizing-and-more
Summary of the methods are:
imageWithAlpha()
imageWithTransparentBorder([int] size)
imageWithRoundedCorner([int] cornerSize, [optional] [int] borderSize)
imageAsThumbnail([int] size, [optional] [int] borderSize, [optional] [int] cornerRadius)
imageAsResized([int] width, [int] height)
imageAsCropped([dictionary] config)
* where config is of the form: {
width: [float],
height: [float],
x: [float],
y: [float]
}
精彩评论