• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root EXIF data from the camera

dsmryder

Android Expert
I want to learn more about programming, and sence it seems that no one is working on the bug on the Triumph's CM7s camera EXIF date data. I thought I would use this as an opportunity to work on something.

If I step on your toes, I'm sorry. I just want to learn.


Special Thanks go to:
 
Does anyone know where the camera.java came from that's used in our version of CM7?
When I look at the code, it looks like it should get the time from System.currentTimeMillis()
This is the same time that the camcorder uses, and the EXIF data is correct there.
 
Ah, ok.
You probably need a EXIF viewing utility.
I use irfanview in windows, it may not suit you.
I suspect that you are seeing the file date, when no EXIF exists.
 
Ok, just spent some time going back in time examining EXIF data.

It appears that "Date/Time Digitized" has always been incorrect (2002)... Even on stock?!

I'm thinking that was stock anyway... Device had correct phone model in the tag. I could be wrong on that... Maybe someone can confirm or deny?

Edit: think I'll flash back to stock for a test.

It also looks like "Date/Time Original" is correct, even now. Device is listed incorrectly also.

I doubt any of this will help you but, anything I can do, I'm willing.
 
Ok, just spent some time going back in time examining EXIF data.

It appears that "Date/Time Digitized" has always been incorrect (2002)... Even on stock?!

I'm thinking that was stock anyway... Device had correct phone model in the tag. I could be wrong on that... Maybe someone can confirm or deny?

It also looks like "Date/Time Original" is correct, even now. Device is listed incorrectly also.

I doubt any of this will help you but, anything I can do, I'm willing.

This is cool. My wife has a Triumph and she won't let me change the OS, so I have a stock model to check against.

I just looked and I can see the EXIF data when I right click on pictures on my computer. I'll search the market for something to use on my phone.
 
The problem started between 11\15\2011 and 11\23\2011. I need to find out when I loaded TG's bata.8. What's wierd, when I look at the code, it seems like the date taken should be right. The only thing I see is the GPS date s=is set to "mParameters.setGpsTimestamp(System.currentTimeMillis() / 1000)"

I don't know if the "/ 1000" is messing it up.
I also don't know for sure if the version of the camera app I'm looking at is the one on our phones
 
Ok. TG's beta .8 was released on 11/19, right between the dates I noticed the change. I'm going to run the first ROM with the camera working and see if it works right
 
If you can verify one of TG's CM7 ROMs had it working, and another build that didn't work, then can just look at his github commit history to see what changed.
 
OK, I have confirmed that the bug exists in the original beta release. Now I'm going to find out if it is in other versions of CM7
 
OK, I just took some pictures using Pudding Camera and the pics have the correct EXIF date.

I need to hunt down the correct camera.java that's used in our ROMs.
 
Which "EXIF date" are we talking about?

It goes under the "date taken" part of the EXIF data
I looked at the source code that TG used, and what I guess everyone used sence then, and it say's the picture should have System.currentTimeMillis()
I think it has to be in the camera app because I was able to take a picture wih Pudding camera and it has the correct data:confused:
 
I'm thinking the first beta was when things changed.

I have a picture dated 2011.10.16 and the data says:
Make: Verizon_wwe
Model: ADR6400
Date of Original is good
Date Digitized is bad (I believe this is bad in stock also)

The next picture I have (which I believe is from the first beta) is dated 2011.10.18
Make: QCOM-AA
Model: QCAM-AA
Date original is bad
Date digitized is bad

This is the info still in the current ROM.
I didn't save any of the past builds to test this, and only the beta versions are still linked in TG's thread.
 
Well I found out why the focus ring is the wrong color when focus is ubtained. In the images, focus succes is named focus_focused, but under the java code, it's named focus_success.
 
I'm thinking the first beta was when things changed.

I have a picture dated 2011.10.16 and the data says:
Make: Verizon_wwe
Model: ADR6400
Date of Original is good
Date Digitized is bad (I believe this is bad in stock also)

The next picture I have (which I believe is from the first beta) is dated 2011.10.18
Make: QCOM-AA
Model: QCAM-AA
Date original is bad
Date digitized is bad

This is the info still in the current ROM.
I didn't save any of the past builds to test this, and only the beta versions are still linked in TG's thread.

I did check the original beta, and it had the same wrong info. I don't have any alphas, but the code where TG got his is almost identical. He added a line about rotation, and took something out. I'm still in the compare process.
 
OK, I have found the part that grabs the EXIF data I think. I'm not sure though. I see where the time format seem wierd to me as it's set to kk:mm:ss
I don't know what will happen, but I'm going to change it to hh:mm:ss.

Code:
[SIZE=2]
[/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]long[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dateTaken = System.currentTimeMillis();
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (dateTaken != 0) {
String datetime = DateFormat.format([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"yyyy:MM:dd kk:mm:ss"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], dateTaken).toString();
mParameters.set([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"exif-datetime"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],datetime);
}

mCameraDevice.setParameters(mParameters);

incrementkeypress();
Size pictureSize = mParameters.getPictureSize();
mImageWidth = pictureSize.width;
mImageHeight = pictureSize.height;
mCameraDevice.takePicture(mShutterCallback, mRawPictureCallback,
mPostViewPictureCallback, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] JpegPictureCallback(loc));
mPreviewing = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]false[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/LEFT]
}
[/SIZE]

Chime in if you know what I am seeing here.
 
OK, I have found the part that grabs the EXIF data I think. I'm not sure though. I see where the time format seem wierd to me as it's set to kk:mm:ss
I don't know what will happen, but I'm going to change it to hh:mm:ss.

Code:
[SIZE=2]
[/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]long[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dateTaken = System.currentTimeMillis();
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (dateTaken != 0) {
String datetime = DateFormat.format([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"yyyy:MM:dd kk:mm:ss"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], dateTaken).toString();
mParameters.set([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"exif-datetime"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],datetime);
}

mCameraDevice.setParameters(mParameters);

incrementkeypress();
Size pictureSize = mParameters.getPictureSize();
mImageWidth = pictureSize.width;
mImageHeight = pictureSize.height;
mCameraDevice.takePicture(mShutterCallback, mRawPictureCallback,
mPostViewPictureCallback, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] JpegPictureCallback(loc));
mPreviewing = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]false[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/LEFT]
}
[/SIZE]

Chime in if you know what I am seeing here.

If I'm not mistaken, this is what you're trying to fix right?

Gerrit Code Review

If so, sorry someone beat you to it. If not, maybe that is related to what you're looking for.
 
If I'm not mistaken, this is what you're trying to fix right?

Gerrit Code Review

If so, sorry someone beat you to it. If not, maybe that is related to what you're looking for.

Thank you for that, but that code was included in the source when the app was compiled so long ago. Unless the camera.apk is something different than what is listed in the github.

I don't know if there is a way to decompile the .apk to look and varify the componats that was used.
 
CRAP! I can't compile it through Eclipse.

I don't know if it's the way the code is set up or if it's me.

I don't even know how to tell.:mad:

Getting late, gotta go to bed like a good boy:cool:
 
Back
Top Bottom