- url = url.section('.', 0, -2) + ".THM";
- if (QFile::exists(url) && KdenliveSettings::use_exiftool()) {
- // Read the exif metadata embeded in the THM file
- QProcess p;
- QStringList args;
- args << "-g" << "-args" << url;
- p.start("exiftool", args);
- p.waitForFinished();
- QString res = p.readAllStandardOutput();
- QStringList list = res.split("\n");
- foreach(QString tagline, list) {
- if (tagline.startsWith("-File") || tagline.startsWith("-ExifTool")) continue;
- QString tag = tagline.section(':', 1).simplified();
- if (tag.startsWith("ImageWidth") || tag.startsWith("ImageHeight")) continue;
- if (!tag.section('=', 0, 0).isEmpty() && !tag.section('=', 1).simplified().isEmpty())
- meta.insert(tag.section('=', 0, 0), tag.section('=', 1).simplified());
- }
- }