Camera class doesn't save exif data?

All your problems with Audio, Video and Images.

Camera class doesn't save exif data?

Postby fuzzedmonkey » Thu Feb 05, 2009 9:13 pm

Hello,

I've written an app that takes a photo using the Camera class, saves
the image to the sd card and then emails the photo to a given email
address. I've noticed that the resulting image doesn't contain any
EXIF data? The photos taken with the native camera app contain
appropriate exif, but the photos my app take do not contain any.

Is there some code i'm missing to get the camera to do this, or is it
not supported?

Thanks,

George
fuzzedmonkey
Freshman
Freshman
 
Posts: 2
Joined: Thu Feb 05, 2009 9:09 pm

Top

Postby MrSnowflake » Fri Feb 06, 2009 9:50 am

That's because you only capture the photo and not the exif data. You should write that data yourself.

I'm wondering: why do we see so many questions about people making their own camera app, isn't the build-in good enough, you can easilly use it by intents. This doesn't mean I'm against implementing your own camera app, there can be lot of reasons to do so, I'm just wondering!
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby fuzzedmonkey » Fri Feb 06, 2009 1:00 pm

MrSnowflake wrote:That's because you only capture the photo and not the exif data. You should write that data yourself.

I'm wondering: why do we see so many questions about people making their own camera app, isn't the build-in good enough, you can easilly use it by intents. This doesn't mean I'm against implementing your own camera app, there can be lot of reasons to do so, I'm just wondering!


I just want a simple camera interface, with no options other than email to a set email address. Also, i could only really find information on creating a new app rather than using the existing camera app.

Any idea how to write the exif data?

Thanks,

George
fuzzedmonkey
Freshman
Freshman
 
Posts: 2
Joined: Thu Feb 05, 2009 9:09 pm

Postby onion » Thu Mar 05, 2009 8:21 am

Hi fuzzedmonkey,

I have the same problem here.
I found i add the code as follow and the problem's off:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"
  2.  
  3.                 + Environment.getExternalStorageDirectory())));
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


it seems to send a broadcast that the media scanner can work.
You can try it. hope this could help.
onion
Freshman
Freshman
 
Posts: 3
Joined: Thu Jul 17, 2008 7:15 am

Postby rlecheta » Wed Mar 18, 2009 3:56 pm

MrSnowflake wrote:isn't the build-in good enough, you can easilly use it by intents


Hi,

could you please show how to broadcast an intent to take a picture, and get the image ?

thank you
rlecheta
Freshman
Freshman
 
Posts: 3
Joined: Mon Sep 22, 2008 2:25 am

Postby joshmmo » Tue Apr 13, 2010 11:50 pm

onion wrote:Hi fuzzedmonkey,

I have the same problem here.
I found i add the code as follow and the problem's off:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"
  2.                 + Environment.getExternalStorageDirectory())));
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


it seems to send a broadcast that the media scanner can work.
You can try it. hope this could help.


I am trying to refresh the SD card so the music player can see the newly added mp3 files without having to restart the phone or reinsert the sd card, however with this code if i add 3 new files, it only shows ONE of the 3 files on the music player.

And if I run that code again it will show TWO of the 3....an so on....Any idea why? How should I tell it to just do all of them....
joshmmo
Freshman
Freshman
 
Posts: 6
Joined: Sun Mar 21, 2010 9:59 pm

Top

Postby CodeBaboon » Wed May 05, 2010 9:01 pm

as of Android 2.1

setting the Camera.Parameters: setGpsLatitude, setGpsLongitude, setGpsAltitude and setGpsTimestamp will make the EXIF data appear. If you are missing the setGpsTimestamp, the parameters will be set correctly but you won't see any GPS data if you try and view the JPEG's EXIF data. In other words you need all four of these parameters to be set for it to work properly

Code: Select all
Camera.Parameters mParamters = mCamera.getParameters();

mParameters.setGpsLatitude( mLastLocation.getLatitude() );
mParameters.setGpsLongitude( mLastLocation.getLongitude() );
mParameters.setGpsAltitude( mLastLocation.getAltitude() );
mParameters.setGpsTimestamp( System.currentTimeMillis() );


where mCamera is your Camera Object and mLastLocation is your GPSLocation object
CodeBaboon
Junior Developer
Junior Developer
 
Posts: 18
Joined: Fri Mar 26, 2010 8:27 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 10 guests