Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8924335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:23:02+00:00 2026-06-15T07:23:02+00:00

I am using the Phonegap 2.20 Android Screenshot plugin and it works fine. Now

  • 0

I am using the Phonegap 2.20 Android Screenshot plugin and it works fine. Now I want to save the image rotated by 270° – but I am new to Java/Android and need some help:

I tried to rewrite the EXIF data as follows

...

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyymmddhhmmss");
String filename = "Screenshot_" + dateFormat + ".png";
File f = new File(folder, filename); // System.currentTimeMillis()

//FileOutputStream fos = openFileOutput(f.getPath(), Context.MODE_PRIVATE);
FileOutputStream fos = new FileOutputStream(f);

// change image orientation to landscape                    
ExifInterface exif = new ExifInterface(filename);
exif.setAttribute(ExifInterface.TAG_ORIENTATION, "8");  // ExifInterface.ORIENTATION_ROTATE_270
exif.saveAttributes();

bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
//fos.close();

//Log.w(TAG, "TAG_ORIENTATION: " + exif.getAttribute(ExifInterface.TAG_ORIENTATION));

that.success(new PluginResult(PluginResult.Status.OK), id);

but it allways throws the error

E/JHEAD(26853): Can’t write back – didn’t read all

So I think I need to wait until the file is finished writing? Is there any listener or callback or s.l.t.?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:23:03+00:00Added an answer on June 15, 2026 at 7:23 am

    Well the first problem you will run into is that the ExifInterface can only read jpg data and not png. Second you can set the orientation parameter in the exif header but that doesn’t actually rotate the image. It only gives a hint to programs that display images on how to display them properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've packaged my JQM App using phoneGap (android & ios). It works fine, but
I am developing an Application using Phonegap on Android. Everything works fine on OS
I created dynamic list using android phonegap application.Now I want to add scrollbar for
I created a dynamic list with hyperlinks using Android PhoneGap . Now I want
I have developed the android phonegap application using html page and css. But My
I'm using Phonegap and Jquery Mobile on an Android app. I need to save
I've built some pretty straight forward apps earlier using phonegap for android. Now i'm
I am implementing a bar code scanner in Android using PhoneGap, but when I
I am using phonegap and developing html pages for android but I dont know
I want to run an Android application by using phonegap. I want to just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.