Bug 289819 - Gwenview fails to load and show an undamaged png image and claims in the shell the file is missing, all the while still showing its thumbnail
Summary: Gwenview fails to load and show an undamaged png image and claims in the shel...
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 2.7
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-26 02:56 UTC by Falk Krönert
Modified: 2012-10-19 13:25 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.8.2


Attachments
screenshot (125.86 KB, image/png)
2011-12-28 01:11 UTC, Falk Krönert
Details
image that fails to show in gwenview (84.48 KB, image/png)
2012-01-30 19:58 UTC, Falk Krönert
Details
image that does not fail to show in Gwenview (84.44 KB, image/png)
2012-01-30 19:59 UTC, Falk Krönert
Details
example for a very small image that fails to load in Gwenview (85 bytes, image/png)
2012-02-18 19:34 UTC, Falk Krönert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Falk Krönert 2011-12-26 02:56:10 UTC
Version:           2.7 (using KDE 4.7.3) 
OS:                Linux

I'm not exactly sure I understand this bug, so this is what happens:

When started with the image file name as parameter or upon selecting the image's thumbnail in Gwenview itself, the image is not shown. Instead, the red error message "Loading 'IMG_0626.png' failed" "Loading meta information failed." is displayed in the viewport. In the thumbnail bar down on the screen the image thumbnail is still shown correctly, though (as in Gwenviews directory view).

Starting Gwenview from a shell gives this output:
----------------------------------------------------------
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setCompositionMode: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
gwenview(24151)/kio (KDirWatch) KDirWatchPrivate::KDirWatchPrivate: INotify available:  true
gwenview(24151)/nepomuk (library) <unnamed>::GlobalModelContainer::init: Connecting to local socket "/tmp/ksocket-falk/nepomuk-socket"
gwenview(24151)/kio (KDirWatch) KDirWatchPrivate::addEntry: Added File "/home/falk/.local/share/user-places.xbel" for "" ["KDirWatch-2"]
gwenview(24151)/kio (bookmarks) KBookmarkManager::KBookmarkManager: starting KDirWatch for  "/home/falk/.local/share/user-places.xbel"
gwenview(24151)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-falk/ksycoca4"
gwenview(24151)/kio (KDirListerCache) KDirListerCache::listDir: Listing directory: KUrl("trash:/")
gwenview(24151)/kio (Scheduler) KIO::SchedulerPrivate::doJob: KIO::SimpleJob(0x95e1c0)
gwenview(24151)/kio (Scheduler) KIO::SchedulerPrivate::protoQ: creating ProtoQueue instance for "trash"
gwenview(24151)/kio (Scheduler) KIO::ProtoQueue::ProtoQueue: m_maxConnectionsTotal: 2 m_maxConnectionsPerHost: 2
gwenview(24151)/kdecore (KLocale) KuitSemanticsPrivate::formatFromContextMarker: "Unknown semantic role '@addaction' in context marker for message {Name}."
gwenview(24151)/kdecore (KLocale) KuitSemanticsPrivate::formatFromContextMarker: "Unknown semantic role '@addaction' in context marker for message {Date}."
gwenview(24151)/kdecore (KLocale) KuitSemanticsPrivate::formatFromContextMarker: "Unknown semantic role '@addaction' in context marker for message {Size}."
gwenview(24151)/kio (KDirListerCache) KDirListerCache::listDir: Entry currently being listed: KUrl("trash:/") by (KDirLister(0x98d320) )
gwenview(24151)/kdeui (kdelibs): Attempt to use QAction "edit_redo" with KXMLGUIFactory! 
gwenview(24151)/kdeui (kdelibs): Attempt to use QAction "edit_undo" with KXMLGUIFactory! 
gwenview(24151)/kdeui (KMainWindow) KMainWindow::applyMainWindowSettings: KMainWindow::applyMainWindowSettings  "MainWindow"
gwenview(24151)/kdecore (K*TimeZone*) KSystemTimeZonesPrivate::instance: instance(): ... initialised
gwenview(24151)/kdecore (K*TimeZone*) KSystemTimeZonesPrivate::readConfig: readConfig(): local zone= "Europe/Berlin"
gwenview(24151)/kdecore (K*TimeZone*) KSystemTimeZonesPrivate::readZoneTab: readZoneTab( "/usr/share/zoneinfo/zone.tab" )
gwenview(24151)/kio (KIOJob) KDirModel::indexForUrl: KUrl("file:///tmp/IMG_0626.png") not found
gwenview(24151) Gwenview::DocumentPanelPrivate::setCurrentView: No index found for current view 
gwenview(24151)/kio (KIOJob) KDirModel::indexForUrl: KUrl("file:///tmp/IMG_0626.png") not found
QPixmap::operator=: Cannot assign to pixmap during painting
QPixmap::operator=: Cannot assign to pixmap during painting
gwenview(24151)/kio (KDirListerCache) KDirListerCache::listDir: Entry currently being listed: KUrl("trash:/") by (KDirLister(0x98d320) ,  KDirLister(0xc2abe0) )
gwenview(24151)/kio (KDirListerCache) KDirListerCache::stopListingUrl: KDirLister(0xebeec0)  url= KUrl("trash:/")
gwenview(24151)/kio (KDirListerCache) KDirListerCache::listDir: Entry currently being listed: KUrl("trash:/") by (KDirLister(0x98d320) ,  KDirLister(0xc2abe0) )
gwenview(24151)/kio (KDirListerCache) KDirListerCache::stopListingUrl: KDirLister(0xc249a0)  url= KUrl("trash:/")
gwenview(24151)/kio (KDirListerCache) KDirListerCache::listDir: Listing directory: KUrl("file:///tmp")
gwenview(24151)/kio (KDirWatch) KDirWatchPrivate::addEntry: Added Dir "/tmp" for "" ["KDirWatch-1"]
gwenview(24151)/kio (Scheduler) KIO::SchedulerPrivate::doJob: KIO::SimpleJob(0xe61340)
gwenview(24151)/kio (Scheduler) KIO::SchedulerPrivate::protoQ: creating ProtoQueue instance for "file"
gwenview(24151)/kio (Scheduler) KIO::ProtoQueue::ProtoQueue: m_maxConnectionsTotal: 5 m_maxConnectionsPerHost: 5
gwenview(24151)/kio (KIOJob) KDirModel::indexForUrl: KUrl("file:///tmp/IMG_0626.png") not found
gwenview(24151)/kio (Slave) KIO::Slave::createSlave: createSlave "trash" for KUrl("trash:/")
gwenview(24151)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-falk/gwenviewm24151.slave-socket"
gwenview(24151)/kio (KIOJob) KDirModel::indexForUrl: KUrl("file:///tmp/IMG_0626.png") not found                                                                                                                                              
gwenview(24151)/kio (Slave) KIO::Slave::createSlave: createSlave "file" for KUrl("file:///tmp")                                                                                                                                              
gwenview(24151)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-falk/gwenviewj24151.slave-socket"                                                                                              
gwenview(24151)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished: KIO::ListJob(0xe61340) KIO::Slave(0xa48a90)                                                                                                                              
gwenview(24151)/kio (KDirListerCache) KDirListerCache::slotResult: finished listing KUrl("file:///tmp")                                                                                                                                      
gwenview(24151)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished: KIO::ListJob(0x95e1c0) KIO::Slave(0xe76530)                                                                                                                              
gwenview(24151)/kio (KDirListerCache) KDirListerCache::slotResult: finished listing KUrl("trash:/")
-----------------------------------------------------------

Notice the lines reading: "KUrl("file:///tmp/IMG_0626.png") not found"
The file IS there, has the right permissions and can be opened fine with showFoto, oKular or any other graphics program (like Krita).

Converting the image to TIFF lets Gwenview show it just fine, converting it back to PNG, even though the files are not identical, results in the same error.

The image was exported from Krita and has no alpha channel and no exif or other metadata.

It does not only concern this specific file — I've had about 5 or 6 affected ones in the last week.

Reproducible: Always

Steps to Reproduce:
1. Open the image with Gwenview.

Actual Results:  
Gwenview displays the error message "Loading 'IMG_0626.png' failed" "Loading meta information failed."

Expected Results:  
The image should be shown fine.

Using KDE 4.7.4 and Gwenview 2.7.4 on openSUSE 11.4 64bit
Comment 1 Shlomi Fish 2011-12-27 14:05:14 UTC
Opening .png files by saying "gwenview common/images/bk2hp.png" (or "gwenview http://www.shlomifish.org/images/bk2hp.png") works perfectly fine here (Mageia Linux 2/Cauldron, x86-64 with KDE-4.7.95). Does it also happen in a new user? Can you attach a sample offending file?

Regards,

— Shlomi Fish
Comment 2 Falk Krönert 2011-12-27 14:39:38 UTC
Yes, it does happen with a newly created user as well (I tested this before). However, not for another already existing user nor root, which I only just found out.

??? Now, I'm even more confused than before…

Can't attach the file, it's too large (about 60MB), but you can download it from http://www.23hq.com/user/4082112/photo/7533520/original (Sorry about the quality)
Comment 3 Aurelien Gateau 2011-12-27 18:49:15 UTC
It works fine here with Gwenview 2.7.3 and Gwenview from master. Please reopen the bug if it is still a problem for you.
Comment 4 Falk Krönert 2011-12-27 19:58:02 UTC
The bug still persists with the openSUSE KDE 4.7.95 packages, Gwenview version 2.8.0. Actually, I found a couple of images Gwenview fails on — out of a series of 10, four won't show. All of them were exported directly from Photivo.

As not every user is affected, I guess it's a config issue. A newly created user with no .config nor .kde/.kde4 directories suffers from it, one existing user with existing .kde4/share/apps/gwenview dir and config/gwenviewrc file does not, even after removing them.

The problem can be reproduced on two different machines, both running the same versions.

So, where do I need to look? It's probably a very obvious setting I'm just overlooking…
Comment 5 Falk Krönert 2011-12-28 01:11:04 UTC
Created attachment 67174 [details]
screenshot

Screenshot of Gwenview showing the thumbnail but not the actual image itself.
Comment 6 Jekyll Wu 2011-12-30 05:40:02 UTC
Works for me when opening the original image in a fresh user account. I checked it against 2.7.4 and master code.
Comment 7 Falk Krönert 2011-12-30 23:39:20 UTC
It would help to know which part/component actually gives this message, to locate its possible source. And which config files other than Gwenview's own influence the image loading? As it only occurs/seems to occur for png files, could the libpng be broken in some way that only affects certain users? Is there some useful tracing or debugging I could do to compare an image which won't load to one that does to help narrow it down?
Comment 8 Falk Krönert 2012-01-27 05:02:22 UTC
I noticed that the exact same problem occurs when trying to view some png files with the internal viewer or Krusader (F3). So my guess is it's a problem of the kpart Gwenview uses to display images, not an inherent Gwenview bugs itself.

Still, I haven't been able to figure out what user-specific config setting causes this. Slowly, it's driving me nuts as it is so random and illogical.
Comment 9 Falk Krönert 2012-01-30 19:58:36 UTC
Created attachment 68346 [details]
image that fails to show in gwenview
Comment 10 Falk Krönert 2012-01-30 19:59:10 UTC
Created attachment 68347 [details]
image that does not fail to show in Gwenview
Comment 11 Falk Krönert 2012-01-30 19:59:55 UTC
I found a reliable way to test for this bug, even though I have no clue as to why: Simply open a png image with a width of 2560 or 2808 pixels in Gwenview and it won't show if the current user is affected by this. I'll attach an images that fails and one that works (just cropped off one pixel).
The image itself was created with Gimp anew and filled with the plasma filter. The height dimension doesn't seem to matter so I kept it very small to reduce filesize.
Hopefully someone can now figure this one out.
Comment 12 Shlomi Fish 2012-01-30 20:35:53 UTC
(In reply to comment #9)
> Created an attachment (id=68346) [details]
> image that fails to show in gwenview

It does indeed fail. Mageia Linux 2/Cauldron with KDE-4.8.0.
Comment 13 Brandon Watkins 2012-02-08 05:30:45 UTC
I'm also effected by this. KDE 4.8, Arch Linux, Gwenview 2.8.0.

All the wallpapers in this pack are effected:
http://lassekongo83.deviantart.com/gallery/21454#/d3d9pnq

It seems to be very large png images that are the consistant problem as Falk demonstrated as well. This is very strange. This is the only user on the system (besides root) and its a pretty fresh install. Gwenview is showing thumbnails of these wallpapers just fine, but if I try and open it, it says failed to load image.

Any other program opens them fine. I tried opening them in gimp and re-saving them, but it made no difference.
Comment 14 Brandon Watkins 2012-02-08 05:42:28 UTC
Alright. I have now found its definitely something to do with size. I took the images from that wallpaper pack, and scaled them down from 2560x1600 to 1920x1200 and they open totally fine in gwenview.
Comment 15 Brandon Watkins 2012-02-08 18:43:07 UTC
If it makes any difference arch was updated to libpng15 recently. Other image viewers seem to open these images fine though for me.
Comment 16 Falk Krönert 2012-02-08 23:10:31 UTC
I'm very relieved others can confirm this bug happens.

>If it makes any difference arch was updated to libpng15 recently.

openSuse still uses libPNG 1.4, so this doesn't seem to be the issue.

I have copied my entire ~ and tried to remove config files until I find the one responsible. The bug does indeed vanish if I delete .kde, so it's definitely a configuration issue. But as of yet I've not been able to pinpoint the exact file causing it. Except the images I removed every file strace told me is opened by Gwenview, including the thumbnail cache and Nepomuk storage, and the bug still occurs.
Comment 17 Falk Krönert 2012-02-18 19:34:26 UTC
Created attachment 68911 [details]
example for a very small image that fails to load in Gwenview

I found a new and very small example for a failing image, simply a 2702 pixel wide and one pixel high png image, all black. It's just 85 byte in size so maybe it will make it easier to track down this bug.
Comment 18 ZH 2012-03-12 01:54:54 UTC
*** This bug has been confirmed by popular vote. ***
Comment 19 Aurelien Gateau 2012-03-26 21:04:20 UTC
Git commit dd7fd362d23e2f2f29a052a988f825aaf6cf102a by Aurélien Gâteau.
Committed on 26/03/2012 at 23:03.
Pushed by gateau into branch 'KDE/4.8'.

Use file extension as a hint for QImageReader

Fixes decoding PNG in weird situations.
FIXED-IN: 2.8.2

M  +21   -2    lib/document/loadingdocumentimpl.cpp
M  +2    -0    tests/auto/documenttest.cpp
A  +-    --    tests/data/289819_does_not_load.png

http://commits.kde.org/gwenview/dd7fd362d23e2f2f29a052a988f825aaf6cf102a