bool LoadSaveThread::wasExifRotated(DImg& image)
{
    // Keep in sync with the variant in thumbnailcreator.cpp
    QVariant attribute(image.attribute("exifRotated"));

    return attribute.isValid() && attribute.toBool();
}
int LoadSaveThread::exifOrientation(const DImg& image, const QString& filePath)
{
    QVariant attribute = image.attribute("fromRawEmbeddedPreview");
    return exifOrientation(filePath, DMetadata(image.getMetadata()),
                           image.detectedFormat() == DImg::RAW,
                           (attribute.isValid() && attribute.toBool()));
}