Class: TagLib::FLAC::Picture

Inherits:
Object
  • Object
show all
Defined in:
docs/taglib/flac.rb

Overview

FLAC picture, e.g. for attaching a cover image to a file.

The constants in this class are used for the #type attribute.

Since:

  • 0.5.0

Constant Summary collapse

Other =

Other

Since:

  • 0.5.0

0x00
FileIcon =

32x32 file icon (PNG only)

Since:

  • 0.5.0

0x01
OtherFileIcon =

Since:

  • 0.5.0

0x02
FrontCover =

Since:

  • 0.5.0

0x03
BackCover =

Since:

  • 0.5.0

0x04
LeafletPage =

Since:

  • 0.5.0

0x05
Media =

Since:

  • 0.5.0

0x06
LeadArtist =

Since:

  • 0.5.0

0x07
Artist =

Since:

  • 0.5.0

0x08
Conductor =

Since:

  • 0.5.0

0x09
Band =

Since:

  • 0.5.0

0x0A
Composer =

Since:

  • 0.5.0

0x0B
Lyricist =

Since:

  • 0.5.0

0x0C
RecordingLocation =

Since:

  • 0.5.0

0x0D
DuringRecording =

Since:

  • 0.5.0

0x0E
DuringPerformance =

Since:

  • 0.5.0

0x0F
MovieScreenCapture =

Since:

  • 0.5.0

0x10
ColouredFish =

Since:

  • 0.5.0

0x11
Illustration =

Since:

  • 0.5.0

0x12
BandLogo =

Since:

  • 0.5.0

0x13
PublisherLogo =

Since:

  • 0.5.0

0x14

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePicture

Returns a new instance of Picture.

Since:

  • 0.5.0



184
185
# File 'docs/taglib/flac.rb', line 184

def initialize
end

Instance Attribute Details

#color_depthInteger

Color depth (in bits-per-pixel)

Returns:

  • (Integer)

Since:

  • 0.5.0



208
209
210
# File 'docs/taglib/flac.rb', line 208

def color_depth
  @color_depth
end

#databinary String

Picture data

Be sure to use a binary string when setting this attribute. In Ruby 1.9, this means reading from a file with "b" mode to get a string with encoding BINARY / ASCII-8BIT.

Returns:

  • (binary String)

Since:

  • 0.5.0



221
222
223
# File 'docs/taglib/flac.rb', line 221

def data
  @data
end

#descriptionString

Returns:

  • (String)

Since:

  • 0.5.0



196
197
198
# File 'docs/taglib/flac.rb', line 196

def description
  @description
end

#heightInteger

Picture height in pixels

Returns:

  • (Integer)

Since:

  • 0.5.0



204
205
206
# File 'docs/taglib/flac.rb', line 204

def height
  @height
end

#mime_typeString

MIME type (e.g. "image/png")

Returns:

  • (String)

Since:

  • 0.5.0



193
194
195
# File 'docs/taglib/flac.rb', line 193

def mime_type
  @mime_type
end

#num_colorsInteger

Number of colors (for indexed images)

Returns:

  • (Integer)

Since:

  • 0.5.0



212
213
214
# File 'docs/taglib/flac.rb', line 212

def num_colors
  @num_colors
end

#typePicture constant

Type of the picture, see constants.

Returns:

Since:

  • 0.5.0



189
190
191
# File 'docs/taglib/flac.rb', line 189

def type
  @type
end

#widthInteger

Picture width in pixels

Returns:

  • (Integer)

Since:

  • 0.5.0



200
201
202
# File 'docs/taglib/flac.rb', line 200

def width
  @width
end

Instance Method Details

#parse(rawdata) ⇒ Boolean

Parse the picture data in the FLAC picture block format.

Returns:

  • (Boolean)

    True if the data has been parsed successfully, false otherwise.

Since:

  • 1.0.0



227
228
# File 'docs/taglib/flac.rb', line 227

def parse(rawdata)
end