https://bugs.kde.org/show_bug.cgi?id=370382
Patrick Holthaus <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |patrick.holthaus@googlemail | |.com --- Comment #15 from Patrick Holthaus <[email protected]> --- (In reply to Keyu Tao from comment #4) > This looks like a bug related to QPixmap scaling and DPI stuffs. In > setPopplerStampAnnotationCustomImage() it calls > Okular::AnnotationUtils::loadStamp() with a rect size calculated from page > size and annotation size. However it looks like this code assumes that 1 pts > = 1 pixel on screen (72 DPI?), then in Okular::AnnotationUtils::loadStamp() > the stamp is scaled too small, and results in a blurry result. > setStampCustomImage() stores the scaled image in PDF, so stamps saved by > Okular would also be blurry in other PDF readers. > > A very dirty workaround is to enforce it to be at least 288 (=72*4) DPI in > setPopplerStampAnnotationCustomImage(): > > diff --git a/generators/poppler/annots.cpp b/generators/poppler/annots.cpp > index 20ad117ea..9d0680919 100644 > --- a/generators/poppler/annots.cpp > +++ b/generators/poppler/annots.cpp > @@ -285,7 +285,7 @@ static void setPopplerStampAnnotationCustomImage(const > Poppler::Page *page, Popp > const QSize size = page->pageSize(); > const QRect rect = > Okular::AnnotationUtils::annotationGeometry(oStampAnnotation, size.width(), > size.height()); > > - QImage image = > Okular::AnnotationUtils::loadStamp(oStampAnnotation->stampIconName(), > qMax(rect.width(), rect.height())).toImage(); > + QImage image = > Okular::AnnotationUtils::loadStamp(oStampAnnotation->stampIconName(), > qMax(rect.width(), rect.height())*4).toImage(); > > if (!image.isNull()) { > pStampAnnotation->setStampCustomImage(image); > > > I don't think it's a nice fix that should be included in upstream, but at > least my signature image looks clear with this workaround. This workaround helps in my case, too. Thanks for posting it - the stamp feature is very useful with image overlays and it didn't work for a while now. Okular 25.08 and 25.08.01 still seem to have that bug. -- You are receiving this mail because: You are the assignee for the bug.
