mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
chore(CMakeLists.txt): old-style-cast is an error warn now
This commit is contained in:
parent
e249bc3e69
commit
4f30465275
2 changed files with 11 additions and 13 deletions
|
|
@ -46,10 +46,10 @@ if (NOT WIN32)
|
|||
-Wcast-align \
|
||||
-Wconversion \
|
||||
-Werror=return-type \
|
||||
-Werror=old-style-cast \
|
||||
-Wextra \
|
||||
-Wfloat-equal \
|
||||
-Winit-self \
|
||||
-Wold-style-cast \
|
||||
-Woverloaded-virtual \
|
||||
-Wpointer-arith \
|
||||
-Wuninitialized \
|
||||
|
|
|
|||
|
|
@ -78,28 +78,26 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
|
|||
|
||||
int rotation = 0;
|
||||
QExifImageHeader exifImageHeader;
|
||||
if (exifImageHeader.loadFromJpeg(thumbnailPath)) {
|
||||
rotation = (int) exifImageHeader.value(QExifImageHeader::ImageTag::Orientation).toShort();
|
||||
}
|
||||
if (exifImageHeader.loadFromJpeg(thumbnailPath))
|
||||
rotation = static_cast<int>(exifImageHeader.value(QExifImageHeader::ImageTag::Orientation).toShort());
|
||||
|
||||
QImage thumbnail = image.scaled(
|
||||
THUMBNAIL_IMAGE_FILE_WIDTH, THUMBNAIL_IMAGE_FILE_HEIGHT,
|
||||
Qt::KeepAspectRatio, Qt::SmoothTransformation
|
||||
);
|
||||
THUMBNAIL_IMAGE_FILE_WIDTH, THUMBNAIL_IMAGE_FILE_HEIGHT,
|
||||
Qt::KeepAspectRatio, Qt::SmoothTransformation
|
||||
);
|
||||
|
||||
if (rotation != 0) {
|
||||
QTransform transform;
|
||||
if (rotation == 3 || rotation == 4) {
|
||||
if (rotation == 3 || rotation == 4)
|
||||
transform.rotate(180);
|
||||
} else if (rotation == 5 || rotation == 6) {
|
||||
else if (rotation == 5 || rotation == 6)
|
||||
transform.rotate(90);
|
||||
} else if (rotation == 7 || rotation == 8) {
|
||||
else if (rotation == 7 || rotation == 8)
|
||||
transform.rotate(-90);
|
||||
}
|
||||
|
||||
thumbnail = thumbnail.transformed(transform);
|
||||
if (rotation == 2 || rotation == 4 || rotation == 5 || rotation == 7) {
|
||||
if (rotation == 2 || rotation == 4 || rotation == 5 || rotation == 7)
|
||||
thumbnail = thumbnail.mirrored(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
QString uuid = QUuid::createUuid().toString();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue