Hi,

I am using the Picasa web albums API to upload pictures to an album. I 
resize the pictures so that they do not count against my storage limit. 
However, when resizing the picture the EXIF information is lost, 
specifically the date on which the photo was taken and ISO, camera make, 
model etc.

So my plan was to retrieve the EXIF data from the original picture, resize 
it and then update the resized picture with the EXIF data (only the 
relevant data such as date, make, model). I cannot get this to work. I can 
read EXIF data perfectly well (using metadata-extractor or 
commons-imaging), but everything I set on the resized picture is discarded 
when the picture is uploaded.

I have tried to set the EXIF data before the picture is uploaded, as per 
https://developers.google.com/picasa-web/docs/2.0/developers_guide_java#UploadPhotoWithMetadata:

URL albumPostUrl = new 
URL("https://picasaweb.google.com/data/feed/api/user/*username*/albumid/*albumid*";);

PhotoEntry myPhoto = new PhotoEntry();
myPhoto.setTitle(new PlainTextConstruct("Puppies FTW"));
myPhoto.setDescription(new PlainTextConstruct("Puppies are the greatest."));
myPhoto.setClient("myClientName");

MediaFileSource myMedia = new MediaFileSource(new 
File("/home/liz/puppies.jpg"), "image/jpeg");
myPhoto.setMediaSource(myMedia);

ExifTags tags = new ExifTags();
// set the tags based on saved information from the original picture
tags.setCameraMake(make);
tags.setCameraModel(model);
//etc
// myPhoto.setExifTags(tags);

PhotoEntry returnedPhoto = myService.insert(albumPostUrl, myPhoto);

This does not work, all EXIF data is discarded and the date of the picture 
is simply the upload date.

I then tried to update the photo as 
per 
https://developers.google.com/picasa-web/docs/2.0/developers_guide_java#UpdatePhotos:

ExifTags tags = new ExifTags();
// set the tags based on saved information from the original picture
tags.setCameraMake(make);
tags.setCameraModel(model);
//etc
// myPhoto.setExifTags(tags);

myPhoto.setGeoLocation(37.7733, -122.4178);

myPhoto.update();

This does not work either, the Geo location from the example is updated though.

What am I missing here? I am absolutely sure that the Exif tags are set on the 
picture, but the information seems to simply get discarded? When I upload an 
original picture, all the EXIF data is shown just fine.

Thanks,
Geert

-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-picasa-data-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to