why the images of camera using Surface view is not same as the image i capture using Intent(ACTION_IMAGE_CAPTURE)
<p>I use following Code to capture image. In it I use <code>Surfaceview</code>. The captured image is saved in folder  which i create in android Sdcard but when i show these Images in a <code>GridView</code> the image orientation is different. If I use camera using <code>Intent (ACTION_IMAGE_CAPTURE)</code> then  output Image is well defined. can any one help me</p>

<p>Here  I have class which extends  Activity  an implement <code>SurfaceHolder.Callback</code></p>

<pre><code>public class CameraView extends Activity implements SurfaceHolder.Callback {

       private static final String TAG = "CameraVeiw";

        private Camera camera;
        boolean previewing = false;
        SurfaceHolder surfaceHolder;
        private File file = null;
        private static String mFileName = null;

        private long name;

        final int RESULT_SAVEIMAGE = 0;
        private int w;
        private int h;

        public   static byte[] data = null;

        @Override
        public void onCreate(Bundle savedInstanceState){
            super.onCreate(savedInstanceState);
            setContentView(R.layout.camera);
       }
</code></pre>

<p>I use <code>SurfaceView</code> to capture Image</p>

<pre><code>    SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceview);
    surfaceHolder = surfaceView.getHolder();
    surfaceView.getWindowVisibility();
    surfaceHolder.addCallback(this);
    surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    surfaceHolder.setFixedSize(300, 300); //hard coded

    Button button2 = (Button) findViewById(R.id.picbutton);
    button2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {



    camera.takePicture(new CustomShutter(), null, 
    new CustomPictureCallback());
    }
    });

    }
public void surfaceChanged(SurfaceHolder holder, int format, int width,
    int height) {

        if(previewing){
            camera.stopPreview();
            previewing = false;
        }

        if (camera != null){
            try {
                camera.setPreviewDisplay(surfaceHolder);
                camera.startPreview();


                previewing = true;


            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }

public void surfaceCreated(SurfaceHolder holder) {
        camera = Camera.open();
             camera.setDisplayOrientation(90);        }

@Override
public void surfaceDestroyed(SurfaceHolder holder) {
    camera.stopPreview();
    camera.release();
    camera = null;
    previewing = false;  
}

class CustomPictureCallback implements Camera.PictureCallback {
    private Bitmap bitmap;
public void onPictureTaken(byte[] data, Camera camera) {

             FileOutputStream outStream = null;

                try {

        String path = "/sdcard/MonsterApp/Photos/" + data+".jpg";
                outStream = new FileOutputStream(String.format(path));
                    outStream.write(data);
                    outStream.close();
                    Log.d(TAG, "onPictureTaken - wrote bytes: " + data.length);
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } finally {
                }
                Log.d(TAG, "onPictureTaken - jpeg");

                camera.startPreview();
                Log.i("Information", "Helllllooooo");   } }




class CustomShutter implements Camera.ShutterCallback {


    public void onShutter() {

    }

    }
    @Override
    public void onDestroy() {
    super.onDestroy();
    if(camera != null) {
    camera.release();
    }
    }

}
</code></pre>
