[TIMOB-3366] iOS: event.media.size reporting incorrect file size after camera/picker
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-07T22:50:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | blob, dimensions, file, image, ios, iphone, media, size |
Reporter | kosso |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:43:20.000+0000 |
Updated | 2017-06-07T22:50:38.000+0000 |
Description
While building an app which uses the camera or picker to choose or take photos, I've come across a bizarre bug.
After choosing a photo from the album, I needed to know the file size. Also I needed to know the width and height. So, using:
Ti.API.info("photo size : width:"+event.media.width+' height:'+event.media.height);
I can see the dimensions fine.
But when I tried to use event.media.size it returned the width*height !!?? (See line 74 in TiBlob.m !) Most bizarre.
When I then decide to write this file to the application data directory (as my app needs), this works fine as the blob's .size property does then respond with the correct filesize in bytes.
Is this being caused by some confusion form using the word 'size' for a filesize in one case (a blob) and then by using the word 'size' for a dictionary containing width and height for an image.
Either way, responding with width*height for an image 'size' seems like a nasty (but easily solved) error/bug.
Closing ticket due to time passed.