• Modules
  • ImageOperation
  • Contents

    ImageOperation Class Reference

    The ImageOperation class is a helper class to manipulate images. More...

     #include <ImageOperation>

    Static Public Members

    QString removeImageMetadata ( const QString & sourceFile )
    QString scaleImage ( const QString & sourceFile, qreal scaleFactor, const QString & targetFile = QString() )
    QString tempFilePath ( const QString & sourceFile )

    Detailed Description

    The ImageOperation class is a helper class to manipulate images.

    This class is meant to be used by share plugins. It can be used for:

    Member Function Documentation

    QString ImageOperation::removeImageMetadata ( const QString & sourceFile ) [static]

    Helper method to remove metadata from jpeg files. Only author and location related metadata will be removed. sourceFile is the path to the original file.

    Returns a path to the copy of the image with metadata removed.

    QString ImageOperation::scaleImage ( const QString & sourceFile, qreal scaleFactor, const QString & targetFile = QString() ) [static]

    Scale image sourceFile using scaleFactor. The scaled image is stored to the targetFile or if targetFile is not given, then a temporary file is created for saving.

    The scaleFactor argument must be > 0. This function returns path to the scaled image. Note that if user doesn't specify targetFile the scaled image is stored under temp directory. Nothing guarantees that created file will remain in that diretory forewer so the caller is reponsible of copying file for more permanent storing.

    Returns a path to the scaled image.

    It is also recommended that if the caller doesn't use the scaled file, which is stored to the temp directory later, the caller should remove the file.

    QString ImageOperation::tempFilePath ( const QString & sourceFile ) [static]

    Creates a temporary file from the sourceFile. This function uses sourceFile as a template to create a temp file. Temporary file will be e.g:

    Source file: "/home/nemo/Pictures/img_001.jpg" Temporary file: "/var/tmp/img_001_0.jpg"

    Note that it's caller's responsibility to remove created temp file.