smugmug

package
v0.0.0-...-f15a371 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package smugmug uses the SmugMug API to manipulate photo albums stored on smugmug.com.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	ID    int64 `json:"id"`
	Key   string
	Title string
	URL   string
}

An Album represents a single photo album.

type AlbumInfo

type AlbumInfo struct {
	ID    int64 `json:"id"`
	Key   string
	Title string

	Backprinting      string
	BoutiquePackaging int
	CanRank           bool
	Category          *Category
	Clean             bool
	ColorCorrection   int
	Comments          bool
	Community         struct {
		ID   int64 `json:"id"`
		Name string
	}
	Description string
	EXIF        bool
	External    bool
	FamilyEdit  bool
	Filenames   bool
	FriendEdit  bool
	Geography   bool
	Header      bool
	HideOwner   bool
	Highlight   struct {
		ID   int64 `json:"id"`
		Key  string
		Type string
	}
	ImageCount        int
	InterceptShipping int
	Keywords          string
	Larges            bool
	LastUpdated       string
	NiceName          string
	Originals         bool
	PackagingBranding bool
	Password          string
	PasswordHint      string
	Passworded        bool
	Position          int
	Printable         bool
	Printmark         struct {
		ID   int64 `json:"id"`
		Name string
	}
	ProofDays      int
	Protected      bool
	Public         bool
	Share          bool
	SmugSearchable bool
	SortDirection  bool
	SortMethod     string
	SquareThumbs   bool
	SubCategory    *Category
	Template       struct {
		ID int64 `json:"id"`
	}
	Theme struct {
		ID   int64 `json:"id"`
		Key  string
		Type string
	}
	URL           string
	UnsharpAmount float64
	UnsharpRadius float64
	UnsharpSigma  float64
	Watermark     struct {
		ID   int64 `json:"id"`
		Name string
	}
	Watermarking    bool
	WorldSearchable bool
	X2Larges        bool
	X3Larges        bool
	XLarges         bool
}

An AlbumInfo lists the metadata for an album.

type Category

type Category struct {
	ID   int64 `json:"id"`
	Name string
}

A Category represents a single album category.

type Conn

type Conn struct {
	NickName string
	// contains filtered or unexported fields
}

A Conn represents an authenticated connection to the SmugMug server.

func Login

func Login(email, passwd, apikey string) (*Conn, error)

Login logs into the SmugMug server with the given email address and password. The apikey argument is the API Key for your application. To obtain an API Key, see http://www.smugmug.com/hack/apikeys.

func (*Conn) AddImage

func (c *Conn) AddImage(name string, data []byte, a *Album) (*Image, error)

AddImage uploads a new image to an album. The name is the file name that will be displayed on SmugMug. The data is the raw image data.

func (*Conn) AlbumInfo

func (c *Conn) AlbumInfo(album *Album) (*AlbumInfo, error)

AlbumInfo returns detailed metadata about an album.

func (*Conn) Albums

func (c *Conn) Albums(nick string) ([]*Album, error)

Albums returns the albums for the user identified by the nick name. Use c.NickName for the logged-in user.

func (*Conn) Categories

func (c *Conn) Categories(nick string) ([]*Category, error)

Categories returns the album categories for the user identified by the nick name.

func (*Conn) ChangeAlbum

func (c *Conn) ChangeAlbum(album *Album, args ...string) error

ChangeAlbum changes an album's settings. The argument list is a sequence of key, value pairs. The keys are the names of AlbumInfo struct fields, and the values are string values. For a boolean field, use "0" for false and "1" for true.

Example:

c.ChangeAlbum(a, "Larges", "1", "Title", "My Album")

func (*Conn) ChangeImage

func (c *Conn) ChangeImage(image *Image, args ...string) error

ChangeImage changes an image's settings. The argument list is a sequence of key, value pairs. The keys are the names of ImageInfo struct fields, and the values are string values. For a boolean field, use "0" for false and "1" for true.

Example:

c.ChangeImage(a, "Caption", "me!", "Hidden", "0")

func (*Conn) CreateAlbum

func (c *Conn) CreateAlbum(title string) (*Album, error)

CreateAlbum creates a new album.

func (*Conn) CreateCategory

func (c *Conn) CreateCategory(name string) (*Category, error)

CreateCategory creates a category with the given name.

func (*Conn) DeleteAlbum

func (c *Conn) DeleteAlbum(album *Album) error

DeleteAlbum deletes an album.

func (*Conn) DeleteCategory

func (c *Conn) DeleteCategory(cat *Category) error

DeleteCategory deletes the category.

func (*Conn) DeleteImage

func (c *Conn) DeleteImage(image *Image) error

DeleteImage deletes an image.

func (*Conn) ImageEXIF

func (c *Conn) ImageEXIF(image *Image) (*ImageEXIF, error)

ImageInfo returns the EXIF data for an image.

func (*Conn) ImageInfo

func (c *Conn) ImageInfo(image *Image) (*ImageInfo, error)

ImageInfo returns detailed metadata about an image.

func (*Conn) Images

func (c *Conn) Images(album *Album) ([]*Image, error)

Images returns a list of images for an album.

func (*Conn) ReplaceImage

func (c *Conn) ReplaceImage(name string, data []byte, image *Image) (*Image, error)

ReplaceImage replaces an image. The name is the file name that will be displayed on SmugMug. The data is the raw image data.

type Image

type Image struct {
	ID  int64 `json:"id"`
	Key string
	URL string
}

An Image represents a single SmugMug image.

type ImageEXIF

type ImageEXIF struct {
	ID                     int64 `json:"id"`
	Key                    string
	Aperture               string
	Brightness             string
	CCDWidth               string
	ColorSpace             int
	CompressedBitsPerPixel string
	Contrast               int
	DateTime               string
	DateTimeDigitized      string
	DateTimeOriginal       string
	DigitalZoomRatio       string
	ExposureBiasValue      string
	ExposureMode           int
	ExposureProgram        int
	ExposureTime           string
	Flash                  int
	FocalLength            string
	FocalLengthIn35mmFilm  string
	ISO                    int
	LightSource            int
	Make                   string
	Metering               int
	Model                  string
	Saturation             int
	SensingMethod          int
	Sharpness              int
	SubjectDistance        string
	SubjectDistanceRange   int
	WhiteBalance           int
}

An ImageEXIF lists the EXIF data associated with an image.

type ImageInfo

type ImageInfo struct {
	ID           int64 `json:"id"`
	Key          string
	Album        *Album
	Altitude     int
	Caption      string
	Date         string
	FileName     string
	Duration     int
	Format       string
	Height       int
	Hidden       bool
	Keywords     string
	LargeURL     string
	LastUpdated  string
	Latitude     float64
	LightboxURL  string
	Longitude    float64
	MD5Sum       string
	MediumURL    string
	OriginalURL  string
	Position     int
	Serial       int
	Size         int
	SmallURL     string
	ThumbURL     string
	TinyURL      string
	Video320URL  string
	Video640URL  string
	Video960URL  string
	Video1280URL string
	Video1920URL string
	Width        int
	X2LargeURL   string
	X3LargeURL   string
	XLargeURL    string
}

An ImageInfo lists the metadata for an image.

Directories

Path Synopsis
Smugup uploads a collection of photos to SmugMug.
Smugup uploads a collection of photos to SmugMug.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL