KFileMetaData::EmbeddedImageData

Search for usage in LXR

KFileMetaData::EmbeddedImageData Class Reference

#include <KFileMetaData/EmbeddedImageData>

Public Types

enum  ImageType {
  FrontCover = 1 << 0x0, Other = 1 << 0x01, FileIcon = 1 << 0x02, OtherFileIcon = 1 << 0x03,
  BackCover = 1 << 0x04, LeafletPage = 1 << 0x05, Media = 1 << 0x06, LeadArtist = 1 << 0x07,
  Artist = 1 << 0x08, Conductor = 1 << 0x09, Band = 1 << 0x0A, Composer = 1 << 0x0B,
  Lyricist = 1 << 0x0C, RecordingLocation = 1 << 0x0D, DuringRecording = 1 << 0x0E, DuringPerformance = 1 << 0x0F,
  MovieScreenCapture = 1 << 0x10, ColouredFish = 1 << 0x11, Illustration = 1 << 0x12, BandLogo = 1 << 0x13,
  PublisherLogo = 1 << 0x14, Unknown = 1 << 30, AllImages = 0x7fffffff
}
 
typedef QFlags< ImageTypeImageTypes
 

Public Member Functions

QMap< ImageType, QByteArrayimageData (const QString &fileUrl, const EmbeddedImageData::ImageTypes types=FrontCover) const
 
QStringList mimeTypes () const
 
void writeImageData (const QString &fileUrl, QMap< ImageType, QByteArray > &imageData)
 

Detailed Description

The EmbeddedImageData is a class which extracts and writes the images stored in the metadata tags of files as byte arrays.

For example, the front cover art of music albums may be extracted with this class. The byte array will mostly contain jpeg or png files, which can be loaded into e.g. QImage.

Author
Alexander Stippich a.sti[email protected]ppic[email protected][email protected][email protected].net

Definition at line 30 of file embeddedimagedata.h.

Member Typedef Documentation

Stores a combination of ImageType values.

Definition at line 65 of file embeddedimagedata.h.

Member Enumeration Documentation

Member Function Documentation

QMap< EmbeddedImageData::ImageType, QByteArray > EmbeddedImageData::imageData ( const QString fileUrl,
const EmbeddedImageData::ImageTypes  types = FrontCover 
) const

Extracts the images stored in the metadata tags from a file.

By default, the front cover is extracted.

Definition at line 60 of file embeddedimagedata.cpp.

QStringList EmbeddedImageData::mimeTypes ( ) const

Provides a list of mimetypes which are supported for reading of embedded images in e.g.

audio files.

Since
5.52

Definition at line 54 of file embeddedimagedata.cpp.

void EmbeddedImageData::writeImageData ( const QString fileUrl,
QMap< ImageType, QByteArray > &  imageData 
)

Write the images to the metadata tags in a file.

Currently, only the front cover is supported. Mimetype is only correctly set for jpeg and png files.

Since
5.62

Definition at line 75 of file embeddedimagedata.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Apr 20 2021 22:53:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.