summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/helper.cpp b/helper.cpp
index 73699f8..30b7604 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -33,14 +33,14 @@ namespace Helper {
do {
read = file.read(data.data(), 4096);
if(read > 0){
- h.addData(data.data(), read);
+ h.addData(data.data(), static_cast<int>(read));
}
} while (read == 4096);
QByteArray res = h.result();
retval = res.toHex().toLower();
}else{
QByteArray data(512, '\0');
- int offset = info.size() / 3;
+ qint64 offset = info.size() / 3;
file.seek(offset);
int numBytes = 512 * 1024;
int readBytes = 0;
@@ -51,7 +51,7 @@ namespace Helper {
}else{
return QString();
}
- h.addData(data.data(), read);
+ h.addData(data.data(), static_cast<int>(read));
} while(readBytes < numBytes);
QByteArray res = h.result();
retval = res.toHex().toLower();
@@ -79,14 +79,13 @@ namespace Helper {
QJsonDocument jDoc = ffpmegData(file);
QJsonObject jObj = jDoc.object();
QJsonValue durationV = jObj["format"].toObject()["duration"];
- int seconds = durationV.toVariant().toDouble();
+ int seconds = static_cast<int>(durationV.toVariant().toDouble());
int interval = seconds / 4;
QImage img1 = snapshot(file, 60);
QImage img2 = snapshot(file, interval * 2);
QImage img3 = snapshot(file, interval * 3);
QImage img4 = snapshot(file, seconds - 60);
QImage retval(640 * 2 + 10, img1.height() * 2 + 10, QImage::Format_ARGB32);
- //retval.fill(Qt::red);
QPainter p(&retval);
p.drawImage(0, 0, img1);
p.drawImage(650, 0, img2);
@@ -174,7 +173,7 @@ namespace Helper {
Duration::Duration() : mHours(0), mMinutes(0), mSeconds(0) {}
- Duration::Duration(qint64 seconds){
+ Duration::Duration(int seconds){
int sec(0), min(0), h(0);
// get hours
h = (seconds / 60 / 60);