Cross-platform SDK and HTML5 tools for mobile app development
X
 
22 posts / 0 new
Last post
lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
Image compression

Hi,

Sorry if this has been addressed before, I tried to search but could not find anything.

I need to upload images to a web application. The image is selected using the image picker. I can get the raw image data with maGetImageSize(), maGetImageData(), encode it with base64 and pass it on, however, the data is huge, especially for a mobile application.

Is there any way I could compress the data in PNG or JPEG? Or, better yet, is there a way I can access the original, compressed file data when using the image picker?

Edit: The app runs on Android and iOS devices.

fan
fan's picture
Offline
Mobile Wizard
Joined: 9 Dec 2014
Posts:
Michael Kors Handbags UK Any

Michael Kors Handbags UK Any understands the life span, this quest for trendy women, she have more in comparison with Save Up 65% - Cheap Michael Kors Handbags Outlet Uk Sale one deal, usually, are not able to understand grow older girls. Start working, buying, dating, dinner party, day out, mountain climbing... Countless routines, will need distinct Michael Kors Uk attributes, different kind of offer to deal with. Bag is one of the girl's possessions, embodies the flavors of a woman, personality as well as condition, an excellent Michael Kors Uk, Wholesale Michael Kors Bags Uk Online handbag can instruct a ladies alone(p) appeal. Ladies' cup of tea, the actual mixture is definitely hand bags regarding gender group. You will find gender along with Michael Kors Purse limited by match feminine aesthetic bags are generally along often called women case. Handbag is amongst the ladies private decorations. It is operate is mainly Authentic Michael kors for sale accustomed to ChengNa products jar, tiny adequate to put lip gloss, cash, big to pack baggage wearing apparel etc. Using the class involving overseas about: Pocket book Billfold, COSMETIC Case, Beauty http://www.showerdrape.co.uk Case), Purse (Bag) on the inside as well as Handbag (Handbag), SHOULDERBAG (make Case), casks, etc Select a appropriate tote to fit your molding, total Michael Kors Outlet Uk, Michael Kors Handbags Uk For Sale modelling can be a extra in your case, or else, opt for the faulty carrier, non the actual modelling regarding leeway for you personally, in lieu of acting look really failing. So females throughout Michael Kors Handbags look closely at apparel while doing so, the actual handbag of preference can also be vital Cup of tea, because brand indicates, wealthy decorative, full of life design, offer a person with genuine along with new Michael Kors Outlet sense. These kinds of carrier is needed within spring and summer are usually recurrent, because time wearing apparel color has goal to help together with easy coloring, to a greater extent vibrant Michael Kors UK Online luggage just collocation, however had better non decide on this sort of handbag is too massive stylus, multi-colored tote might be more well suited for the European as well as American people taller Michael Kors Outlet UK, Cheap Michael Kors Handbags Outlet UK Online appearance and colour of pores and skin, asians is hard to undertake tropical stylus, therefore pick a little more lightweight design is nice Cup of tea would work Cheap Michael Kors Bags Uk Online for Sale regarding workers in offices, plus much more coloring to help african american, chocolate, ashen solid colors or colored event almond. Considering the white-colored-receiver collar tasks need formal Michael Kors for sale dress, and also overmuch apparel coloration for example black, white-colored, java brunette department, therefore the number of http://www.norab.co.uk handbags in layout in addition to details needs to have distinctive model, like tassels, rivets, precious metal archipelago, Arial mosaic design details, such as to a dreary coloration Uk Cheap Michael Kors Handbags On Sale provides eye-port. Handbag together with fairly several, in general applicable to the junket, get together, marriage, etc. Within the range of fabrics, can come up Michael Kors Uk Sale the fabric of silks in addition to satins, astragal part gleaming, stylus is given antecedence in order to with hand bags as well as handbags, ought to take compact level, can show can easily classy, tasteful Search on the Cheap Michael Kors UK elements This can be the basis with the bag, there are many kinds of textiles, textile, manufactured leather, PU, natural leather, towel is incredibly clear, skin of the most useful, course, these days almost all of the case is definitely PU synthetic leather, is already really Michael Kors Outlet slender layers associated with buckskin around the glue on the coating regarding PU, consequently think is nice, beneficial semblance, may also perform some figure in cortical area digesting, most of the cup of tea maker ought to use this cheap Michael kors uk type of framework, and on your tickets nonetheless reveal making use of buckskin or even suede cloth. Actually these kinds of material is great, challenging soiled, gorgeous and durable. Inside is mainly bamboo Michael kors outlet uk and also material, truly it is important isn't too comfortable, if as well smooth, put items you'll find limitations, lining furthermore take away Michael Kors Uk one thing, they will released, it is not full! And always start the particular share following it in the pile connected with irregular Michael Kors Uk, Michael Kors Handbags Outlet Uk For Cheap material, can not see the bag involving other pursuits. 2, from your perspective regarding design model can easily by means of Michael Kors master individuals, men and women of various age ranges have his or her desired type, normal brand name luggage product firm contains the specialized design and style squad, can always to be able to Michael kors canada meet the needs of the fashionable popular designs, that's one of the baggage ones reality, instead of simply by Michael Kors Outlet manufacturer handbags manufacturer there's no certain layout staff, the style involving approximately primary fake model, might not exactly looking looking http://www.audmed.org.uk/ not to turn out, whenever you can discover a couple of similar model plus a brand is usually a label of Buy Michael Kors Handbags UK Online, Cheap Michael Kors Handbags clutches, you can find that, on the other hand, the brand baggage artificial often there is a bit deficiency, as the potency Michael Kors UK Cheap in the troupe, the production equipment as well as management holes, the more belittled position more challenging effective artificial handbag, more efficiency throughout outside decorative rampart handbag, computer hardware Michael Kors Handbags Outlet accessories, ornaments involving form and also placement in addition to employment choice, plus the whole bundle of stereo audio Michael Kors Handbags Outlet Uk Sale, Michael Kors Handbags & Bags Online Uk Sale feeling along with a good relationship. Looking through the be employed in quite a few regular sewing sector, may possibly cup of tea stitchery is just about the almost all requiring, equally equipment Michael Kors Handbags UK along with workers expertise and the specifications in the tote is full of unsettled, regarding these types of since the textile carrier regular sewing substantial in accordance with www.art-tec.co.uk other more heavy, too difficult a lot, and also sewed also has a particular design and also stereo system intuitive feeling. Consequently a competent case stitching individuals to employ half a year or more time! Notice cup of tea Michael Kors Outlet Store UK do the job could have many things are some common-impression issues, but nonetheless can display this okay craft of several Cheap Michael Kors Bags Outlet Online belittled location, such as package deal borders yan fitting outside of almost any redundant, especially the interior deal, helping hand stitches get distorted, this procedure demands Authentic Cheap Michael Kors Outlet UK 2014 expertise and toughness, the simplest way would be to pulling some zip up no matter if even, in any other case placid, add-on is a little twisted, if your move go to your fabric, realistically work is a bit weak, can be are not able to accept the actual Michael Kors Handbags currently fixed carrier, adventure handbag for a few reduced-grade comfortable textiles can also be a little threshold! We all know, full http://www.resultsplus.net/ clothing content volition faithful unitedly and also fabrics, zero extra, tote, subsequently starting, the particular cloth ought to be towards the earlier mentioned textiles, interior place at a glance, and also add-on size, via a the truth, and also a superior Michael Kors Outlet price, this is a tiny bit definately not low-cost this kind of a number of word! several, in the equipment furnishing Each bag without some computer hardware accessories, at the very least like to possess a zipper! Very good carrier with equipment lighting fixtures have become light! Manipulation hands feel, circus tent remaining from the humidity will slowly and gradually fade out, and then application sparkle. Like to contact a new shiny and also well-defined cup. Undesirable computer hardware seems solely abrasive metal plating, ne'er throw easy. Exterior is not easy, plus the colour is just not pure. Various other extras, like thin collection plumber's snake, the color isn't direct, feel that friends have some id. Beneficial ironware equipment, such as routine, magnet belt, yank go, and some material earmark will be stainless sprucing treatment method immediately after metal plating, so it's difficult to decay in addition to oxidisation. That is costlier inside hand bags associated with raw materials, much more of a new case ones truth!

sdjhk
sdjhk's picture
Offline
Mobile Wizard
Joined: 14 Aug 2014
Posts:
On this Michael Kors Outlet a

On this Michael Kors Outlet a mix of both louis vuitton handbags canada international Louis Vuitton Outlet company Authentic Jordan shoes surroundings,Cheap Louis Vuitton Outlet Sale coup d'etat Louis Vuitton UK Outlet is unique Replica Louis Vuitton UK current market Stuart Weitzman Boots sections Michael Kors Outlet and Michael Kors Sale build Michael Kors Handbags methods for MK Canada online families, Stuart Weitzman 5050 to be able to Michael Kors Canada emphasise Michael Kors Outlet Sale the Wholesale Michael Kors Handbags Sale curiosity about Michael By Michael Kors Handbags good quality. Michael Kors Crossbody Bags Asian Michael Kors Handbags Australia customers Michael Kors Australia may be Michael Kors In Australia enjoying Michael Kors Australia Stockists the Where to buy michael kors in australia? part Michael Kors Outlet Online connected with Michael Kors Australia Bags swordplay louis vuitton handbags a new Michael Kors Canada Online definitive Wallets purpose Cheap Michael Kors Crossbody Bags inside the Cheap Michael Kors Handbags gross revenue Michael Kors Bags Australia success Wholesale Michael Kors Bags associated withhttp://www.itxperts.com.au/flash/ , the favorite michael kors handbags australia within Discount Michael Kors Parts of asia Michael Kors Sale far Cheap LV Outlet extremely Louis Vuitton UK Online with http://www.himag.co.uk/uk.asp European countries Cheap Louis Vuitton Outlet in addition to cheap jordan shoes for sale North america, http://www.browniesautocarecenter.com/handbags.php Japan stuart weitzman 5050 is actually Louis Vuitton uk wild. Michael Kors Handbags Online Inside Michael Kors Black Friday Sale Hard anodized cookware region, includes a 55 offer, can be used as being a token regarding excellency position.

dannyrough
dannyrough's picture
Offline
Joined: 26 Apr 2013
Posts:
you can employ an imaging sdk

you can employ an imaging sdk which can do such kind of compression. there are a lot of such sdks on the internet , just try some and i think you can get what you want.

poisy
poisy's picture
Offline
Joined: 23 Jul 2013
Posts:
dannyrough wrote: you can

dannyrough wrote:

you can employ an imaging sdk which can do such kind of compression. there are a lot of such sdks on the internet , just try some and i think you can get what you want.

thanks for sharing, that's awesome!

carolinenew
carolinenew's picture
Offline
Joined: 10 Apr 2013
Posts:
from what i see, image

from what i see, image programme an easily convert or compress data.but whether  you can access the original file data,just need to try. i am not so clear.

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
Created issue 2069 for this.

Created issue 2069 for this.

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
Shameless bump.

Shameless bump. :)

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
How hard would it be to add

How hard would it be to add an extra parameter to the EVENT_TYPE_IMAGE_PICKER that would be the url of the selected image? This way I could just open the file from the FS and deal with it properly, no need to re-compress.

The (both the old and new) implementation on Android reads the image from the file, but he iOS implementation seems to get an image object and deals with that directly. It is quite possible (not an iOS expert by far...) that the image does not even always come from a file - in that case the point would be of course moot.

The image data associated with a MoSync handle seems to always be in ARGB format (correct me if I'm wrong) - thereby making it impossible to get the original, compressed data back from it. Maybe the best would be after all to add some image compression routines on the platforms that support it (should be all of them)... Thoughts?

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
It must be this commit... It

It must be this commit... It was made on the 13th, just like the nightly build. Perhaps it made it into the build. I'll check too. Thanks again.

Ovidiu
ovidiu's picture
Offline
Mobile Sorcerer
Joined: 27 Jan 2011
Posts:
Yep, that's it, but I've

Yep, that's it, but I've checked already and it is not there yet :( So you'll have to wait: today or tomorrow there should be another nightly build.

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
Just checked, it's not in

Just checked, it's not in yet. Sigh. And now the app force-closes on start. And I've lost the Eclipse plugins. That'll teach me to install nightlies over stable... :)

Ovidiu
ovidiu's picture
Offline
Mobile Sorcerer
Joined: 27 Jan 2011
Posts:
You read my thoughts

You read my thoughts ;)

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
That's awesome, Ovidiu.

That's awesome, Ovidiu. Thanks for the info! Is it available in the nightlies?

Ovidiu
ovidiu's picture
Offline
Mobile Sorcerer
Joined: 27 Jan 2011
Posts:
The implementation has

The implementation has already been integrated in the 3.0.1 branch and it should be in the next nightly build.

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
I've been digging around a

I've been digging around a bit and here's what I found:

On iOS, the stock image picker is shown, the maImagePickerOpen() is just a wrapper to handle the event etc. On Android, the picker is implemented from scratch. It's clumsy, doesn't look particularly nice and, worst of all, it force closes every time after some scrolling (most probably due to some bug in the caching code or just simply it runs out of memory).

Why couldn't the Android Gallery be used for this, just like on iOS? Seems like that would have been the "native" way of implementing this.

Ovidiu
ovidiu's picture
Offline
Mobile Sorcerer
Joined: 27 Jan 2011
Posts:
From 3.0.1 (end of the month)

From 3.0.1 (end of the month) the Android Gallery will be used (implementation done, waits QA).

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
It's not a picture I've just

It's not a picture I've just taken, but one returned from maImagePickerOpen().

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
Ummm, yes, otherwise it

Ummm, yes, otherwise it wouldn't have compiled... :D

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Have you replaced

Have you replaced 'mLatestPictureTakenHandle' with the actual handle to the image you've taken?

lacapaca
lacapaca's picture
Offline
Joined: 18 Feb 2012
Posts:
Thanks for your reply, Sam.

Thanks for your reply, Sam. The idea was good, unfortunately it's giving me a MA_CAPTURE_RES_INVALID_HANDLE error.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Hey good question. There

Hey good question. There isn't an in-built method for compressing images, but the save picture methods call down to the OS to do that. Are you trying to send a picture the user has just taken? If you, so can save the image to their device, and then read the automatically compressed image as binary data!

{syntaxhighlighter brush: cpp;fontsize: 100; first-line: 1; }maCaptureWriteImage(mLatestPictureTakenHandle, "\sdcard\MyPhoto.jpg", 20);
{/syntaxhighlighter}

Will save the image to the device, using the (I'm guessing here) the default compression method of that device, which I guess will be JPEG.  You can use the FileSystem API to read back that encoded image, B64 and post.

Login or register to post comments