## GFBGraphPhoto GFBGraphPhoto — GFBGraph Photo node |

## Stability Level

Unstable, unless otherwise indicated

## Functions

GFBGraphPhoto * | gfbgraph_photo_new ()
GFBGraphPhoto * | gfbgraph_photo_new_from_id ()
GInputStream * | gfbgraph_photo_download_default_size ()
const gchar * | gfbgraph_photo_get_name ()
const gchar * | gfbgraph_photo_get_default_source_uri ()
guint | gfbgraph_photo_get_default_width ()
guint | gfbgraph_photo_get_default_height ()
GList * | gfbgraph_photo_get_images ()
const GFBGraphPhotoImage * | gfbgraph_photo_get_image_hires ()
const GFBGraphPhotoImage * | gfbgraph_photo_get_image_near_width ()
const GFBGraphPhotoImage * | gfbgraph_photo_get_image_near_height ()

## Properties

guint | height | Read / Write
gpointer | images | Read / Write
gchar * | name | Read / Write
gchar * | source | Read / Write
guint | width | Read / Write

## Types and Values

struct | GFBGraphPhoto
struct | GFBGraphPhotoClass
struct | GFBGraphPhotoImage

## Object Hierarchy

        GObject
        ╰── GFBGraphNode
            ╰── GFBGraphPhoto

## Implemented Interfaces

GFBGraphPhoto implements GFBGraphConnectable and JsonSerializable.

## Includes

    #include <gfbgraph/gfbgraph.h>

## Description

GFBGraphPhoto represents a photo in the Facebook Graph API.

## Functions

### gfbgraph_photo_new ()

    GFBGraphPhoto *
    gfbgraph_photo_new (void);

Creates a new GFBGraphPhoto.

#### Returns

a new GFBGraphPhoto; unref with `g_object_unref()`.

[transfer full]

### gfbgraph_photo_new_from_id ()

    GFBGraphPhoto *
    gfbgraph_photo_new_from_id (GFBGraphAuthorizer *authorizer,
                                const gchar *id,
                                GError **error);

Retrieves an photo node from the Facebook Graph with the give ID.

#### Parameters

authorizer | a GFBGraphAuthorizer. |
id | a const gchar with the photo ID. |
error | a GError or `NULL`. | [allow-none]

#### Returns

a new GFBGraphPhoto; unref with `g_object_unref()`.

[transfer full]

### gfbgraph_photo_download_default_size ()

    GInputStream *
    gfbgraph_photo_download_default_size (GFBGraphPhoto *photo,
                                          GFBGraphAuthorizer *authorizer,
                                          GError **error);

Download the default sized photo pointed by `photo` , with a maximum width or height of 720px. The photo always is a JPEG.

#### Parameters

photo | a GFBGraphPhoto. |
authorizer | a GFBGraphAuthorizer. |
error | a GError or `NULL`. | [allow-none]

#### Returns

a GInputStream with the photo content or `NULL` in case of error.

[transfer full]

### gfbgraph_photo_get_name ()

    const gchar *
    gfbgraph_photo_get_name (GFBGraphPhoto *photo);

#### Parameters

photo | a GFBGraphPhoto. |

#### Returns

the `photo` name, which is the comment given by the user so it would by larger, or `NULL`.

[transfer none]

### gfbgraph_photo_get_default_source_uri ()

    const gchar *
    gfbgraph_photo_get_default_source_uri (GFBGraphPhoto *photo);

### gfbgraph_photo_get_default_width ()

    guint
    gfbgraph_photo_get_default_width (GFBGraphPhoto *photo);

### gfbgraph_photo_get_default_height ()

    guint
    gfbgraph_photo_get_default_height (GFBGraphPhoto *photo);

### gfbgraph_photo_get_images ()

    GList *
    gfbgraph_photo_get_images (GFBGraphPhoto *photo);

#### Parameters

photo | a GFBGraphPhoto. |

#### Returns

a GList of GFBGraphPhotoImage with the available photo sizes.

[element-type GFBGraphPhotoImage][transfer none]

### gfbgraph_photo_get_image_hires ()

    const GFBGraphPhotoImage *
    gfbgraph_photo_get_image_hires (GFBGraphPhoto *photo);

#### Parameters

photo | a GFBGraphPhoto. |

#### Returns

a GFBGraphPhotoImage with the higher resolution available of the photo.

[transfer none]

### gfbgraph_photo_get_image_near_width ()

    const GFBGraphPhotoImage *
    gfbgraph_photo_get_image_near_width (GFBGraphPhoto *photo,
                                         guint width);

### gfbgraph_photo_get_image_near_height ()

    const GFBGraphPhotoImage *
    gfbgraph_photo_get_image_near_height (GFBGraphPhoto *photo,
                                          guint height);

## Types and Values

### struct GFBGraphPhoto

    struct GFBGraphPhoto;

### struct GFBGraphPhotoClass

    struct GFBGraphPhotoClass {
            GFBGraphNodeClass parent_class;
    };

### struct GFBGraphPhotoImage

    struct GFBGraphPhotoImage {
            guint  width;
            guint  height;
            gchar *source;
    };

An struct with the information of a image.

## Property Details

### The `“height”` property

      “height”                   guint

The default photo height, up to 720px.

Flags: Read / Write

Default value: 0

### The `“images”` property

      “images”                   gpointer

A list with the available representations of the photo, in differents sizes

Flags: Read / Write

### The `“name”` property

      “name”                     gchar *

The name of the photo given by his owner.

Flags: Read / Write

Default value: ""

### The `“source”` property

      “source”                   gchar *

An URI for the photo, with a maximum width or height of 720px.

Flags: Read / Write

Default value: ""

### The `“width”` property

      “width”                    guint

The default photo width, up to 720px.

Flags: Read / Write

Default value: 0