So I am sending images to a remote Service of my own creation in my mobile App. My phone by default takes ridiculously large images at about 5MB a picture. I then encode it in base64 and send it to the service and it takes FOREVER. Is there any way I can detect how big this is and make a smaller version to send along. Kind of like when you take a picture for a text and it says "Picture too large. Compressing..." I need my app to take the picture and if its over 200KB to compress it down.
Intel XDK mobile app compressing to smaller image
279 Views Asked by Bill Garrison At
1
There are 1 best solutions below
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in AJAX
- Ajax jQuery firing multiple time display event for the same result
- Implement Onfailure in webApi controller
- AJAX PHP - Reload div after submit
- ajax load data from mysql
- Ajax-update only a component attribute, not the whole component nor its children
- using ajax to get a php database result and then show the result in a button
- How to prevent browser from executing some JavaScript when person clicks Back button?
- ajax async: true statement execution order
- Rails 4.2 jQuery loads only after refresh
- WebForms GET Json requests (JsonRequestBehavior.AllowGet)
- Rails - Ajax do not work properly on production server
- Angular js Button click
- Make jQuery/AJAX perform instantly on page load
- jQuery Ajax Uncaught TypeError: Cannot use 'in' operator to search
- Show success or error messages in Ajax response to Wordpress custom registration form
Related Questions in BASE64
- Regex to get vCard base64 string (C#)
- writing into file (Converting Base64 to Binary) values Using VFS and ESB 4.8.1
- Can I POST or PUT an image to Django RESTful API using $resource of AngularJs or rather javascript in general?
- Python base32 data decode
- Encode array to base64 in go
- Save Task<string> type to String giving Catastrophic failure
- How to read a Base64 string as a file, on server side, without saving it in web server, directly by PHP?
- Angular base64 video interpolation fail ($sce)
- Gmail API playground: Send method, converted MIME raw header not populating email fields on send
- Convert data to base64 encode in go
- Base64Decode to file - whats missing?
- How can i save base64 to image file on cordova / ionic or upload to server?
- How to save encoded Base64 strings from database, to files, on disk?
- PHP base64 encoding drops incorrect answer
- base64 image open in new tab with fancybox, instead of the classic "popup"
Related Questions in INTEL-XDK
- How do i send a SMS using phonegap without opening the native app?
- Layout displacment on iOS 8.3
- Video is not playing in intel xdk
- How to switch through pages using Intel XDK
- Unable to use cordova plugin from github in Intel XDK
- Intel XDK AJAX Call with cordova 4.1.2 not working
- Different performance with Intel XDK
- XDK built app not working
- Sound not working on cocos2D JS v.3 + IntelXDK + Cordova
- Redirect to other page Intel XDK
- Error: GTK library is not installed or installed version is not compatible
- Text from HTML input field run through jquery function?
- Protect my Android (Intel XDK) app from piracy
- Ionic infinite scroll dont stop
- navigator.app.exitApp() not working
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
When you say "compress it down", I assume you're talking about downsampling (reducing the number of pixels) rather than changing the compression algorithm.
It's hard to tell without seeing your code, but when you convert it to base64 I assume you've got some object (say a dataURL), then you should be able to check the size of that, i.e.:
To downsample it, you could write it to a canvas element with smaller resolution, as described here - Drawing an image from a data URL to a canvas :
then convert the resulting canvas to a dataURL:
Of course, you'd need to make sure the aspect ratio of the canvas matched the aspect ratio of the image so it doesn't get distorted.