Fix for broken Tiled Thumbnails in pictures module
#1
Hi All,

CPicture::CreateTiledThumb does not use the new static wrapper CBaseTexture::LoadFromFile (introduced 4 jul 2012 by Jonathan). I'm not sure if this was intentional, but as the prototype for the non-static function was changed at the same time (has no more defaults), CPicture::CreateTiledThumb now used the wrong version.

I'll leave it to the experts to make the definitive decision which LoadFromFile() version to use, but this one line fix at least restores the tiled thumbnails functionality.

xbmc/pictures/Picture.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xbmc/pictures/Picture.cpp b/xbmc/pictures/Picture.cpp
index 0980efb..3651aca 100644
--- a/xbmc/pictures/Picture.cpp
+++ b/xbmc/pictures/Picture.cpp
@@ -151,7 +151,7 @@ bool CPicture::CreateTiledThumb(const std::vector<std:Confusedtring> &files, const std
// load in the image
CTexture texture;
unsigned int width = tile_width - 2*tile_gap, height = tile_height - 2*tile_gap;
- if (texture.LoadFromFile(files[i], width, height, g_guiSettings.GetBool("pictures.useexifrotation")) && texture.GetWidth() && texture.GetHeight())
+ if (texture.LoadFromFile(files[i], width, height, g_guiSettings.GetBool("pictures.useexifrotation"), NULL, NULL) && texture.GetWidth() && texture.GetHeight())
{
GetScale(texture.GetWidth(), texture.GetHeight(), width, height);

Cheers,
Aardvark
Reply
#2
This patch breaks normal thumbnails of imags completly for me.

Edit: Correction - this doesn't do anything different then before for me.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
Try new install (or -p somewhere clean). Add a new dir with pictures including subdir with more than 4 pictures. Without my patch the 4-in-a-grid thumbnail for the subdir is not generated.

If you debug, you see the wrong LoadFrom File is called (the new static instead of old member func), you do not get the loaded texture back and width/height is 0 -> thumbnail fails.

Hope not compiler/platform dependant: I'm on Win7 with VC2010 Express.


Reply
#4
looks like it will be taken care of with this pull request already...

https://github.com/xbmc/xbmc/pull/1291
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#5
You are right, wasted my time fixing this myself :-(
But thanks for pointing me to the github patch.

(I looked in trac to see if someone was already working on this, did not find this fix. Maybe trac is not used anymore and I have to look into pending changes in github, if that is possible...? Last lime I worked on public XBMC was before git - seems I have to dive into all this gitstuff after all ;-) Oh well, live and learn.)

Reply
#6
(2012-09-05, 21:52)Aardvark Wrote: You are right, wasted my time fixing this myself :-(
But thanks for pointing me to the github patch.

(I looked in trac to see if someone was already working on this, did not find this fix. Maybe trac is not used anymore and I have to look into pending changes in github, if that is possible...? Last lime I worked on public XBMC was before git - seems I have to dive into all this gitstuff after all ;-) Oh well, live and learn.)

Please only use trac for issue report and DON'T use github issues.
You can ofcourse see if there are some PR pending or submit a code PR yourself (but no bugreports)

(this counts for every one)
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#7
(2012-09-05, 18:20)Memphiz Wrote: looks like it will be taken care of with this pull request already...

https://github.com/xbmc/xbmc/pull/1291

I'm stuck :-( Could a friendly someone lend me a hand explaining to me (or send me to a git-noob-friendly link) how I get his pullrequest into my local copy to check it out? (And yes: I spend over an hour searching and reading about git, github and xbmc on the web, this forum and the xbmc-wiki. I even registered on github, made a fork of xbmc, but still have no clue whatsoever how to get/push/pull/merge/fetch/sync/fork/request/whatever his fix on my machine...).
Reply
#8
in your local cloned xbmc repo:

#add a remote of jmarshalls repo to your local repo and fetch it
git remote add jmarshallnz git://github.com/jmarshallnz/xbmc.git -f
#checkout the branch of that pr
git checkout loadfromfile_cleanup


Now you are at the state of jmarshalls xbmc repo in the branch loadfromfile_cleanup.

Build as usual.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#9
On github you can press the wee i in a circle icon in the green bar at the bottom that will explain this. Not sure if it's available to those without pull rights.

Also, note you don't need to add the remote, just:

1. Checkout a fresh branch from master to play in. git checkout -b playing master
2. Pull in the changes. git pull git://github.com/jmarshallnz/xbmc.git <branch_to_pull>

I'll rebase this one up and pull it in.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
Yeah thats the better way for onetimers. I keep pulling the whole repo because its mostly not the last time i need something from your code jonathan haha Big Grin
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Fix for broken Tiled Thumbnails in pictures module0