Bug 277251

Summary: No previews for JPGs anymore
Product: [Applications] dolphin Reporter: S. Burmeister <sven.burmeister>
Component: generalAssignee: Peter Penz <peter.penz19>
Status: RESOLVED FIXED    
Severity: normal CC: frank78ac
Priority: NOR Keywords: investigated, reproducible
Version: 16.12.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.7.0
Attachments: Suggested patch for KFilePreviewGenerator
Suggested patch for PreviewsSettingsPage

Description S. Burmeister 2011-07-07 00:35:18 UTC
Version:           unspecified (using Devel) 
OS:                Linux

Since upgrading there are no previews shown for JPG files anymore, not in the tooltip, not in the filetree pane and neither in the info panel. This worked with KDE 4.6.4, so I guess there is some small regression. They are all well below the file limit.

Previews for png and others work.

Reproducible: Always

Steps to Reproduce:
enable previews for a folder with jpgs in it

Actual Results:  
no previews

Expected Results:  
previews
Comment 1 S. Burmeister 2011-07-07 00:53:00 UTC
Found the reason! There is a list of filetypes for which to show previews in dolphin's settings. There jpg was disabled. Not sure why this happens when upgrading 4.6.4 to 4.7 but it should be enabled by default.
Comment 2 Frank Reininghaus 2011-07-10 12:02:19 UTC
Thanks for reporting this issue! It seems that JPG previews are disabled in 4.7 if the 'jpegrotatedthumbnail' had been enabled in 4.6. The code added in

https://projects.kde.org/projects/kde/kdebase/kde-baseapps/repository/revisions/471381b2496d33e4a052219dd7884359d29e5f88/diff

disables the 'jpegrotatedthumbnail' plugin, which does not exist in 4.7 any more (rotated JPG previews can now be generated by the usual 'jpegthumbnail' plugin if it is configured accordingly).

I think the code should be modified, such that it replaces 'jpegrotatedthumbnail' by 'jpegthumbnail'. I'll see if I can do that...
Comment 3 Frank Reininghaus 2011-07-10 12:42:13 UTC
Created attachment 61757 [details]
Suggested patch for KFilePreviewGenerator

This patch fixes it for me. I think it's best to do it in KFilePreviewGenerator, such that the update to the correct plugin is done in Dolphin, Konqueror and potentially other apps that need it.

@Peter: Do you have a better idea how to solve this, or can I commit this to 4.7 and master?
Comment 4 Frank Reininghaus 2011-07-10 13:06:53 UTC
Created attachment 61759 [details]
Suggested patch for PreviewsSettingsPage

When opening Konqueror in web browsing mode and the opening the Settings dialog, the plugin upgrade cannot be done in KFilePreviewGenerator. Therefore, I suggest to do the upgrade also in PreviewSettingsPage::loadSettings(). The old code in PreviewsSettingsPage::loadPreviewPlugins() can be removed, I think.
Comment 5 Peter Penz 2011-07-10 13:31:30 UTC
Thanks Frank for having a look and the patches. Both patches seem to be fine and a lot better than what I did. I've no better idea how to solve this, would be great if you could commit this to master + 4.7
Comment 6 Frank Reininghaus 2011-07-10 13:39:05 UTC
Git commit e3c0ddfa5b4c0085687884a4e385241b2d86f7c4 by Frank Reininghaus.
Committed on 10/07/2011 at 15:25.
Pushed by freininghaus into branch 'KDE/4.7'.

KFilePreviewGenerator: update JPG preview plugin settings if needed

In KDE <= 4.6, the 'jpegrotatedthumbnail' plugin was used to provide
thumbnails for JPG images which are rotated correctly. In KDE 4.7, this
is done by the usual 'jpegthumbnail' plugin if it is configured
accordingly. This patch adds a check to KFilePreviewGenerator's
constructor that replaces the obsolete plugin by the correct one.

BUG:277251
FIXED-IN:4.7.0

M  +10   -1    kfile/kfilepreviewgenerator.cpp     

http://commits.kde.org/kdelibs/e3c0ddfa5b4c0085687884a4e385241b2d86f7c4
Comment 7 Frank Reininghaus 2011-07-10 13:39:50 UTC
Git commit 626fb3cf58dc12d4a8d219c12e7663881a1246e7 by Frank Reininghaus.
Committed on 10/07/2011 at 15:33.
Pushed by freininghaus into branch 'KDE/4.7'.

PreviewSettingsPage: update JPG preview plugin settings if needed

In KDE <= 4.6, the 'jpegrotatedthumbnail' plugin was used to provide
thumbnails for JPG images which are rotated correctly. In KDE 4.7, this
is done by the usual 'jpegthumbnail' plugin if it is configured
accordingly. The update of the settings is done in KFilePreviewGenerator.
However, if Konqueror is run in web browsing mode and the settings dialog
is opened, KFilePreviewGenerator does not have a chance to do the update.
To make sure that the correct plugins are shown in the settings, this
commit adds a plugin update to PreviewSettingsPage.

The old code that just removed the 'jpegrotatedthumbnail' plugin without
enabling the 'jpegthumbnail' plugin is removed.

CCBUG:277251
FIXED-IN:4.7.0

M  +13   -12   dolphin/src/settings/general/previewssettingspage.cpp     

http://commits.kde.org/kde-baseapps/626fb3cf58dc12d4a8d219c12e7663881a1246e7
Comment 8 Frank Reininghaus 2011-07-10 13:43:16 UTC
Git commit b078346038bb7bfdec2d73936fefb58d6af151eb by Frank Reininghaus.
Committed on 10/07/2011 at 15:25.
Pushed by freininghaus into branch 'master'.

KFilePreviewGenerator: update JPG preview plugin settings if needed

In KDE <= 4.6, the 'jpegrotatedthumbnail' plugin was used to provide
thumbnails for JPG images which are rotated correctly. In KDE 4.7, this
is done by the usual 'jpegthumbnail' plugin if it is configured
accordingly. This patch adds a check to KFilePreviewGenerator's
constructor that replaces the obsolete plugin by the correct one.

CCBUG:277251
(cherry picked from commit e3c0ddfa5b4c0085687884a4e385241b2d86f7c4)

M  +10   -1    kfile/kfilepreviewgenerator.cpp     

http://commits.kde.org/kdelibs/b078346038bb7bfdec2d73936fefb58d6af151eb
Comment 9 Frank Reininghaus 2011-07-10 13:44:59 UTC
Git commit 04352f2f4c6af5d8bf8f85259fdba72d080e56ec by Frank Reininghaus.
Committed on 10/07/2011 at 15:33.
Pushed by freininghaus into branch 'master'.

PreviewSettingsPage: update JPG preview plugin settings if needed

In KDE <= 4.6, the 'jpegrotatedthumbnail' plugin was used to provide
thumbnails for JPG images which are rotated correctly. In KDE 4.7, this
is done by the usual 'jpegthumbnail' plugin if it is configured
accordingly. The update of the settings is done in KFilePreviewGenerator.
However, if Konqueror is run in web browsing mode and the settings dialog
is opened, KFilePreviewGenerator does not have a chance to do the update.
To make sure that the correct plugins are shown in the settings, this
commit adds a plugin update to PreviewSettingsPage.

The old code that just removed the 'jpegrotatedthumbnail' plugin without
enabling the 'jpegthumbnail' plugin is removed.

CCBUG:277251
(cherry picked from commit 626fb3cf58dc12d4a8d219c12e7663881a1246e7)

M  +13   -12   dolphin/src/settings/general/previewssettingspage.cpp     

http://commits.kde.org/kde-baseapps/04352f2f4c6af5d8bf8f85259fdba72d080e56ec
Comment 10 Peter Penz 2011-07-10 15:00:35 UTC
Thanks a lot Frank :)