Photo

Class Photo:

method deletePhoto()

Deletes the given Photo.

Examples:

PicasaApp.find('DC00024')[0].deletePhoto();

method getAlbum()

Returns the Album that this Photo belongs to.

Return Values:

Type

Album

Description

the Album that this Photo belongs to.

Examples:

PicasaApp.find('DC00024')[0].getAlbum().getTitle();

method getBlob()

Gets a Blob object containing a copy of this Photo.

Return Values:

Type

Blob

Description

a Blob object containing a copy of this Photo.

Examples:

function sendAnImage() {

var aPictureOfADog = PicasaApp.find('dog', true)[0].getBlob().setName("A dog");

MailApp.sendEmail("romain.vialard@gmail.com","Demo","", { htmlBody: "Here's a dog : <img src='cid:aPictureOfADog'>",

inlineImages: { aPictureOfADog: aPictureOfADog}});

}

method getCaption()

Returns the caption of the Photo.

Return Values:

Type

String

Description

the caption of the Photo.

Examples:

var aPictureOfADog = PicasaApp.find('dog', true)[0];

Logger.log(aPictureOfADog.getTitle()+' - '+aPictureOfADog.getCaption()+': '+aPictureOfADog.getWidth()+'x'+aPictureOfADog.getHeight())

method getDatePublished()

Returns the Date that the Photo was originally published.

Return Values:

Type

Date

Description

the Date that the Photo was originally published.

method getHeight()

Returns the height of the Photo.

Return Values:

Type

Int

Description

the height of the Photo.

Examples:

var aPictureOfADog = PicasaApp.find('dog', true)[0];

Logger.log(aPictureOfADog.getTitle()+' - '+aPictureOfADog.getCaption()+': '+aPictureOfADog.getWidth()+'x'+aPictureOfADog.getHeight())

method getLastUpdated()

Returns the Date that the Photo was last updated.

Return Values:

Type

Date

Description

the Date that the Photo was last updated.

method getSize()

Returns the size of the Photo.

Return Values:

Type

Int

Description

the size of the Photo.

Examples:

var aPictureOfADog = PicasaApp.find('dog', true)[0];

Logger.log(aPictureOfADog.getTitle()+' - '+aPictureOfADog.getCaption()+': '+aPictureOfADog.getSize()/1000+'ko');

method getTitle()

Returns the title of the Photo.

Return Values:

Type

String

Description

the title of the Photo.

Examples:

var aPictureOfADog = PicasaApp.find('dog', true)[0];

Logger.log(aPictureOfADog.getTitle()+' - '+aPictureOfADog.getCaption()+': '+aPictureOfADog.getWidth()+'x'+aPictureOfADog.getHeight())

method getUrl()

Returns the url of the Photo.

Return Values:

Type

String

Description

the url of the Photo.

Examples:

var aPictureOfADog = PicasaApp.find('dog', true)[0];

Logger.log(aPictureOfADog.getTitle()+' - '+aPictureOfADog.getCaption()+': '+aPictureOfADog.getUrl());

method getWidth()

Returns the width of the Photo.

Return Values:

Type

Int

Description

the width of the Photo.

Examples:

var aPictureOfADog = PicasaApp.find('dog', true)[0];

Logger.log(aPictureOfADog.getTitle()+' - '+aPictureOfADog.getCaption()+': '+aPictureOfADog.getWidth()+'x'+aPictureOfADog.getHeight())

method setAlbum(Album)

Sets the Album that this Photo belongs to.

Arguments:

Name

Album

Type

Album

Description

the new Album for this Photo.

Return Values:

Type

Photo

Description

this Photo for chaining

Examples:

var albums = PicasaApp.getAlbums();

for(i in albums){

if(albums[i].getTitle() == 'My images'){

var originalAlbum = albums[i];

}

if(albums[i].getTitle() == 'Funny ones'){

var destinationAlbum = albums[i];

}

}

var photos = originalAlbum.search('CalvinAndHobbes');

for(i in photos){

photos[i].setAlbum(destinationAlbum);

}

method setCaption(caption)

Sets the caption of the Photo.

Arguments:

Name

caption

Type

String

Description

the new caption of the Photo.

Return Values:

Type

Photo

Description

this Photo for chaining

method setTitle(title)

Sets the title of the Photo.

Arguments:

Name

title

Type

String

Description

the new title of the Photo.

Return Values:

Type

Photo

Description

this Photo for chaining