digiKam
Digikam::JPEGUtils::JpegRotator Class Reference

Public Member Functions

bool autoExifTransform ()
 
bool exifTransform (const MetaEngineRotation &matrix)
 
bool exifTransform (TransformAction action)
 
 JpegRotator (const QString &file)
 
void setCurrentOrientation (MetaEngine::ImageOrientation orientation)
 
void setDestinationFile (const QString &dest)
 
void setDocumentName (const QString &documentName)
 
 ~JpegRotator ()
 

Protected Member Functions

bool performJpegTransform (TransformAction action, const QString &src, const QString &dest)
 
void updateMetadata (const QString &fileName, const MetaEngineRotation &matrix)
 

Protected Attributes

QString m_destFile
 
QString m_documentName
 
QString m_file
 
DMetadatam_metadata
 
MetaEngine::ImageOrientation m_orientation
 
QSize m_originalSize
 

Constructor & Destructor Documentation

◆ JpegRotator()

Digikam::JPEGUtils::JpegRotator::JpegRotator ( const QString &  file)
explicit

Create a JpegRotator reading from the given file. Per default, it will replace the file, read the current orientation from the metadata, and use the src file name as documentName.

References Digikam::MetaEngine::getItemOrientation(), Digikam::DMetadata::load(), m_documentName, m_metadata, and m_orientation.

◆ ~JpegRotator()

Digikam::JPEGUtils::JpegRotator::~JpegRotator ( )

Destructor

References m_metadata.

Member Function Documentation

◆ autoExifTransform()

bool Digikam::JPEGUtils::JpegRotator::autoExifTransform ( )

Rotate the JPEG file's content according to the current orientation, resetting the current orientation to normal. The final result of loading the image does not change.

References exifTransform(), and Digikam::MetaEngineRotation::NoTransformation.

Referenced by Digikam::FileActionMngrFileWorker::transform().

◆ exifTransform() [1/2]

◆ exifTransform() [2/2]

bool Digikam::JPEGUtils::JpegRotator::exifTransform ( TransformAction  action)

Rotate the given image by the given TransformAction. The current orientation will be taken into account

References m_orientation, and Digikam::Matrix::matrix().

Referenced by autoExifTransform(), and Digikam::FileActionMngrFileWorker::transform().

◆ performJpegTransform()

bool Digikam::JPEGUtils::JpegRotator::performJpegTransform ( TransformAction  action,
const QString &  src,
const QString &  dest 
)
protected

Referenced by exifTransform().

◆ setCurrentOrientation()

void Digikam::JPEGUtils::JpegRotator::setCurrentOrientation ( MetaEngine::ImageOrientation  orientation)

Per default, the orientation is read from the metadata of the file. You can override this value

References m_orientation.

Referenced by Digikam::FileActionMngrFileWorker::transform().

◆ setDestinationFile()

void Digikam::JPEGUtils::JpegRotator::setDestinationFile ( const QString &  dest)

Set the destination file. By default, the source file will be overwritten by atomic operation if the operation had succeeded.

References m_destFile.

◆ setDocumentName()

void Digikam::JPEGUtils::JpegRotator::setDocumentName ( const QString &  documentName)

Set the Exif document name of the destination file. Default value is the source's file name

References m_documentName.

◆ updateMetadata()

Member Data Documentation

◆ m_destFile

QString Digikam::JPEGUtils::JpegRotator::m_destFile
protected

◆ m_documentName

QString Digikam::JPEGUtils::JpegRotator::m_documentName
protected

Referenced by JpegRotator(), and setDocumentName().

◆ m_file

QString Digikam::JPEGUtils::JpegRotator::m_file
protected

Referenced by exifTransform(), and updateMetadata().

◆ m_metadata

DMetadata* Digikam::JPEGUtils::JpegRotator::m_metadata
protected

◆ m_orientation

MetaEngine::ImageOrientation Digikam::JPEGUtils::JpegRotator::m_orientation
protected

◆ m_originalSize

QSize Digikam::JPEGUtils::JpegRotator::m_originalSize
protected

Referenced by updateMetadata().


The documentation for this class was generated from the following files: