summaryrefslogtreecommitdiffstats
path: root/src/gvcore
diff options
context:
space:
mode:
authorAlexander Golubev <[email protected]>2024-02-20 23:35:09 +0300
committerAlexander Golubev <[email protected]>2024-02-20 23:35:09 +0300
commit985d8126df0c00fb0a04b57f7a92acd9952d369e (patch)
treec978225a84489583ad28ae19aafd1cfad1730ed3 /src/gvcore
parent53ce37eeca12badf89ebde563a8ec335e0236a02 (diff)
downloadgwenview-985d8126df0c00fb0a04b57f7a92acd9952d369e.tar.gz
gwenview-985d8126df0c00fb0a04b57f7a92acd9952d369e.zip
Use image dimmentions from metadata as a fallback
Signed-off-by: Alexander Golubev <[email protected]>
Diffstat (limited to 'src/gvcore')
-rw-r--r--src/gvcore/filethumbnailviewitem.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gvcore/filethumbnailviewitem.cpp b/src/gvcore/filethumbnailviewitem.cpp
index c3f7e69..be74115 100644
--- a/src/gvcore/filethumbnailviewitem.cpp
+++ b/src/gvcore/filethumbnailviewitem.cpp
@@ -235,11 +235,23 @@ void FileThumbnailViewItem::updateLines() {
mLines.append( new CroppedLine(this, TimeUtils::formatTime(time)) );
}
if (showImageSize) {
- TQString txt;
+ TQSize sz;
if (mImageSize.isValid()) {
- txt=TQString::number(mImageSize.width())+"x"+TQString::number(mImageSize.height());
+ sz=mImageSize;
+ } else {
+ const KFileMetaInfo& info = mFileItem->metaInfo(/*autogen=*/false);
+ if (info.isValid()) {
+ sz = info.value("Dimensions").toSize();
+ }
+ }
+ if (sz.isValid()) {
+ TQString txt = TQString::number(sz.width())+"x"+TQString::number(sz.height());
+ mLines.append( new CroppedLine(this, txt) );
+ } else if ( iconView()->itemTextPos()==TQIconView::Right) {
+ // add empty line for they would nicely alligned;
+ // for text at the bottom it doesn't look that nice
+ mLines.append( new CroppedLine(this, TQString()));
}
- mLines.append( new CroppedLine(this, txt) );
}
if (showFilesize) {
mLines.append( new CroppedLine(this, TDEIO::convertSize(mFileItem->size())) );