Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3366] iOS: event.media.size reporting incorrect file size after camera/picker

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-07T22:50:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsblob, dimensions, file, image, ios, iphone, media, size
Reporterkosso
AssigneeIngo Muschenetz
Created2011-04-15T03:43:20.000+0000
Updated2017-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.

Comments

  1. Lee Morris 2017-06-07

    Closing ticket due to time passed.

JSON Source