Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

error imageAsResized

$
0
0

Hello everyone

I have a problem that has me the creeps.

I need to send an image to a server. For this I take a picture with a camera phone and sending base64.

But to send the photo resized photo taken to lower the weight.

I was taking the imagefactory module, but I was having problems, then address the titanium api imageAsResized, but in doing so I came out an error "java exception".

I need if I can help, leave the code where I get the error.

Titanium.Media.showCamera({
 
                                 success:function(event) {
 
                                        var _scroll1 = (230*obj.row)-260;
                                        scrollView.scrollTo(0,_scroll1);
 
                                        var blob = event.media;
                                        var myBlob = blob.toBlob(); 
 
                                        //var ImageFactory = require('ti.imagefactory');
 
                                        //var myImg = ImageFactory.compress(blob,0.25);
 
                                        //var myImg = ImageFactory.imageAsResized(blob, {width:109, height:100});
                                        var myImg = myBlob.imageAsResized(100, 100);
 
                                        var filename = Ti.Filesystem.applicationDataDirectory + "/"+obj.ide+Ti.App.Properties.getString("iduser")+'.jpg';
                                        f = Ti.Filesystem.getFile(filename);
                                        f.write(myImg);
 
                                        foto.setImage('images/cam_fill.png');
 
                                        var _scroll = (230*obj.row)-260;
                                        scrollView.scrollTo(0,_scroll); 
 
                                },
This happens when I try to take the second or third picture.

I am working on android, titanium sdk 3.1.3


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>