com. kelvinluck. flickr. PhotoClass to describe a photo from Flickr. Instances of this class are created to hold photos who have been returned in data from calls to the Flickr API. LicenceThis code and documentation is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0. http://creativecommons.org/licenses/by-nc-sa/2.0/ AuthorKelvin Luck < kelvin at kelvinluck dot com > Summary
owner
A reference to the Person who owns this photo. originalFormat
The format that this Photo was originally uploaded in. photoPageUrl
The link to this photo’s page on flickr.com. If flickr.photos.getInfo has been called on this photo then the link will be the “pretty” one with the user’s chosen screen name. Otherwise it will be the “ugly” one which works just as well but doesn’t look as good. thumbnailUrl
contextPhotoPrevious
The previous photo in this context (as returned by Flickr.photosGetContext) contextPhotoNext
The next photo in this context (as returned by Flickr.photosGetContext) _photosets
An Array containing references to the Photosets that this Photo is in. Filled in by a call to Flickr.photosGetAllContexts and also when you e.g. add a Photo to a Photoset through Photoset.addPhoto or Flickr.photosetsEditPhotos See Also_groups
An Array containing references to the Groups that this Photo is in. Filled in by a call to Flickr.photosGetAllContexts and also when you e.g. add a Photo to a Group through Group.addPhoto See AlsoexifData
The EXIF/TIFF/GPS tags associated with this photo. It is an Array of ExifData objects. _photos
A private static Object containing Photo objects. Used by getPhoto to insure that only one Photo is created for each photo ID returned from flickr.com Photo
Should be called via Photo.getPhoto getNotes
Returns an object containing all the note’s that have been left on this Photo ReturnsAll the Note’s that have been left on this Photo See Also<_notes> getTags
Returns an object containing all the tags’s that are associated with this Photo. ReturnsAll the Tag’s that are associated with this Photo. Each Tag is associated with a Person as well – the Person who left this Tag on this Photo. Each Tag is also associated with an id – this is the number you would use to call Flickr.photosRemoveTag if you wanted to remove that Tag from this Photo. See AlsogetTagsAsStrings
A utility function to get all the Tag’s associated with this Photo as Strings. Use this in cases where you don’t care about the details of the Tag or it’s relationship to this Photo (e.g. you aren’t planning to modify it or delete it) and you just want to know what it is... ReturnsAn Array containing the clean version of the text for each Tag left on this Photo. NOTE: this is only useful to you if you are only interested in the textual content of these Tags (otherwise use getTags) and will only be filled after a call to Flickr.photosGetInfo for this Photo. See AlsoaddTag
Adds a Tag object to this Photo and associates it with a Person who is the Person who associated that Tag with this Photo. Parameters
See AlsosetTags
Set’s this Photo’s _tags... Parameters
TODODoesn’t deal properly with tags with spaces in the name now :( Also need to get the Person object for the logged in user so we can correctly associate the author with the tag... We don’t know the id’s that will associate the Tag’s with the Photos at this point so are using garbage ones. This means that you won’t be able to remove the tags using those ids... addPhotoset
Adds a photoset to this Photos _photosets Array Parameters
removePhotoset
Removes a given Photoset from this Photos _photosets Array. setContextPhotoset
Adds information about this Photos context in a given Photoset Parameters
getContextPhotoset
Get information about the context of this Photo in a given Photoset Parameters
ReturnsAn object containing nextPhoto and previousPhoto which are Photo objects. undefined if there is no information about this Photos context in the requested Photoset setContextGroupPool
Adds information about this Photos context in a given Group Parameters
getContextGroupPool
Get information about the context of this Photo in a given Photoset Parameters
ReturnsAn object containing nextPhoto and previousPhoto which are Photo objects. undefined if there is no information about this Photos context in the requested Group getSizes
Get’s information about the available PhotoSizes for this Photo (assuming Flickr.photosGetSizes has been called - otherwise returns an empty Array. See AlsoReturns : The _sizes Array. |
This photo’s id.
public var id: Number
A reference to the Person who owns this photo.
public var owner: Person
This photo’s secret.
public var secret: String
This photo’s server.
public var server: Number
The format that this Photo was originally uploaded in.
public var originalFormat: String
private function Photo( id: Number )
This photo’s title.
public var title: String
This photo’s description.
public var description: String
The number of comments this photo has.
public var numComments: Number
The Notes that have been left on this photo.
private var _notes: Object
The Tags that are associated with this photo.
var _tags: Object
The PhotoSizes that are associated with this photo.
private var _sizes: Array
Whether or not this photo is public.
public var isPublic: Boolean
Whether or not this photo is by a friend.
public var isFriend: Boolean
Whether or not this photo is by a family member.
public var isFamily: Boolean
The date this photo was uploaded
private var _dateUploaded: Date
The date this photo was taken.
private var _dateTaken: Date
The date this photo was uploaded
private var _dateUpdated: Date
public var licence: Number
public var rotation: Number
The link to this photo’s page on flickr.com.
private var _photoPageUrl: String
private var _thumbnailUrl: String
The URL for the small sized image (240px on longest side)
public function set smallUrl( smallUrl: String )
The URL for the medium sized image (500px on longest side)
public function set mediumUrl( mediumUrl: String )
The URL for the large sized image (1024px on longest side)
public function set largeUrl( largeUrl: String )
private var _originalUrl: String
The URL for this photo within the context of the photostream e.g.
public var contextUrl: String
The URL for this photo’s thumbnail image within some sort of context e.g.
public var contextThumbUrl: String
The previous photo in this context (as returned by Flickr.photosGetContext)
public var contextPhotoPrevious: Photo
Calls flickr.photos.getContext to return next and previous photos for a photo in a photostream.
function photosGetContext ( photoId: Number )
The next photo in this context (as returned by Flickr.photosGetContext)
public var contextPhotoNext: Photo
Not documented on flickr.com but maybe the number of photos in this context (e.g.
public var contextCount: Number
Stores information about this Photos context in given Photosets
var contextPhotosets: Object
Stores information about this Photos context in given Groups
var contextGroupPools: Object
An Array containing references to the Photosets that this Photo is in.
private var _photosets: Array
An Array containing references to the Groups that this Photo is in.
var _groups: Array
The EXIF/TIFF/GPS tags associated with this photo.
public var exifData: Array
A private static Object containing Photo objects.
private static var _photos: Object
Returns an object containing all the note’s that have been left on this Photo
function getNotes():Object
Adds a Note object to this Photo.
function addNote( note: Note ):Void
Returns an object containing all the tags’s that are associated with this Photo.
function getTags():Object
A utility function to get all the Tag’s associated with this Photo as Strings.
function getTagsAsStrings():Array
Adds a Tag object to this Photo and associates it with a Person who is the Person who associated that Tag with this Photo.
function addTag( id: Number, tag: Tag, author: Person ):Void
Set’s this Photo’s _tags...
function setTags( tags: String, author: Person )
Adds a photoset to this Photos _photosets Array
function addPhotoset( photoset: Photoset )
Removes a given Photoset from this Photos _photosets Array.
function removePhotoset( photoset: Photoset )
This Photos _photosets Array.
function getPhotosets():Array
Adds a Group to this Photos _groups Array
function addGroup( group: Group )
Removes a given Group from this Photos _groups Array.
function removeGroup( group: Group )
This Groups _groups Array.
function getGroups():Array
Adds information about this Photos context in a given Photoset
function setContextPhotoset( photosetId: Number, previousPhoto: Photo, nextPhoto: Photo )
Get information about the context of this Photo in a given Photoset
function getContextPhotoset( photosetId: Number )
Adds information about this Photos context in a given Group
function setContextGroupPool( groupId: String, previousPhoto: Photo, nextPhoto: Photo )
Get information about the context of this Photo in a given Photoset
function getContextGroupPool( groupId: Number )
Adds a PhotoSize object to this Photo.
function addSize( size: PhotoSize ):Void
Get’s information about the available PhotoSizes for this Photo (assuming Flickr.photosGetSizes has been called - otherwise returns an empty Array.
function getSizes():Array
Calls flickr.photos.getRecent to get the available sizes for a photo.
function photosGetSizes ( photoId: Number )
Get’s a Photo object for the given photo ID.
public static function getPhoto( photoId: Number ):Photo
Returns next and previous photos for a photo in a set.
function photosetsGetContext( photoId: Number, photosetId: Number )
Gets next and previous photos for a photo in a group pool.
function groupsPoolsGetContext( photoId: Number, groupId: String )
Returns all visble sets and pools the photo belongs to.
function photosGetAllContexts( photoId: Number )
Adds a photo to the end of this Photoset’s photos array and updates numPhotos Called internally on a successful response from flickr.photosets.addPhoto.
function addPhoto( photo: Photo )
Modify the photos in a photoset.
function photosetsEditPhotos( photosetId: Number, primaryPhotoId: Number, photoIds: Array )
Adds a Photo to this Groups _pool.
function addPhoto( photo: Photo )
Calls flickr.photos.getInfo to get information about a photo..
function photosGetInfo ( photoId: Number, secret: String )
Calls flickr.photos.removeTag to remove a tag from a photo.
function photosRemoveTag ( tagId: Number )