Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Image

Represents a single image

export
class

Image

Hierarchy

  • Image

Index

Properties

Private _tags

_tags: number[] = []

The tag IDs on the image as returned from the API

readonly
type

{number[]}

memberof

Image

aspectRatio

aspectRatio: number = 0

The aspect ratio of the image

readonly
type

{number}

memberof

Image

created

created: Date = Consts.DEFAULT_DATE

When the image was uploaded to the site

readonly
type

{Date}

memberof

Image

description

description: string = ""

The description of the image on Derpibooru, if any

readonly
type

{string}

memberof

Image

downvotes

downvotes: number = 0

The number of downvotes on the image

readonly
type

{number}

memberof

Image

favorites

favorites: number = 0

The number of favorites on the image

readonly
type

{number}

memberof

Image

fileName

fileName: string = ""

The filename of the original uploaded image

readonly
type

{string}

memberof

Image

firstSeen

firstSeen: Date = Consts.DEFAULT_DATE

When the image was first seen

readonly
type

{Date}

memberof

Image

height

height: number = 0

The height of the image

readonly
type

{number}

memberof

Image

id

id: number = 0

The internal ID of the image

readonly
type

{number}

memberof

Image

isOptimized

isOptimized: boolean = false

Whether the image has finished being optimized by Derpibooru

readonly
type

{boolean}

memberof

Image

isRendered

isRendered: boolean = false

Whether the image has been rendered by Derpibooru

readonly
type

{boolean}

memberof

Image

mimeType

mimeType: string = ""

The MIME type of the image

readonly
type

{string}

memberof

Image

originalFormat

originalFormat: string = ""

The format the image was originally in before being uploaded to Deribooru

readonly
type

{string}

memberof

Image

representations

representations: ImageRepresentations = new ImageRepresentations()

The different possible representations of the image

readonly
type

{ImageRepresentations}

memberof

Image

score

score: number = 0

The total score on the image

readonly
type

{number}

memberof

Image

sha512

sha512: string = ""

The current SHA-512 hash of the image

readonly
type

{string}

memberof

Image

sha512Original

sha512Original: string = ""

The SHA-512 hash of the original image without optimizations

readonly
type

{string}

memberof

Image

source

source: string = ""

The source of the image, if specified by the uploader

readonly
type

{string}

memberof

Image

tagNames

tagNames: string[] = []

Gets a list of tag names on the image

readonly
type

{string[]}

memberof

Image

updated

updated: Date = Consts.DEFAULT_DATE

When the image details were last edited

readonly
type

{Date}

memberof

Image

uploaderID

uploaderID: number = 0

The ID of the user that uploaded the image

Use this instead of (await uploader()).id to save an HTTP request and make the Derpi admins happy

readonly
type

{number}

memberof

Image

uploaderName

uploaderName: string = ""

The name of the user that uploaded the image

Use this instead of (await uploader()).name to save an HTTP request and make the Derpi admins happy

readonly
type

{string}

memberof

Image

upvotes

upvotes: number = 0

The number of upvotes on the image

readonly
type

{number}

memberof

Image

width

width: number = 0

The width of the image

readonly
type

{number}

memberof

Image

Accessors

artistNames

  • get artistNames(): string[]
  • Gets the name of the artist of the image

    Returns null if the image has no artist

    readonly
    type

    {(string[])}

    memberof

    Image

    Returns string[]

tagString

  • get tagString(): string
  • The tags on the image, represented as a comma-separated string for convenience

    readonly
    type

    {string}

    memberof

    Image

    Returns string

Methods

comments

  • Gets the comments on the image

    memberof

    Image

    Parameters

    • page: number | undefined

      The page number of comments to fetch (max appears to be total / 20 for non-logged-in users)

    Returns Promise<ImageComments>

tags

uploader

  • uploader(): Promise<User>
  • Gets the user that uploaded the image

    memberof

    Image

    Returns Promise<User>

    A Promise wrapping the uploader's details

Generated using TypeDoc