Index: android/src/com/google/zxing/client/android/CameraManager.java =================================================================== --- android/src/com/google/zxing/client/android/CameraManager.java (revisión: 1197) +++ android/src/com/google/zxing/client/android/CameraManager.java (copia de trabajo) @@ -297,10 +297,12 @@ default: // The Samsung Moment incorrectly uses this variant instead of the 'sp' version. // Fortunately, it too has all the Y data up front, so we can read it. - if (previewFormatString.equals("yuv420p")) { + if (previewFormatString!=null && previewFormatString.equals("yuv420p")) { return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top, rect.width(), rect.height()); - } + } else if (previewFormatString==null) + return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top, + rect.width(), rect.height()); } throw new IllegalArgumentException("Unsupported picture format: " + previewFormat + '/' + previewFormatString); @@ -319,6 +321,7 @@ previewFormat = parameters.getPreviewFormat(); previewFormatString = parameters.get("preview-format"); Log.v(TAG, "Default preview format: " + previewFormat + '/' + previewFormatString); + Log.v(TAG, "ALL PREVIEW: " + parameters.flatten()); // Ensure that the camera resolution is a multiple of 8, as the screen may not be. // TODO: A better solution would be to request the supported preview resolutions @@ -326,6 +329,8 @@ cameraResolution = new Point(); cameraResolution.x = (screenResolution.x >> 3) << 3; cameraResolution.y = (screenResolution.y >> 3) << 3; + +if (cameraResolution.x==360) cameraResolution.x=320; Log.v(TAG, "Setting preview size: " + cameraResolution.x + ", " + cameraResolution.y); parameters.setPreviewSize(cameraResolution.x, cameraResolution.y); Index: android/build.xml =================================================================== --- android/build.xml (revisión: 1197) +++ android/build.xml (copia de trabajo) @@ -220,6 +220,8 @@ + +