diff options
author | Angus Kong <shkong@google.com> | 2011-08-17 00:23:51 +0800 |
---|---|---|
committer | Angus Kong <shkong@google.com> | 2011-08-17 14:35:45 +0800 |
commit | e46486104523760a4433f03e09ed615987d83b6c (patch) | |
tree | 56b2214690442b70d13ed550d8bad5eddfef8d7d /src | |
parent | 97965c13c44accd66621362873f8bbac8bc104d4 (diff) | |
download | LegacyCamera-e46486104523760a4433f03e09ed615987d83b6c.zip LegacyCamera-e46486104523760a4433f03e09ed615987d83b6c.tar.gz LegacyCamera-e46486104523760a4433f03e09ed615987d83b6c.tar.bz2 |
Fix issue: returned width/height <= 0.
Width/height returned by Mosaic JNI is <= 0. generateFinalMosaic() now returns null in such cases.
bug:5133740
Change-Id: I49b69cab1d40fd878d7cd4988fbc1a9f4dba9343
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/panorama/PanoramaActivity.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java index 146ac89..bb23b65 100644 --- a/src/com/android/camera/panorama/PanoramaActivity.java +++ b/src/com/android/camera/panorama/PanoramaActivity.java @@ -553,6 +553,13 @@ public class PanoramaActivity extends Activity implements + ((imageData[len + 6] & 0xFF) << 8) + (imageData[len + 7] & 0xFF); Log.v(TAG, "ImLength = " + (len) + ", W = " + width + ", H = " + height); + if (width <= 0 || height <= 0) { + // TODO: pop up a error meesage indicating that the final result is not generated. + Log.e(TAG, "width|height <= 0!!, len = " + (len) + ", W = " + width + ", H = " + + height); + return null; + } + YuvImage yuvimage = new YuvImage(imageData, ImageFormat.NV21, width, height, null); ByteArrayOutputStream out = new ByteArrayOutputStream(); yuvimage.compressToJpeg(new Rect(0, 0, width, height), 100, out); |