I have a custom camera application that is used to shoot and crop them into a square, now I want to know how to write Exif data for the final output image (especially for orientation)
Here are the important parts of my code:
captureButton = (Button) findViewById(R.id.button_capture); captureButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {
and this is the callback function:
PictureCallback mPicture = new PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { File pictureFile = getOutputMediaFile(); if (pictureFile == null) { return; } try { FileOutputStream fos = new FileOutputStream(pictureFile); fos.write(data); fos.close(); } catch (FileNotFoundException e) { } catch (IOException e) { } } };
Update: I added the following to the onPictureTaken method, but nothing changed:
ExifInterface exif; exif = new ExifInterface(pictureFile.getAbsolutePath());
android android camera
Shehabix
source share