Closed Bug 1146393 Opened 9 years ago Closed 9 years ago

[Shinano][Aries] No attachment preview visible for pictures over 5MB

Categories

(Firefox OS Graveyard :: Gaia::SMS, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gerard-majax, Assigned: julienw)

References

Details

(Whiteboard: [sms-most-wanted][Spark][sms-sprint-2.2S14])

Attachments

(1 file)

46 bytes, text/x-github-pull-request
steveck
: review+
Details | Review
STR:
 0. Tap "attach" in SMS, select Camera
 1. Take a picture

Expected:
 Preview is visible in compose field

Actual:
 If the resulting image is over 5MB, then no preview is generated.
So it's done on purpose in [1] but we could configure it because we can know how much memory we have since v2.0:

      navigator.getFeature('hardware.memory').then(function(mem) { })


[1] https://github.com/mozilla-b2g/gaia/blob/36e8153edd11dfbd36df26eeac9dc19216137d62/apps/sms/js/attachment_renderer.js#L9-L11
Whiteboard: [sms-most-wanted]
We could encapsulate this in Settings.js.
Marking as blocking bug 1162197 for tracking purpose mostly, I'm not sure it's such a big deal for now, we can live with it; but it's good people can easily find about.
Blocks: spark-device
The limitation comes from a time where we didn't use moz-samplesize and we used canvas to resize the thumbnail in-memory. I think we could move the limitation a lot higher now, without even checking the available memory.

Alexandre, could you please share what is the typical size of a picture taken with Aries?
Flags: needinfo?(lissyx+mozillians)
(In reply to Julien Wajsberg [:julienw] from comment #5)
> The limitation comes from a time where we didn't use moz-samplesize and we
> used canvas to resize the thumbnail in-memory. I think we could move the
> limitation a lot higher now, without even checking the available memory.
> 
> Alexandre, could you please share what is the typical size of a picture
> taken with Aries?

It depends on the picture itself, but you can expect something around 3.5MB to 5.5MB is common.
Flags: needinfo?(lissyx+mozillians)
Whiteboard: [sms-most-wanted] → [sms-most-wanted][spark]
Whiteboard: [sms-most-wanted][spark] → [sms-most-wanted][Spark]
Attached file master github PR
Hey Steve, what do you think of this?

I tested with a Flame master with the memory set to 319MB and this image:
DSC_0141.JPG JPEG 4928x3264 4928x3264+0+0 8-bit sRGB 8.303MB 0.040u 0:00.029

So it's 8MB and 16MP.

It worked fine (albeit quite slow).

I even wonder if we shouldn't remove the limit altogether (the main issue with big images is when resizing to send, not really when displaying the thumbnail, right?) but discussing with Francisco we thought it's better to still keep it so that it's easier to change for some target devices.
Assignee: nobody → felash
Attachment #8617522 - Flags: review?(schung)
Comment on attachment 8617522 [details] [review]
master github PR

This solution should be fine for spark, but maybe we can create another key for image-limitation-for-message in settings DB for real customizable solution.
Attachment #8617522 - Flags: review?(schung) → review+
Yeah this could likely be customized per device.
master: https://github.com/mozilla-b2g/gaia/commit/0c0e988dca221e3294a0868f090956ee79c18a89

Thanks for reviewing !
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Hmm maybe put this in app customize json is better than in settings: https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Market_customizations_guide. But it seems we will need to write some build script for it.
Nothing urgent anyway -- this can change once we use Service Workers too :)
Whiteboard: [sms-most-wanted][Spark] → [sms-most-wanted][Spark][sms-sprint-2.2s14]
Whiteboard: [sms-most-wanted][Spark][sms-sprint-2.2s14] → [sms-most-wanted][Spark][sms-sprint-2.2S14]
Sweet to see a 7.6MB picture with a thumbnail now :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: