Tile-based rendering results in 1-pixel artefact

Bug #1379100 reported by Martin Spacek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qpdfview
Triaged
Low
Unassigned

Bug Description

Hi Adam,

I recently noticed on one page of my thesis that at a certain resolution, a 1 pixel tall horizontal line is drawn where it shouldn't be. It's the same width as an image above it on the same page. Turning off tile-based rendering gets rid of this problem, and turning it back on restores the problem. This only happens at certain zoom levels, typically higher zoom. I've included a screenshot, the 1 page PDF extracted from the document, and a couple of qpdfview .conf files.

Cheers,

Martin

Revision history for this message
Martin Spacek (mspacek) wrote :
Revision history for this message
Martin Spacek (mspacek) wrote :
Revision history for this message
Martin Spacek (mspacek) wrote :
Revision history for this message
Martin Spacek (mspacek) wrote :
Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Martin,

thanks for taking the time to report this! I can't think of a way the compositing could yield a black line, so I guess this depends on how we request the tiles from the various backends. (At least the Poppler API to render tiles has a warning attached that it was not tested extensively.) I guess the screenshot is created using the Poppler backend? Could you try whether it can also be produced using the Fitz backend? Thanks!

Best regards, Adam.

Changed in qpdfview:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

just tried this here and indeed, the issue is only present using the Poppler backend. So I guess we have to dig into Poppler and how it handles the tiling...

Best regards, Adam.

Changed in qpdfview:
status: Confirmed → Triaged
Revision history for this message
Martin Spacek (mspacek) wrote :

Hi Adam,

Despite using qpdfview on a daily basis for many months now, so far, this particular spot in this particular document is the only time I've seen this happen. So it doesn't seem like a very high priority bug. Btw, I'm on Xubuntu 14.04 with its Poppler 0.24.5.

Changed in qpdfview:
importance: Medium → Low
Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Martin,

since we will probably report this to the Poppler project, could you write a minimal test case to show this using your single-page test document? E.g. use the Poppler Qt frontend and have a minimal "main()" that renders the tile and the complete page and displays both using "QLabel" to show the difference? That would be most helpful.

Best regards, Adam.

Revision history for this message
Martin Spacek (mspacek) wrote :

Hi Adam, sorry for the delay. Sounds like a good plan, but I've never actually written a standalone Qt/C++ program before. That would take a bit of work on my part, and unfortunately I don't have the time right now...

description: updated
Revision history for this message
Adam Reichold (adamreichold) wrote : Re: [Bug 1379100] Re: Tile-based rendering results in 1-pixel artefact

Hello again,

Am 16.10.2014 um 20:32 schrieb Martin Spacek:
> Hi Adam, sorry for the delay. Sounds like a good plan, but I've never
> actually written a standalone Qt/C++ program before. That would take a
> bit of work on my part, and unfortunately I don't have the time right
> now...
>
> ** Description changed:
>
> Hi Adam,
>
> - I recently notice on one page of my thesis that at a certain resolution,
> - a 1 pixel tall horizontal line is drawn where it shouldn't be. It's the
> - same width as an image above it on the same page. Turning off tile-based
> - rendering gets rid of this problem, and turning it back on restores the
> - problem. This only happens at certain zoom levels, typically higher
> - zoom. I've included a screenshot, the 1 page PDF extracted from the
> - document, and a couple of qpdfview .conf files.
> + I recently noticed on one page of my thesis that at a certain
> + resolution, a 1 pixel tall horizontal line is drawn where it shouldn't
> + be. It's the same width as an image above it on the same page. Turning
> + off tile-based rendering gets rid of this problem, and turning it back
> + on restores the problem. This only happens at certain zoom levels,
> + typically higher zoom. I've included a screenshot, the 1 page PDF
> + extracted from the document, and a couple of qpdfview .conf files.
>
> Cheers,
>
> Martin

no problem, I will hopefully be able to whip something up on the weekend...

Best regards, Adam.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

as discussed, I created and will attach a minimal application to reproduce the issue. Could you check that it works on your system and produces the issue? We could then use it to file a bug report with the Poppler project.

Best regards, Adam.

Revision history for this message
Martin Spacek (mspacek) wrote :
Download full text (3.8 KiB)

Adam, I tried building your example, but I get this compile error on make. This is in Xubuntu 14.04 amd64:

mspacek@Escher:~/Desktop/tile-artefact$ qmake
mspacek@Escher:~/Desktop/tile-artefact$ make
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/poppler/qt4 -I/usr/include/poppler -I. -o tile-artefact.o tile-artefact.cpp
tile-artefact.cpp:39:5: warning: identifier ‘constexpr’ is a keyword in C++11 [-Wc++0x-compat]
     constexpr auto r = 96.47;
     ^
tile-artefact.cpp: In function ‘int main(int, char**)’:
tile-artefact.cpp:23:47: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
     const QScopedPointer< Poppler::Document > document{ Poppler::Document::load(arguments.at(1)) };
                                               ^
tile-artefact.cpp:23:98: error: in C++98 ‘document’ must be initialized by constructor, not by ‘{...}’
     const QScopedPointer< Poppler::Document > document{ Poppler::Document::load(arguments.at(1)) };
                                                                                                  ^
tile-artefact.cpp:31:43: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
     const QScopedPointer< Poppler::Page > page{ document->page(0) };
                                           ^
tile-artefact.cpp:31:67: error: in C++98 ‘page’ must be initialized by constructor, not by ‘{...}’
     const QScopedPointer< Poppler::Page > page{ document->page(0) };
                                                                   ^
tile-artefact.cpp:39:5: error: ‘constexpr’ was not declared in this scope
     constexpr auto r = 96.47;
     ^
tile-artefact.cpp:39:15: error: expected ‘;’ before ‘auto’
     constexpr auto r = 96.47;
               ^
tile-artefact.cpp:40:15: error: expected ‘;’ before ‘auto’
     constexpr auto x = 0, y = 531;
               ^
tile-artefact.cpp:41:15: error: expected ‘;’ before ‘auto’
     constexpr auto w = 410, h = 530;
               ^
tile-artefact.cpp:44:5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
     auto image = page->renderToImage(r, r, -1, -1, -1, -1);
     ^
tile-artefact.cpp:44:10: error: ‘image’ does not name a type
     auto image = page->renderToImage(r, r, -1, -1, -1, -1);
          ^
tile-artefact.cpp:46:5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
     auto label = new QLabel();
     ^
tile-artefact.cpp:46:10: error: ‘label’ does not name a type
     auto label = new QLabel();
          ^
tile-artefact.cpp:47:5: error: ‘label’ was not declared in this scope
     label->setWindowTitle("Full page");
     ^
tile-artefact.cpp:48:41: error: ‘image’ was not declared in this scope
     label->setPixmap(QPixmap::fromImage(image));
                                         ^
tile-artefact.cpp:54:33: error: ‘r’ was not declared in this scope
     image = page->renderToImage(r, r, x, y, w, h);
                                 ^
tile-artefact.cpp:54...

Read more...

Revision history for this message
Adam Reichold (adamreichold) wrote :
Revision history for this message
Adam Reichold (adamreichold) wrote :
Download full text (4.3 KiB)

Hello,

I am sorry, I did not point out that I chose to use C++11 and hence ones
needs Qt5 (which understands "CONFIG += c++11" and will adjust the
compiler options) to build this without modifications. I just uploaded
an updated version that modifies the compiler flags directly. Please
retry and sorry for the inconvenience.

Best regards, Adam.

Am 20.10.2014 um 01:58 schrieb Martin Spacek:
> Adam, I tried building your example, but I get this compile error on
> make. This is in Xubuntu 14.04 amd64:
>
> mspacek@Escher:~/Desktop/tile-artefact$ qmake
> mspacek@Escher:~/Desktop/tile-artefact$ make
> g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/poppler/qt4 -I/usr/include/poppler -I. -o tile-artefact.o tile-artefact.cpp
> tile-artefact.cpp:39:5: warning: identifier ‘constexpr’ is a keyword in C++11 [-Wc++0x-compat]
> constexpr auto r = 96.47;
> ^
> tile-artefact.cpp: In function ‘int main(int, char**)’:
> tile-artefact.cpp:23:47: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
> const QScopedPointer< Poppler::Document > document{ Poppler::Document::load(arguments.at(1)) };
> ^
> tile-artefact.cpp:23:98: error: in C++98 ‘document’ must be initialized by constructor, not by ‘{...}’
> const QScopedPointer< Poppler::Document > document{ Poppler::Document::load(arguments.at(1)) };
> ^
> tile-artefact.cpp:31:43: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
> const QScopedPointer< Poppler::Page > page{ document->page(0) };
> ^
> tile-artefact.cpp:31:67: error: in C++98 ‘page’ must be initialized by constructor, not by ‘{...}’
> const QScopedPointer< Poppler::Page > page{ document->page(0) };
> ^
> tile-artefact.cpp:39:5: error: ‘constexpr’ was not declared in this scope
> constexpr auto r = 96.47;
> ^
> tile-artefact.cpp:39:15: error: expected ‘;’ before ‘auto’
> constexpr auto r = 96.47;
> ^
> tile-artefact.cpp:40:15: error: expected ‘;’ before ‘auto’
> constexpr auto x = 0, y = 531;
> ^
> tile-artefact.cpp:41:15: error: expected ‘;’ before ‘auto’
> constexpr auto w = 410, h = 530;
> ^
> tile-artefact.cpp:44:5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
> auto image = page->renderToImage(r, r, -1, -1, -1, -1);
> ^
> tile-artefact.cpp:44:10: error: ‘image’ does not name a type
> auto image = page->renderToImage(r, r, -1, -1, -1, -1);
> ^
> tile-artefact.cpp:46:5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
> auto label = new QLabel();
> ^
> tile-artefact.cpp:46:10: error: ‘label’ does not name a type
> auto label...

Read more...

Revision history for this message
Martin Spacek (mspacek) wrote :

Hi Adam. Sorry for the delay. OK, that works now. I don't see the artifact in the full page window, but I do see it along the top edge of the single tile window, as a 1px tall horizontal black line. Are you sure this doesn't have something to do with tile overlap? I remember you had tiles overlapping for a while, but then you decided they weren't needed and you disabled it.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello Martin,

Am 22.10.2014 um 06:14 schrieb Martin Spacek:
> Hi Adam. Sorry for the delay. OK, that works now. I don't see the
> artifact in the full page window, but I do see it along the top edge of
> the single tile window, as a 1px tall horizontal black line. Are you
> sure this doesn't have something to do with tile overlap? I remember you
> had tiles overlapping for a while, but then you decided they weren't
> needed and you disabled it.

I don't think overlap is at play here since the problem is not there
using a different backend (i.e. MuPDF in this case) and this example
also shows the problem completely without any compositing whatsoever,
i.e. proving that the artefact is part of the tile itself and not a seam
drawn by qpdfview.

Best regards, Adam.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.