Merge "ImageReader: get correct crop size" into klp-dev

This commit is contained in:
Zhijun He
2013-09-16 17:33:36 +00:00
committed by Android (Google) Code Review

View File

@@ -739,11 +739,9 @@ static jboolean ImageReader_imageSetup(JNIEnv* env, jobject thiz,
int outputHeight = buffer->height; int outputHeight = buffer->height;
// Correct width/height when crop is set. // Correct width/height when crop is set.
if (buffer->crop.getWidth() > 0) { if (buffer->crop.isValid()) {
outputWidth = buffer->crop.getWidth() + 1; outputWidth = buffer->crop.getWidth();
} outputHeight = buffer->crop.getHeight();
if (buffer->crop.getHeight() > 0) {
outputHeight = buffer->crop.getHeight() + 1;
} }
int imageReaderWidth = ctx->getBufferWidth(); int imageReaderWidth = ctx->getBufferWidth();