android - Cwacs-camera photos are mirrored no matter what mirrorFFC is set to -
i'm having strange problem commonsware's cwac-camera library. images taken front camera mirrored (i.e. mirror of see in preview) despite setting:
builder.mirrorffc(true);
i have confirmed setting applied correctly logging in imagecleanuptask follows:
if (applymatrix) { if (info.facing == camera.camerainfo.camera_facing_front) { if (xact.host.getdeviceprofile().portraitffcflipped() && (xact.displayorientation == 90 || xact.displayorientation == 270)) { matrix=flip(new matrix()); } else if (xact.mirrorffc()) { log.d("myapp", "matrixffc true"); matrix=mirror(new matrix()); } } the strangest thing photos always mirrored, whether set mirrorffc(true) or not. haven't made other changes cwac library.
a quick , dirty hack solving problem modify imagecleanuptask follows:
if (matrix != null) { bitmap original= bitmapfactory.decodebytearray(data, 0, data.length); cleaned= bitmap.createbitmap(original, 0, 0, original.getwidth(), original.getheight(), matrix, true); original.recycle(); //below added code: matrix mymatrix = new matrix(); mymatrix.prescale(-1.0f, 1.0f); cleaned = bitmap.createbitmap(cleaned, 0, 0, cleaned.getwidth(), cleaned.getheight(), mymatrix, false); } now question - device (samsung sgs i9000, running ics) causes problems or else?
Comments
Post a Comment