Closed Bug 998095 Opened 6 years ago Closed 6 years ago

[Tarako] Editing image size of ~400K causes Gallery app to crash

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(blocking-b2g:1.3T+, b2g-v1.3T verified)

RESOLVED FIXED
2.0 S1 (9may)
blocking-b2g 1.3T+
Tracking Status
b2g-v1.3T --- verified

People

(Reporter: njpark, Assigned: djf)

References

Details

(Whiteboard: [tarako-bug-bash-1.3T])

Attachments

(2 files)

STR:
- Copy attached image into the phone, and open it in the gallery (need to copy into the DCIM folder)
- Press edit button
- brighten it by +2 
- Press style button (three circles) and choose a style
- Press Done

Expected:
- Modified image is now saved

Actual:
- App dies and exits to homescreen

 Gaia      a8d2d399f2939f4845abaa0df57abab241a2c782                         │
│ Gecko                                                                      │
│ https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/d97dad54cb61       │
│ BuildID   20140417004002                                                   │
│ Version   28.1                                                             │
│ ro.build.version.incremental=eng.cltbld.20140417.084919
Summary: [Tarako] Editing ~400K image causes Gallery app to crash → [Tarako] Editing image size of ~400K causes Gallery app to crash
Whiteboard: tarako-bug-bash-1.3T → [tarako-bug-bash-1.3T]
Can we confirm this works fine on Buri 1.3?
Keywords: qawanted
On latest Buri 1.3, this works fine
Keywords: qawanted
Let's find out the largest image size that can be edited on the tarako device without OOMing & indicate what the size of that image is.
Keywords: qawanted
The original poster's OOM is not 100% reproducible. Repro rate: 50% (5 out of 10 attempts).

(In reply to Jason Smith [:jsmith] from comment #3)
> Let's find out the largest image size that can be edited on the tarako
> device without OOMing & indicate what the size of that image is.

314KB image OOM repro rate: 0 out of 10 attempts.

364KB image OOM repro rate: 2 out of 10 attempts.

I'd say the threshold should be around ~310KB.

Tested on:
Device: Tarako 1.3T MOZ
BuildID: 20140424014003
Gaia: 706f474230432c8cb01e124aee2c055ec902aa1d
Gecko: 26ef3dded9ff
Version: 28.1
Firmware Version: sp6821a_gonk4.0_user.pac
Keywords: qawanted
Can we get a limit put here for Tarako to only allow editing of photos to occur with images that have a size less than or equal to 310 KB? That will prevent the current risk of OOMs that can occur with any image that has a size greater than that.
blocking-b2g: --- → 1.3T?
ni? djk for further comments
Flags: needinfo?(dflanagan)
Bug 989026 is a followup to 989290 that reduces image size before editing because on Tarako we cannot reliably edit 1600x1200 photos from the camera. That patch is under review now. When it lands, it should resolve this bug.

Actually, though I may attach the patch to this bug instead because it is more specific to the problem.

No-Jun and Jason: for future bugs note that the file size of the image is pretty much irrelevant. It is the image size (in pixels) that matters. In this case the image is 1600x1067, which is smaller than the 1600x1200 images the Tarako camera returns.
blocking-b2g: 1.3T? → 1.3T+
Flags: needinfo?(dflanagan)
QA Contact: dflanagan
Assignee: nobody → dflanagan
QA Contact: dflanagan
Pi Wei, Jason, and No-Jun: setting needinfo to point out that in future bugs, it is the size of the image in pixels that matters, not the size of the file in kilobytes. 

Pi Wei: I'd be interested to know the image size (in pixels) of the test image you used when you had no reproductions of the bug.

The patch that I'm going to be landing will take 1600x1200 images and reduce each dimension by a factor of 2 to produce an 800x600 edited image. Images smaller than or equal to 800x600 will be left alone.
Flags: needinfo?(pcheng)
Flags: needinfo?(npark)
Flags: needinfo?(jsmith)
David,

The 314KB image that had 0 repro of issue is 1200 x 794 pixels.

The 364KB image that repro'ed twice in 10 attempts is 1300 x 861 pixels.
Flags: needinfo?(pcheng)
Attachment #8413022 - Flags: review?(pdahiya)
Comment on attachment 8413022 [details] [review]
link to patch on github

Thanks David. The patch looks good and has my r+. Editing a 1600x1200 image successfully saves it rotated with resolution 600x800.
Attachment #8413022 - Flags: review?(pdahiya) → review+
ok
Flags: needinfo?(jsmith)
Landed on 1.3t: https://github.com/mozilla-b2g/gaia/commit/4dd06db93607f55694953fe60751eddb4bbb5afc

Note that for this patch to take effect, you must build your profile with GAIA_MEMORY_PROFILE=low

Once bug 1000448 lands, this will automatically be set in nightly 1.3t builds.  But until then, do this before testing:

$ GAIA_MEMORY_PROFILE=low make profile # update config.js files for camera and gallery
$ APP=camera make install-gaia         # push the camera to the phone
$ APP=gallery make install-gaia        # push the gallery to the phone
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Depends on: 1000448
understood.  thanks!
Flags: needinfo?(npark)
This issue is verified fixed in 

1.3t Environmental Variables:
Device: Tarako 1.3t
BuildID: 20140428014001
Gaia: 8895b180ed636069473703d0e7b73086989601ce
Gecko: 7caf4b5abfce
Version: 28.1
Firmware Version: sp6821
Blocks: 1006039
Blocks: 1002593
Target Milestone: --- → 2.0 S1 (9may)
No longer blocks: 1014496
Blocks: 1041853
You need to log in before you can comment on or make changes to this bug.