Giter VIP home page Giter VIP logo

anpv's Introduction

ANPV

Another Nameless Picture Viewer

ANPV Icon

Build Status build result

ANPV Screenshot

Features

ANPV is my attempt to write a fast, responsive and smart image viewer. The primary goal is using it to sort my image collection.

What makes this image viewer different? In short: ANPV decodes images in a smart way:

  • Decoding is not done in the UI thread, therefore user input is not blocked
  • Images are decoded incrementally, if possible (think of progressive JPEGs)
  • The decoding progress is actually visualized
  • Decoding of images can be cancelled
  • Big panorama images are decoded and viewed in an efficient way (think of tiled-pyramide TIFFs)
  • EXIF metadata is honored
  • Embedded thumbnails are used to provide an instant preview of the actual full-scale image, if available

I haven't found an image viewer that follows those simple design principles. Hence I decided to write my own one.

The goal is to keep the UI updated and responsive, rather than using new, fancy decoders that squeeze out every millisecond of decoding time.

One note about TIFF files: There are so many possible subformats of TIFF, that it can be hardly tested all: Tile-based, strip-based, separate, planar, etc. TIFF files can also be multi-layered: The core assumption of ANPV is that one image file contains one and only one picture. Perhaps at different resolutions. Those artificially generated multi-layered TIFF files where each layer contains a different image are not considered to be a real-world use case. Hence, it is undefined how they will be displayed because they are not supported. In a multi-layered TIFF file, the smallest resolution image might be used as a thumbnail preview.

Also, this project is designed as viewer! A viewer does not support editing the images. If you want this, go for Gwenview or Gimp. If you are looking for a "viewer" with a built-in converter and editor, go for XnView. Designing a nice and modern user interface, on the other hand, is not my strength. It is not the focus of this work either. If you want this, have a look at photoqt.

Format Support Status

Feature / Supported file format JFIF TIFF PNG JXL RAWs
Supported compression algorithms ✔️ JPEG ✅ (all encodings supported by libtiff, but none of the "none-Adobe registered codecs", e.g. no JPEG XL) ✔️ PNG ✔️ JPEG / JPEG XL ⚠️ Embedded JPEG previews only!
EXIF Support ✔️ ✅ (not yet for BigTIFF) ⚠️ Should work, never seen it working though ⚠️ Supported by file format, an implementation detail might be missing in ANPV ✔️
Embedded Thumbnails ✅ (retrieved from EXIF metadata) ✔️ (retrieved from EXIF metadata and potentially available image pyramids) ❌ Might work through EXIF, never seen it working though ⚠️ Supported by file format, implemented in ANPV, never seen it working though ✅ (retrieved from EXIF metadata)
ICC color profile handling ✔️ ✔️ ✔️ ✔️ n/a, check the JFIF column
Region-of-interest decode support ✔️ ✔️ (works best for tiled-TIFFs) ❌ (libpng API limitation) ❌ (libjxl API limitation) n/a, check the JFIF column
On-the-fly decode rescaling ✔️ libjpeg-turbo only ✅ Image Pyramid must be included in TIFF file ❌ (libpng API or file format limitation) ❌ (libjxl API limitation) n/a, check the JFIF column
Multi-threaded decoding ✅ (works, might be defeated in practice due to chunked input consumption) n/a, check the JFIF column
Decode cancellation support ✔️ (almost zero-latency cancellation supported) ✔️ (almost zero-latency cancellation supported) ✅ (usually rather quick to respond) ⚠️ (Some decoding phases cannot be canceled, or it may take time until cancellation occurs due to API limitation) n/a, check the JFIF column
Decode progress known ⚠️ (progress is guessed and may be inaccurate) ✔️ (Progress works reliably) ✔️ (Progress works reliably) ✔️ (Progress works reliably) n/a, check the JFIF column

Credits

Special thanks to Martin Pietsch, the author of the simpleimagebrowser project, for demonstrating how to customize QListView and QAbstractListModel to make them "cluster" the individual items into sections - just as we know from KDE Dolphin or KCategorizedView, but with a much simpler codebase.

anpv's People

Contributors

derselbst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

anpv's Issues

Race conditions

  • SortedImageModel::clear should be synchronous (otherwise paint events may try to paint already deleted items, resulting in invalid indices, assertions, etc)
  • Changing the sort order while directory still loading
  • Removing items from model may cause event handling in proxy model to be messed up
 	Qt6Cored.dll!qt_message_fatal(QtMsgType __formal, const QMessageLogContext & context, const QString & message) Line 1872	C++
 	Qt6Cored.dll!QMessageLogger::fatal(const char * msg, ...) Line 882	C++
 	Qt6Cored.dll!qt_assert_x(const char * where, const char * what, const char * file, int line) Line 3312	C++
 	Qt6Cored.dll!QList<int>::remove(__int64 i, __int64 n) Line 803	C++
>	Qt6Cored.dll!QSortFilterProxyModelPrivate::source_items_removed(const QModelIndex & source_parent, int start, int end, Qt::Orientation orient) Line 1141	C++
 	Qt6Cored.dll!QSortFilterProxyModelPrivate::_q_sourceRowsRemoved(const QModelIndex & source_parent, int start, int end) Line 1757	C++
 	Qt6Cored.dll!QSortFilterProxyModel::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 263	C++
 	Qt6Cored.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 627	C++
 	Qt6Cored.dll!QObject::event(QEvent * e) Line 1356	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3337	C++
 	Qt6Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3288	C++
 	Qt6Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1068	C++
 	Qt6Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 1485	C++
 	Qt6Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1848	C++
 	Qt6Cored.dll!QEventDispatcherWin32::sendPostedEvents() Line 906	C++
 	Qt6Guid.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 80	C++
 	Qt6Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 228	C++

where
start == end == 11 originally, then end is being changed because

    if (end >= source_to_proxy.size())
        end = source_to_proxy.size() - 1;

but is already deleted, leading to end being garbage value, possibly smaller than start, leading to negative integers being passed to qlist.remove()

Image selection might be lost by accident without notice

Suppose the user opens a single image and swipes through other images in that directory while selecting images. Move, hardlink or delete operations are only affecting the image currently displayed. Hence, if the user hits ESC for switching over to thumbnail view, the ImageSectionDataContainer with all the selected images will be destroyed and the selection is lost without notice.

Two problems must be addressed:

a) Notification of loss of selection must be done in DocumentView as well.
b) If somehow must be possible to apply a file operation to all the checked files from the DocumentView.

Possible solutions for b):

  1. The ImageSectionDataContainer of the currently active DocumentView with all its images should initialize the model of the ThumbnailView.

Pro: loading times in large directories can be reduced.
Con: Sorting of that DataContainer will not match the previously saved sorting of the ThumbnailViewer model and must be either overriden or expensively re-sorted.

  1. Change the DocumentView to apply FileOperations to all selected images

Pro: Easy to implement
Con: Unintuitive, there might be non-visible side-effects as the user doesn't see which images were selected.

  1. Disable selecting images in DocumentView if DataSectionContainer mismatches the DataContainer of the Model.

Pro: Intuitive
Con: Hard to implement, considering changing directories, closing and reopening of the ThumbnailView window, etc.

Cancel background task when removing image from model

Removing images from the model should also cancel any pending or ongoing background task for that image. Basically, it should do what SortedImageModel::Impl::clear() does, but it isn't called when F5 pressed or directory is changed...

The symptom of this problem is spamming the following warning:

qInfo() << "onBackgroundTaskStarted: image surprisingly gone before background task could be started?!";

Performance issues when moving files

Two issues must be addressed:

  1. Thumbnails are reevaluated when files are about to be removed:
(gdb) bt
#0  0x00007ffff5e07c42 in QUnicodeTables::convertCase<QString const> (str=..., which=QUnicodeTables::LowerCase) at ../src/corelib/text/qstring.cpp:6517
#1  0x00007ffff5df9490 in QString::toLower_helper (str=...) at ../src/corelib/text/qstring.cpp:6540
#2  0x0000000000547083 in QString::toLower() const & (this=0x7fffffffa060) at /usr/include/qt6/QtCore/qstring.h:607
#3  0x000000000054161f in Image::Impl::hasEquallyNamedFile (this=0x613000035640, wantedSuffix=...) at /ANPV/src/logic/Image.cpp:73
#4  0x000000000053aaf0 in Image::hasEquallyNamedTiff (this=0x60400049b910) at /ANPV/src/logic/Image.cpp:423
#5  0x000000000053ad5b in Image::hideIfNonRawAvailable (this=0x60400049b910, viewFlags=17) at /ANPV/src/logic/Image.cpp:430
#6  0x000000000059d379 in SortedImageModel::flags (this=0x6030001fcd80, item=...) at /ANPV/src/models/SortedImageModel.cpp:330
#7  0x000000000059ca86 in SortedImageModel::flags (this=0x6030001fcd80, index=...) at /ANPV/src/models/SortedImageModel.cpp:305
#8  0x00007ffff5f03464 in QSortFilterProxyModel::flags (this=<optimized out>, index=...) at ../src/corelib/itemmodels/qsortfilterproxymodel.cpp:2541
#9  0x00007ffff5d245fc in QModelIndex::flags (this=<optimized out>, this=<optimized out>) at include/QtCore/../../../src/corelib/itemmodels/qabstractitemmodel.h:535
#10 operator() (column=0, row=176, __closure=<synthetic pointer>) at ../src/corelib/itemmodels/qitemselectionmodel.cpp:1531
#11 QItemSelectionModel::isRowSelected (this=<optimized out>, row=176, parent=...) at ../src/corelib/itemmodels/qitemselectionmodel.cpp:1550
#12 0x00007ffff5d27d00 in QItemSelectionModel::selectedRows (this=0x60200007c510, column=0) at ../src/corelib/itemmodels/qitemselectionmodel.cpp:1806
#13 0x00000000006b9ca4 in ThumbnailListView::selectedImages (this=0x6040000ad850) at /ANPV/src/widgets/ThumbnailListView.cpp:423
#14 0x00000000006a4ca2 in MainWindow::Impl::onThumbnailListViewSelectionChanged (this=0x60d0000160e0) at /ANPV/src/widgets/MainWindow.cpp:543
#15 0x00000000006614a6 in MainWindow::MainWindow(QSplashScreen*)::$_13::operator()(QItemSelection const&, QItemSelection const&) const (this=0x60300024b7b0, selected=..., deselected=...)
    at /ANPV/src/widgets/MainWindow.cpp:640
#16 0x00000000006613c7 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<QItemSelection const&, QItemSelection const&>, void, MainWindow::MainWindow(QSplashScreen*)::$_13>::call(MainWindow::MainWindow(QSplashScreen*)::$_13&, void**) (f=..., arg=0x7fffffffba50) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:146
#17 0x0000000000661281 in QtPrivate::Functor<MainWindow::MainWindow(QSplashScreen*)::$_13, 2>::call<QtPrivate::List<QItemSelection const&, QItemSelection const&>, void>(MainWindow::MainWindow(QSplashScreen*)::$_13&, void*, void**) (f=..., arg=0x7fffffffba50) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:256
#18 0x0000000000661221 in QtPrivate::QFunctorSlotObject<MainWindow::MainWindow(QSplashScreen*)::$_13, 2, QtPrivate::List<QItemSelection const&, QItemSelection const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x60300024b7a0, r=0x6040000731d0, a=0x7fffffffba50, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:420
#19 0x00007ffff5d84088 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at include/QtCore/../../../src/corelib/kernel/qobjectdefs_impl.h:375
#20 doActivate<false> (sender=0x60200007c510, signal_index=3, argv=0x7fffffffba50) at ../src/corelib/kernel/qobject.cpp:3908
#21 0x00007ffff5d26a10 in QItemSelectionModel::selectionChanged (this=this@entry=0x60200007c510, _t1=..., _t2=...) at src/corelib/Core_autogen/include/moc_qitemselectionmodel.cpp:474
#22 0x00007ffff5d2d889 in QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved (end=59, start=<optimized out>, parent=..., this=0x61200004ec40) at ../src/corelib/itemmodels/qitemselectionmodel.cpp:757
#23 QItemSelectionModel::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at src/corelib/Core_autogen/include/moc_qitemselectionmodel.cpp:270
#24 0x00007ffff5d84443 in doActivate<false> (sender=0x60200006a610, signal_index=14, argv=0x7fffffffbd50) at ../src/corelib/kernel/qobject.cpp:3920
#25 0x00007ffff5d1615e in QAbstractItemModel::rowsAboutToBeRemoved (this=<optimized out>, _t1=..., _t2=<optimized out>, _t3=<optimized out>, _t4=...) at src/corelib/Core_autogen/include/moc_qabstractitemmodel.cpp:601
#26 0x00007ffff5d0c099 in QAbstractItemModel::beginRemoveRows (this=0x60200006a610, parent=..., first=59, last=59) at ../src/corelib/itemmodels/qabstractitemmodel.cpp:2967
#27 0x00007ffff5efb02a in QSortFilterProxyModelPrivate::remove_proxy_interval (this=0x613000014400, this=0x613000014400, emit_signal=true, orient=Qt::Vertical, proxy_parent=..., proxy_end=59, proxy_start=59, proxy_to_source=..., 
    source_to_proxy=...) at ../src/corelib/itemmodels/qsortfilterproxymodel.cpp:825
#28 QSortFilterProxyModelPrivate::remove_source_items (this=0x613000014400, source_to_proxy=..., proxy_to_source=..., source_items=..., source_parent=..., orient=Qt::Vertical, emit_signal=true)
    at ../src/corelib/itemmodels/qsortfilterproxymodel.cpp:806
#29 0x00007ffff5efb402 in QSortFilterProxyModelPrivate::source_items_about_to_be_removed (this=0x613000014400, source_parent=..., start=59, end=59, orient=Qt::Vertical) at ../src/corelib/itemmodels/qsortfilterproxymodel.cpp:1110
#30 0x00007ffff5d84443 in doActivate<false> (sender=0x6030001fcd80, signal_index=14, argv=0x7fffffffc060) at ../src/corelib/kernel/qobject.cpp:3920
#31 0x00007ffff5d1615e in QAbstractItemModel::rowsAboutToBeRemoved (this=<optimized out>, _t1=..., _t2=<optimized out>, _t3=<optimized out>, _t4=...) at src/corelib/Core_autogen/include/moc_qabstractitemmodel.cpp:601
#32 0x00007ffff5d0c099 in QAbstractItemModel::beginRemoveRows (this=0x6030001fcd80, parent=..., first=59, last=59) at ../src/corelib/itemmodels/qabstractitemmodel.cpp:2967
#33 0x00000000005a0266 in SortedImageModel::removeRows (this=0x6030001fcd80, row=59, count=1, parent=...) at /ANPV/src/models/SortedImageModel.cpp:533
#34 0x0000000000718cb6 in ImageSectionDataContainer::removeImageItem(QFileInfo const&)::$_1::operator()() const (this=0x603006a558d0) at /ANPV/src/models/ImageSectionDataContainer.cpp:310
#35 0x0000000000718997 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, ImageSectionDataContainer::removeImageItem(QFileInfo const&)::$_1>::call(ImageSectionDataContainer::removeImageItem(QFileInfo const&)::$_1&, void**) (f=..., arg=0x60c000aa30c8) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:146
#36 0x00000000007188c1 in QtPrivate::Functor<ImageSectionDataContainer::removeImageItem(QFileInfo const&)::$_1, 0>::call<QtPrivate::List<>, void>(ImageSectionDataContainer::removeImageItem(QFileInfo const&)::$_1&, void*, void**)
    (f=..., arg=0x60c000aa30c8) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:256
#37 0x0000000000718861 in QtPrivate::QFunctorSlotObject<ImageSectionDataContainer::removeImageItem(QFileInfo const&)::$_1, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, 
    this_=0x603006a558c0, r=0x6030001fcd80, a=0x60c000aa30c8, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:420
#38 0x00007ffff5d769d0 in QObject::event (this=0x6030001fcd80, e=0x60c000aa3080) at ../src/corelib/kernel/qobject.cpp:1365
#39 0x00007ffff7997a42 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x6030001fcd80, e=0x60c000aa3080) at ../src/widgets/kernel/qapplication.cpp:3405
#40 0x00007ffff5d323da in QCoreApplication::notifyInternal2 (receiver=0x6030001fcd80, event=0x60c000aa3080) at ../src/corelib/kernel/qcoreapplication.cpp:1063
#41 0x00007ffff5d325bc in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x60f000000040) at ../src/corelib/kernel/qcoreapplication.cpp:1830
#42 0x00007ffff5f1b7c3 in postEventSourceDispatch (s=0x60b000010a50) at ../src/corelib/kernel/qeventdispatcher_glib.cpp:279
#43 0x00007ffff3a4682b in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--q
  1. Directory Worker keeps adding files to the Model while they are about to being removed from the current directory

QThreadPool keeps running decoder after QApplication isAboutToExit()

 	Qt6Cored.dll!qt_message_fatal(QtMsgType __formal, const QMessageLogContext & context, const QString & message) Line 1872	C++
 	Qt6Cored.dll!QMessageLogger::fatal(const char * msg, ...) Line 882	C++
 	Qt6Guid.dll!qt_pixmap_thread_test() Line 84	C++
 	Qt6Guid.dll!QPixmap::QPixmap() Line 113	C++
 	anpv.exe!Image::setThumbnail(QImage thumb) Line 183	C++
>	anpv.exe!SmartImageDecoder::init() Line 233	C++
 	anpv.exe!SmartImageDecoder::decode(DecodingState targetState, QSize desiredResolution, QRect roiRect) Line 361	C++
 	anpv.exe!SmartImageDecoder::run() Line 327	C++
 	Qt6Cored.dll!QThreadPoolThread::run() Line 100	C++
 	Qt6Cored.dll!QThreadPrivate::start(void * arg) Line 328	C++
 	kernel32.dll!00007ffcb7137614()	Unknown
 	ntdll.dll!00007ffcb8aa26a1()	Unknown

Memory leak

SmartImageDecoder::Impl::encodedInputFile should be freed in SmartImageDecoder::close.

Some destructors are never called

Figure out why those destructors are not called

  • ~SmartImageDecoder, because ~Image is deleted via deleteLater(), but the deleteLater event is enqueued when ~SortedImageModel is called, and this is just getting destroyed when ~ANPV, but at this time, the event loop of the QApplication has been exited already, therefore nothing will ever delete the Image....
  • ~SortedImageModel (resolved)

Error Message doesn't recover itself

When an Error message appears in the DocumentView and the error recovers in subsequent decodings (e.g. out-of-memory), the message stays visible rather than disappearing. (Is that a bug or feature?)

Race condition while decoding

The UI thread may call SmartImageDecoder::reset while decoding is still ongoing in the threadpool:

Thread 1 "anpv" hit Breakpoint 2, SmartImageDecoder::assertNotDecoding (this=<optimized out>) at /home/tom/EigeneProgramme/ANPV/src/decoders/SmartImageDecoder.cpp:401
401             throw std::logic_error("Operation not allowed, decoding is still ongoing.");
(gdb) bt
#0  SmartImageDecoder::assertNotDecoding (this=<optimized out>) at /home/tom/EigeneProgramme/ANPV/src/decoders/SmartImageDecoder.cpp:401
#1  0x0000000000470721 in SmartImageDecoder::reset (this=0x7fffc541d580) at /home/tom/EigeneProgramme/ANPV/src/decoders/SmartImageDecoder.cpp:326
#2  0x000000000045504c in DocumentView::Impl::clearScene (this=0xba02b0) at /home/tom/EigeneProgramme/ANPV/src/widgets/DocumentView.cpp:103
#3  0x000000000045211f in DocumentView::loadImage (this=0xbd2700, dec=...) at /home/tom/EigeneProgramme/ANPV/src/widgets/DocumentView.cpp:748
#4  DocumentView::loadImage (this=0xbd2700, e={...}) at /home/tom/EigeneProgramme/ANPV/src/widgets/DocumentView.cpp:725
#5  0x00000000004569c2 in DocumentView::Impl::goTo (this=0xba02b0, i=i@entry=-1) at /home/tom/EigeneProgramme/ANPV/src/widgets/DocumentView.cpp:336
#6  0x0000000000456b54 in DocumentView::Impl::createActions()::{lambda()#2}::operator()() const (this=<optimized out>) at /home/tom/EigeneProgramme/ANPV/src/widgets/DocumentView.cpp:371
#7  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, DocumentView::Impl::createActions()::{lambda()#2}>::call(DocumentView::Impl::createActions()::{lambda()#2}&, void**) (f=..., arg=<optimized out>)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:146
#8  QtPrivate::Functor<DocumentView::Impl::createActions()::{lambda()#2}, 0>::call<QtPrivate::List<>, void>(DocumentView::Impl::createActions()::{lambda()#2}&, void*, void**) (f=..., arg=<optimized out>)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:256
#9  QtPrivate::QFunctorSlotObject<DocumentView::Impl::createActions()::{lambda()#2}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=<optimized out>, this_=<optimized out>, 
    r=0x0, a=0xa30530, ret=0x1) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:420

Nasty event ping pong causing flickering images

Thread 1 "anpv" hit Breakpoint 1, DocumentView::Impl::startImageDecoding (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:236
236             if(!this->currentImageDecoder)
(gdb) bt
#0  DocumentView::Impl::startImageDecoding (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:236
#1  0x000000000050b188 in DocumentView::Impl::onFOVChanged (this=0x612000a07140)
    at /anpv/src/widgets/DocumentView.cpp:275
#2  0x00000000004fe4ec in operator() (__closure=0x603000ef7860) at /anpv/src/widgets/DocumentView.cpp:587
#3  0x0000000000505c9c in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, DocumentView::DocumentView(QWidget*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:163
#4  0x0000000000505a51 in QtPrivate::Functor<DocumentView::DocumentView(QWidget*)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:277
#5  0x00000000005058e2 in QtPrivate::QFunctorSlotObject<DocumentView::DocumentView(QWidget*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, 
    this_=0x603000ef7850, r=0x604000cf19d0, a=0x7ffe24169830, ret=0x0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:444
#6  0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#7  0x00007f85499a2cea in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt6Core.so.6
#8  0x00007f854998cbb6 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#9  0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /lib64/libQt6Widgets.so.6
#10 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#11 0x00007f8549a99fc9 in QTimerInfoList::activateTimers() () from /lib64/libQt6Core.so.6
#12 0x00007f8549b59c04 in ?? () from /lib64/libQt6Core.so.6
#13 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#14 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#15 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#16 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /lib64/libQt6Core.so.6
#17 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#18 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#19 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 3, DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=3) at /anpv/src/widgets/DocumentView.cpp:760
760         auto& dec = d->currentImageDecoder;
(gdb) bt
#0  DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=3)
    at /anpv/src/widgets/DocumentView.cpp:760
#1  0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x7ffe24168b00)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#2  0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x7ffe24168b00)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#3  0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x7ffe24168b00, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#4  0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#5  0x00000000004e5ac4 in Image::decodingStateChanged (this=0x6030005b4c80, _t1=0x6030005b4c80, _t2=2, _t3=3)
    at /anpv/build2/anpv-lib_autogen/PUYCVECU7E/moc_Image.cpp:234
#6  0x000000000045f1e7 in Image::setDecodingState (this=0x6030005b4c80, state=Metadata)
    at /anpv/src/logic/Image.cpp:425
#7  0x0000000000592231 in SmartImageDecoder::setDecodingState (this=0x6030005b5640, state=Metadata)
    at /anpv/src/decoders/SmartImageDecoder.cpp:141
#8  0x0000000000598356 in SmartImageDecoder::releaseFullImage (this=0x6030005b5640)
    at /anpv/src/decoders/SmartImageDecoder.cpp:465
#9  0x00000000005981b4 in SmartImageDecoder::reset (this=0x6030005b5640)
    at /anpv/src/decoders/SmartImageDecoder.cpp:454
#10 0x000000000059537a in SmartImageDecoder::decodeAsync (this=0x6030005b5640, targetState=PreviewImage, 
    prio=Priority::Important, desiredResolution=..., roiRect=...)
    at /anpv/src/decoders/SmartImageDecoder.cpp:295
#11 0x000000000050abd2 in DocumentView::Impl::startImageDecoding (this=0x612000a07140)
    at /anpv/src/widgets/DocumentView.cpp:267
#12 0x000000000050b188 in DocumentView::Impl::onFOVChanged (this=0x612000a07140)
    at /anpv/src/widgets/DocumentView.cpp:275
#13 0x00000000004fe4ec in operator() (__closure=0x603000ef7860) at /anpv/src/widgets/DocumentView.cpp:587
#14 0x0000000000505c9c in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, DocumentView::DocumentView(QWidget*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:163
#15 0x0000000000505a51 in QtPrivate::Functor<DocumentView::DocumentView(QWidget*)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:277
#16 0x00000000005058e2 in QtPrivate::QFunctorSlotObject<DocumentView::DocumentView(QWidget*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, 
    this_=0x603000ef7850, r=0x604000cf19d0, a=0x7ffe24169830, ret=0x0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:444
#17 0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#18 0x00007f85499a2cea in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt6Core.so.6
#19 0x00007f854998cbb6 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#20 0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /lib64/libQt6Widgets.so.6
#21 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#22 0x00007f8549a99fc9 in QTimerInfoList::activateTimers() () from /lib64/libQt6Core.so.6
#23 0x00007f8549b59c04 in ?? () from /lib64/libQt6Core.so.6
#24 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#25 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 2, DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
120             QTransform newTransform = q->viewportTransform();
(gdb) bt
#0  DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
#1  0x0000000000503d35 in DocumentView::showImage (this=0x604000cf19d0, img=...) at /anpv/src/widgets/DocumentView.cpp:922
#2  0x000000000050175d in DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=3) at /anpv/src/widgets/DocumentView.cpp:774
#3  0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x7ffe24168b00)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#4  0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x7ffe24168b00)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#5  0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x7ffe24168b00, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#6  0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#7  0x00000000004e5ac4 in Image::decodingStateChanged (this=0x6030005b4c80, _t1=0x6030005b4c80, _t2=2, _t3=3) at /anpv/build2/anpv-lib_autogen/PUYCVECU7E/moc_Image.cpp:234
#8  0x000000000045f1e7 in Image::setDecodingState (this=0x6030005b4c80, state=Metadata) at /anpv/src/logic/Image.cpp:425
#9  0x0000000000592231 in SmartImageDecoder::setDecodingState (this=0x6030005b5640, state=Metadata) at /anpv/src/decoders/SmartImageDecoder.cpp:141
#10 0x0000000000598356 in SmartImageDecoder::releaseFullImage (this=0x6030005b5640) at /anpv/src/decoders/SmartImageDecoder.cpp:465
#11 0x00000000005981b4 in SmartImageDecoder::reset (this=0x6030005b5640) at /anpv/src/decoders/SmartImageDecoder.cpp:454
#12 0x000000000059537a in SmartImageDecoder::decodeAsync (this=0x6030005b5640, targetState=PreviewImage, prio=Priority::Important, desiredResolution=..., roiRect=...) at /anpv/src/decoders/SmartImageDecoder.cpp:295
#13 0x000000000050abd2 in DocumentView::Impl::startImageDecoding (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:267
#14 0x000000000050b188 in DocumentView::Impl::onFOVChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:275
#15 0x00000000004fe4ec in operator() (__closure=0x603000ef7860) at /anpv/src/widgets/DocumentView.cpp:587
#16 0x0000000000505c9c in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, DocumentView::DocumentView(QWidget*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:163
#17 0x0000000000505a51 in QtPrivate::Functor<DocumentView::DocumentView(QWidget*)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:277
#18 0x00000000005058e2 in QtPrivate::QFunctorSlotObject<DocumentView::DocumentView(QWidget*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, 
    this_=0x603000ef7850, r=0x604000cf19d0, a=0x7ffe24169830, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:444
#19 0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#20 0x00007f85499a2cea in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt6Core.so.6
#21 0x00007f854998cbb6 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#22 0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#23 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#24 0x00007f8549a99fc9 in QTimerInfoList::activateTimers() () from /lib64/libQt6Core.so.6
#25 0x00007f8549b59c04 in ?? () from /lib64/libQt6Core.so.6
#26 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#27 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#28 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#29 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#30 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#31 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#32 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 3, DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=1, oldState=2) at /anpv/src/widgets/DocumentView.cpp:760
760         auto& dec = d->currentImageDecoder;
(gdb) bt
#0  DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=1, oldState=2) at /anpv/src/widgets/DocumentView.cpp:760
#1  0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x7ffe24168b90)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#2  0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x7ffe24168b90)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#3  0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x7ffe24168b90, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#4  0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#5  0x00000000004e5ac4 in Image::decodingStateChanged (this=0x6030005b4c80, _t1=0x6030005b4c80, _t2=1, _t3=2) at /anpv/build2/anpv-lib_autogen/PUYCVECU7E/moc_Image.cpp:234
#6  0x000000000045f1e7 in Image::setDecodingState (this=0x6030005b4c80, state=Ready) at /anpv/src/logic/Image.cpp:425
#7  0x0000000000592231 in SmartImageDecoder::setDecodingState (this=0x6030005b5640, state=Ready) at /anpv/src/decoders/SmartImageDecoder.cpp:141
#8  0x00000000005981c8 in SmartImageDecoder::reset (this=0x6030005b5640) at /anpv/src/decoders/SmartImageDecoder.cpp:455
#9  0x000000000059537a in SmartImageDecoder::decodeAsync (this=0x6030005b5640, targetState=PreviewImage, prio=Priority::Important, desiredResolution=..., roiRect=...) at /anpv/src/decoders/SmartImageDecoder.cpp:295
#10 0x000000000050abd2 in DocumentView::Impl::startImageDecoding (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:267
#11 0x000000000050b188 in DocumentView::Impl::onFOVChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:275
#12 0x00000000004fe4ec in operator() (__closure=0x603000ef7860) at /anpv/src/widgets/DocumentView.cpp:587
#13 0x0000000000505c9c in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, DocumentView::DocumentView(QWidget*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:163
#14 0x0000000000505a51 in QtPrivate::Functor<DocumentView::DocumentView(QWidget*)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:277
#15 0x00000000005058e2 in QtPrivate::QFunctorSlotObject<DocumentView::DocumentView(QWidget*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, 
    this_=0x603000ef7850, r=0x604000cf19d0, a=0x7ffe24169830, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:444
#16 0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#17 0x00007f85499a2cea in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt6Core.so.6
#18 0x00007f854998cbb6 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#19 0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#20 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#21 0x00007f8549a99fc9 in QTimerInfoList::activateTimers() () from /lib64/libQt6Core.so.6
#22 0x00007f8549b59c04 in ?? () from /lib64/libQt6Core.so.6
#23 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#24 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#25 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#26 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#27 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#28 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#29 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.
startImageDecoding(): desiredRes:  QSize(921, 1330)  | visPixRect:  QRect(0,0 1054x1522)

Thread 1 "anpv" hit Breakpoint 3, DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=1) at /anpv/src/widgets/DocumentView.cpp:760
760         auto& dec = d->currentImageDecoder;
(gdb) bt
#0  DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=1) at /anpv/src/widgets/DocumentView.cpp:760
#1  0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#2  0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#3  0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x606000c353c0, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#4  0x00007f854998cc90 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#5  0x00007f854a843942 in QFrame::event(QEvent*) () from /lib64/libQt6Widgets.so.6
#6  0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#7  0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#8  0x00007f854994ee5d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#9  0x00007f8549b59c63 in ?? () from /lib64/libQt6Core.so.6
#10 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#11 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#12 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#13 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#14 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#15 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#16 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 2, DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
120             QTransform newTransform = q->viewportTransform();
(gdb) bt
#0  DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
#1  0x00000000004ffc00 in DocumentView::scrollContentsBy (this=0x604000cf19d0, dx=0, dy=-94) at /anpv/src/widgets/DocumentView.cpp:656
#2  0x00007f854a8422af in ?? () from /lib64/libQt6Widgets.so.6
#3  0x00007f854999c9db in ?? () from /lib64/libQt6Core.so.6
#4  0x00007f854a872e1e in QAbstractSlider::valueChanged(int) () from /lib64/libQt6Widgets.so.6
#5  0x00007f854a875bcb in QAbstractSlider::setValue(int) () from /lib64/libQt6Widgets.so.6
#6  0x00007f854ab0151d in QGraphicsView::centerOn(QPointF const&) () from /lib64/libQt6Widgets.so.6
#7  0x00007f854ab099eb in QGraphicsView::setTransform(QTransform const&, bool) () from /lib64/libQt6Widgets.so.6
#8  0x00007f854ab09b40 in QGraphicsView::resetTransform() () from /lib64/libQt6Widgets.so.6
#9  0x00000000005087e5 in DocumentView::Impl::alignImageAccordingToViewMode (this=0x612000a07140, img=..., viewMode=ViewMode::Fit) at /anpv/src/widgets/DocumentView.cpp:150
#10 0x00000000005033cf in DocumentView::showImage (this=0x604000cf19d0, img=...) at /anpv/src/widgets/DocumentView.cpp:878
#11 0x000000000050175d in DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=1) at /anpv/src/widgets/DocumentView.cpp:774
#12 0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#13 0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#14 0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x606000c353c0, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#15 0x00007f854998cc90 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#16 0x00007f854a843942 in QFrame::event(QEvent*) () from /lib64/libQt6Widgets.so.6
#17 0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#18 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#19 0x00007f854994ee5d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#20 0x00007f8549b59c63 in ?? () from /lib64/libQt6Core.so.6
#21 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#22 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#23 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#24 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#25 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#26 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#27 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 2, DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
120             QTransform newTransform = q->viewportTransform();
(gdb) bt
#0  DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
#1  0x00000000004ffc00 in DocumentView::scrollContentsBy (this=0x604000cf19d0, dx=0, dy=94) at /anpv/src/widgets/DocumentView.cpp:656
#2  0x00007f854a8422af in ?? () from /lib64/libQt6Widgets.so.6
#3  0x00007f854999c9db in ?? () from /lib64/libQt6Core.so.6
#4  0x00007f854a872e1e in QAbstractSlider::valueChanged(int) () from /lib64/libQt6Widgets.so.6
#5  0x00007f854a875bcb in QAbstractSlider::setValue(int) () from /lib64/libQt6Widgets.so.6
#6  0x00007f854aafbefe in QGraphicsViewPrivate::recalculateContentSize() () from /lib64/libQt6Widgets.so.6
#7  0x00007f854ab099dd in QGraphicsView::setTransform(QTransform const&, bool) () from /lib64/libQt6Widgets.so.6
#8  0x00007f854ab00f33 in QGraphicsView::scale(double, double) () from /lib64/libQt6Widgets.so.6
#9  0x00007f854ab0173d in QGraphicsView::fitInView(QRectF const&, Qt::AspectRatioMode) () from /lib64/libQt6Widgets.so.6
#10 0x00000000005089c8 in DocumentView::Impl::alignImageAccordingToViewMode (this=0x612000a07140, img=..., viewMode=ViewMode::Fit) at /anpv/src/widgets/DocumentView.cpp:155
#11 0x00000000005033cf in DocumentView::showImage (this=0x604000cf19d0, img=...) at /anpv/src/widgets/DocumentView.cpp:878
#12 0x000000000050175d in DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=1) at /anpv/src/widgets/DocumentView.cpp:774
#13 0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#14 0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#15 0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x606000c353c0, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#16 0x00007f854998cc90 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#17 0x00007f854a843942 in QFrame::event(QEvent*) () from /lib64/libQt6Widgets.so.6
#18 0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#19 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#20 0x00007f854994ee5d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#21 0x00007f8549b59c63 in ?? () from /lib64/libQt6Core.so.6
#22 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#23 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#24 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#25 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#26 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#27 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#28 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 2, DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
120             QTransform newTransform = q->viewportTransform();
(gdb) bt
#0  DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
#1  0x00000000005089ee in DocumentView::Impl::alignImageAccordingToViewMode (this=0x612000a07140, img=..., viewMode=ViewMode::Fit) at /anpv/src/widgets/DocumentView.cpp:156
#2  0x00000000005033cf in DocumentView::showImage (this=0x604000cf19d0, img=...) at /anpv/src/widgets/DocumentView.cpp:878
#3  0x000000000050175d in DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=1) at /anpv/src/widgets/DocumentView.cpp:774
#4  0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#5  0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#6  0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x606000c353c0, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#7  0x00007f854998cc90 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#8  0x00007f854a843942 in QFrame::event(QEvent*) () from /lib64/libQt6Widgets.so.6
#9  0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#10 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#11 0x00007f854994ee5d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#12 0x00007f8549b59c63 in ?? () from /lib64/libQt6Core.so.6
#13 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#14 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#15 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#16 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#17 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#18 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#19 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 2, DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
120             QTransform newTransform = q->viewportTransform();
(gdb) bt
#0  DocumentView::Impl::onViewportChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:120
#1  0x0000000000503d35 in DocumentView::showImage (this=0x604000cf19d0, img=...) at /anpv/src/widgets/DocumentView.cpp:922
#2  0x000000000050175d in DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=2, oldState=1) at /anpv/src/widgets/DocumentView.cpp:774
#3  0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#4  0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x606000c353c0)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#5  0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x606000c353c0, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#6  0x00007f854998cc90 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#7  0x00007f854a843942 in QFrame::event(QEvent*) () from /lib64/libQt6Widgets.so.6
#8  0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#9  0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#10 0x00007f854994ee5d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#11 0x00007f8549b59c63 in ?? () from /lib64/libQt6Core.so.6
#12 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#13 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#14 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#15 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#16 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#17 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#18 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 3, DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=3, oldState=2) at /anpv/src/widgets/DocumentView.cpp:760
760         auto& dec = d->currentImageDecoder;
(gdb) bt
#0  DocumentView::onDecodingStateChanged (this=0x604000cf19d0, img=0x6030005b4c80, newState=3, oldState=2) at /anpv/src/widgets/DocumentView.cpp:760
#1  0x000000000051af2c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<Image*, unsigned int, unsigned int>, void, void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x60600093fb60)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:171
#2  0x000000000051872d in QtPrivate::FunctionPointer<void (DocumentView::*)(Image*, unsigned int, unsigned int)>::call<QtPrivate::List<Image*, unsigned int, unsigned int>, void> (
    f=(void (DocumentView::*)(DocumentView * const, Image *, unsigned int, unsigned int)) 0x50148c <DocumentView::onDecodingStateChanged(Image*, unsigned int, unsigned int)>, o=0x604000cf19d0, arg=0x60600093fb60)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:208
#3  0x000000000051799c in QtPrivate::QSlotObject<void (DocumentView::*)(Image*, unsigned int, unsigned int), QtPrivate::List<Image*, unsigned int, unsigned int>, void>::impl (which=1, this_=0x6030004360c0, r=0x604000cf19d0, 
    a=0x60600093fb60, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:419
#4  0x00007f854998cc90 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#5  0x00007f854a843942 in QFrame::event(QEvent*) () from /lib64/libQt6Widgets.so.6
#6  0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#7  0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#8  0x00007f854994ee5d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#9  0x00007f8549b59c63 in ?? () from /lib64/libQt6Core.so.6
#10 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#11 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#12 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#13 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#14 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#15 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#16 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108
(gdb) c
Continuing.

Thread 1 "anpv" hit Breakpoint 1, DocumentView::Impl::startImageDecoding (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:236
236             if(!this->currentImageDecoder)
(gdb) bt
#0  DocumentView::Impl::startImageDecoding (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:236
#1  0x000000000050b188 in DocumentView::Impl::onFOVChanged (this=0x612000a07140) at /anpv/src/widgets/DocumentView.cpp:275
#2  0x00000000004fe4ec in operator() (__closure=0x603000ef7860) at /anpv/src/widgets/DocumentView.cpp:587
#3  0x0000000000505c9c in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, DocumentView::DocumentView(QWidget*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:163
#4  0x0000000000505a51 in QtPrivate::Functor<DocumentView::DocumentView(QWidget*)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffe24169830)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:277
#5  0x00000000005058e2 in QtPrivate::QFunctorSlotObject<DocumentView::DocumentView(QWidget*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, 
    this_=0x603000ef7850, r=0x604000cf19d0, a=0x7ffe24169830, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:444
#6  0x00007f854999c6ce in ?? () from /lib64/libQt6Core.so.6
#7  0x00007f85499a2cea in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt6Core.so.6
#8  0x00007f854998cbb6 in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#9  0x00007f854a778443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#10 0x00007f854994c4d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#11 0x00007f8549a99fc9 in QTimerInfoList::activateTimers() () from /lib64/libQt6Core.so.6
#12 0x00007f8549b59c04 in ?? () from /lib64/libQt6Core.so.6
#13 0x00007f8548728ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#14 0x00007f8548729258 in ?? () from /lib64/libglib-2.0.so.0
#15 0x00007f85487292ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#16 0x00007f8549b5714c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#17 0x00007f854995806b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#18 0x00007f854994fe28 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#19 0x00000000004334fa in main (argc=1, argv=0x7ffe2416a958) at /anpv/main.cpp:108

...etc...

Do not allocate huge buffers for decoding small ROIs

Using QImage::offset() for relative image positioning in the DocumentView would allow to allocate small image buffers, rather than huge ones, that could technically hold the entire image (page). While this approach is easier to implement, it purely relies on memory overcommitment and the hope that the user has enough memory (+swap space) available of which we are not going to need >90%.

fdatasync() is called whenever settings are written

QSettings calls fdatasync() when it writes the settings. This is done in the UI thread and will cause ANPV to potentially freeze when the user closes the last window.

QSettings could be outsourced to class ANPV, to write the settings in the non-UI logic.

Race when deleting images

Thread 1:

#0  0x00007ffff4aeac6b in raise () from /lib64/libc.so.6
#1  0x00007ffff4aec305 in abort () from /lib64/libc.so.6
#2  0x00007ffff50b5675 in ?? () from /usr/lib64/libstdc++.so.6
#3  0x00007ffff50c0d0c in ?? () from /usr/lib64/libstdc++.so.6
#4  0x00007ffff50c0d77 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5  0x000000000050436b in __clang_call_terminate ()
#6  0x00000000006cf7a5 in SmartImageDecoder::~SmartImageDecoder (this=0x60300311ce60) at ANPV/src/decoders/SmartImageDecoder.cpp:139
#7  0x0000000000512300 in SmartJpegDecoder::~SmartJpegDecoder (this=0x60300311ce60) at ANPV/src/decoders/SmartJpegDecoder.cpp:81
#8  0x0000000000512339 in SmartJpegDecoder::~SmartJpegDecoder (this=0x60300311ce60) at ANPV/src/decoders/SmartJpegDecoder.cpp:79
#9  0x00000000006255f8 in QtSharedPointer::CustomDeleter<SmartImageDecoder, QtSharedPointer::NormalDeleter>::execute (this=0x603004b1a8d0) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:190
#10 0x0000000000625491 in QtSharedPointer::ExternalRefCountWithCustomDeleter<SmartImageDecoder, QtSharedPointer::NormalDeleter>::deleter (self=0x603004b1a8c0) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:208
#11 0x0000000000506070 in QtSharedPointer::ExternalRefCountData::destroy (this=0x603004b1a8c0) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:146
#12 0x00000000005485ea in QSharedPointer<SmartImageDecoder>::deref (dd=0x603004b1a8c0) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:477
#13 0x000000000054859e in QSharedPointer<SmartImageDecoder>::deref (this=0x6130002b5230) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:472
#14 0x0000000000548425 in QSharedPointer<SmartImageDecoder>::~QSharedPointer (this=0x6130002b5230) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:312
#15 0x0000000000548a21 in Image::Impl::~Impl (this=0x6130002b5200) at ANPV/src/logic/Image.cpp:19
#16 0x00000000005488bb in std::default_delete<Image::Impl>::operator() (this=0x60400411c7f0, __ptr=0x6130002b5200) at /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/unique_ptr.h:85
#17 0x000000000053e641 in std::unique_ptr<Image::Impl, std::default_delete<Image::Impl> >::~unique_ptr (this=0x60400411c7f0) at /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/unique_ptr.h:361
#18 0x0000000000534402 in Image::~Image (this=0x60400411c7d0) at ANPV/src/logic/Image.cpp:118
#19 0x00000000005344f9 in Image::~Image (this=0x60400411c7d0) at ANPV/src/logic/Image.cpp:116
#20 0x00007ffff5b7772f in QObject::event (this=0x60400411c7d0, e=0x603005f7db10) at ../src/corelib/kernel/qobject.cpp:1352
#21 0x00007ffff7798a42 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x60400411c7d0, e=0x603005f7db10) at ../src/widgets/kernel/qapplication.cpp:3405
#22 0x00007ffff5b333da in QCoreApplication::notifyInternal2 (receiver=0x60400411c7d0, event=0x603005f7db10) at ../src/corelib/kernel/qcoreapplication.cpp:1063
#23 0x00007ffff5b335bc in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x60f000000040) at ../src/corelib/kernel/qcoreapplication.cpp:1830
#24 0x00007ffff5d1c7c3 in postEventSourceDispatch (s=0x60b000010a50) at ../src/corelib/kernel/qeventdispatcher_glib.cpp:279
#25 0x00007ffff384b82b in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#26 0x00007ffff384bbd0 in ?? () from /usr/lib64/libglib-2.0.so.0
#27 0x00007ffff384bc5c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#28 0x00007ffff5d221ca in QEventDispatcherGlib::processEvents (this=0x607000014ed0, flags=...) at ../src/corelib/kernel/qeventdispatcher_glib.cpp:429
#29 0x00007ffff5b3ddcb in QEventLoop::exec (this=0x7fffffffcbc0, flags=...) at include/QtCore/../../../src/corelib/global/qflags.h:69
#30 0x00007ffff5b35ddf in QCoreApplication::exec () at include/QtCore/../../../src/corelib/global/qflags.h:109
#31 0x0000000000502d5d in main (argc=1, argv=0x7fffffffdc18) at ANPV/main.cpp:111

Worker thread would later:

Thread 23 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd2641700 (LWP 23014)]
0x00000000006dc5ee in QSharedPointer<Image>::operator=<Image, true> (this=0x7fffd26404e0, other=...) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:378
378         { internalSet(other.d, other.value); return *this; }
(gdb) info thre
  Id   Target Id                                           Frame 
  1    Thread 0x7fffed496ac0 (LWP 21878) "anpv"            0x00000000006d8db2 in QScopedPointer<QPromise<DecodingState>, QScopedPointerDeleter<QPromise<DecodingState> > >::operator-> (this=0x30)
    at /usr/include/qt6/QtCore/qscopedpointer.h:127
  2    Thread 0x7fffe9bcb700 (LWP 21881) "QXcbEventQueue"  0x00000000004e030f in __sanitizer::internal_memmove(void*, void const*, unsigned long) () at ../projects/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp:64
  3    Thread 0x7fffd96a4700 (LWP 21882) "QDBusConnection" 0x00007ffff4bab0a9 in poll () from /lib64/libc.so.6
  4    Thread 0x7fffd50f2700 (LWP 21883) "Background Thre" 0x00007ffff4bab0a9 in poll () from /lib64/libc.so.6
  5    Thread 0x7fffd48f1700 (LWP 21884) "QFileInfoGather" 0x00007ffff59b170c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
* 23   Thread 0x7fffd2641700 (LWP 23014) "Thread (pooled)" 0x00000000006dc5ee in QSharedPointer<Image>::operator=<Image, true> (this=0x7fffd26404e0, other=...) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:378
  24   Thread 0x7fffd7b01700 (LWP 23015) "Thread (pooled)" 0x00007ffff59b5704 in read () from /lib64/libpthread.so.0
(gdb) threadQuit
(gdb) bt
#0  0x00000000006dc5ee in QSharedPointer<Image>::operator=<Image, true> (this=0x7fffd26404e0, other=...) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:378
#1  0x00000000006dc5a7 in QSharedPointer<Image>::QSharedPointer<Image, true> (this=0x7fffd26404e0, other=...) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:374
#2  0x00000000006dc523 in QWeakPointer<Image>::toStrongRef (this=0x78) at /usr/include/qt6/QtCore/qsharedpointer_impl.h:637
#3  0x00000000006d8d37 in SmartImageDecoder::Impl::imageUnsafe (this=0x0) at ANPV/src/decoders/SmartImageDecoder.cpp:93
#4  0x00000000006d496c in SmartImageDecoder::run (this=0x60300311ce60) at ANPV/src/decoders/SmartImageDecoder.cpp:327
#5  0x00007ffff5c7f40d in QThreadPoolThread::run (this=0x6040001226d0) at ../src/corelib/thread/qthreadpool.cpp:99
#6  0x00007ffff5c7e119 in QThreadPrivate::start (arg=0x6040001226d0) at ../src/corelib/thread/qthread_unix.cpp:342
#7  0x00007ffff59aa6ea in start_thread () from /lib64/libpthread.so.0
#8  0x00007ffff4bb794f in clone () from /lib64/libc.so.6

Images may be destroyed while decoder is still running

 	KernelBase.dll!00007ffebd55cd29()	Unknown
 	vcruntime140d.dll!00007ffe7c67b650()	Unknown
>	anpv.exe!SmartImageDecoder::assertNotDecoding() Line 550	C++
 	anpv.exe!SmartJpegDecoder::~SmartJpegDecoder() Line 81	C++
 	anpv.exe!SmartJpegDecoder::`scalar deleting destructor'(unsigned int)	C++
 	anpv.exe!QtSharedPointer::CustomDeleter<SmartImageDecoder,QtSharedPointer::NormalDeleter>::execute() Line 190	C++
 	anpv.exe!QtSharedPointer::ExternalRefCountWithCustomDeleter<SmartImageDecoder,QtSharedPointer::NormalDeleter>::deleter(QtSharedPointer::ExternalRefCountData * self) Line 212	C++
 	anpv.exe!QtSharedPointer::ExternalRefCountData::destroy() Line 146	C++
 	anpv.exe!QSharedPointer<SmartImageDecoder>::deref(QtSharedPointer::ExternalRefCountData * dd) Line 479	C++
 	anpv.exe!QSharedPointer<SmartImageDecoder>::deref() Line 472	C++
 	anpv.exe!QSharedPointer<SmartImageDecoder>::~QSharedPointer<SmartImageDecoder>() Line 312	C++
 	anpv.exe!Image::Impl::~Impl()	C++
 	anpv.exe!Image::Impl::`scalar deleting destructor'(unsigned int)	C++
 	anpv.exe!std::default_delete<Image::Impl>::operator()(Image::Impl * _Ptr) Line 3129	C++
 	anpv.exe!std::unique_ptr<Image::Impl,std::default_delete<Image::Impl>>::~unique_ptr<Image::Impl,std::default_delete<Image::Impl>>() Line 3241	C++
 	anpv.exe!Image::~Image() Line 117	C++
 	anpv.exe!Image::`scalar deleting destructor'(unsigned int)	C++
 	Qt6Cored.dll!qDeleteInEventHandler(QObject * o) Line 4806	C++
 	Qt6Cored.dll!QObject::event(QEvent * e) Line 1344	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3337	C++
 	Qt6Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3288	C++
 	Qt6Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1068	C++
 	Qt6Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 1485	C++
 	Qt6Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1848	C++
 	Qt6Cored.dll!QEventDispatcherWin32::sendPostedEvents() Line 906	C++
 	Qt6Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 476	C++
 	Qt6Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 137	C++
 	Qt6Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 218	C++
 	Qt6Cored.dll!QThread::exec() Line 553	C++
 	Qt6Cored.dll!QThread::run() Line 623	C++
 	Qt6Cored.dll!QThreadPrivate::start(void * arg) Line 328	C++

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.