MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Main Features (talk, share your ideas, get support) » Watch / Listen Media » View Pictures


View Pictures General talk, support, improvement suggestions and tips & tricks

Reply
 
Thread Tools Display Modes
Old 2007-08-04, 14:50   #1 (permalink)
Portal Developer
 
lkuech's Avatar
 
Join Date: Feb 2007
Location: Hamburg
Age: 34
Posts: 538
Thanks: 26
Thanked 42 Times in 16 Posts

Country:

My System

Lightbulb Test application: For "lightning fast thumbnail creation"

Hi all.

Short description:
I have developed a small test application based on my EXIF information extraction routine. Please test it with your pictures and tell me if it works.

to test it simply use the "..."-button and browse to a folder that contains images of your digital camera (JPG). Press the start button and watch the show
(subfolders are not included)

For me it takes <20 seconds to "create" thumbs of 1573 images (we talking about 2,86GB of pictures!)


Longer story
One thing I "hat" from my early beginning of using MediaPortal is the very slow creation of thumbnail. This is especially a problem if you want to browse pictures from a memorystick or a network share and the thumbs for that pictures hat not been created before.
I always though why is MP so slow while other applications like the Ms MediaCenter or picture manager like Cam2PC and ACDSee or so impressive fast (at least if we talk about pictures from digital cameras).

After some research I found out that the other applications no not really create the thumbnails... they simply use the thumbs that are already embedded in the jpg's EXIF information.

Of course these embedded thumbnails are not as good as the one MP is creating on the highest level and we are not able to replace the creation of large thumbs either, but the embedded thumbs are good enough to compare them to the medium quality settings of MP.

My idea is to create a option to disable the auto creation of MP completely and
use my routine to simply show the embedded thumbs.
So the behaviour of MP would be:
  • Looking into the "\thumbs\pictures\" folder if a "highres" thumb is available
  • if not use the embedded thumb
  • if there is no embedded thumb... there could be an option to create a thumb in the "\thumbs\pictures\" folder.

If the user would like to use highres thumbs he can use the manual thumbs creation. This also helps to avoid the waste of diskspace because you theoretically need only thumbnails in your "\thumbs\pictures\" folder of pictures that don have thumbnails embedded.

BTW: the speed is also impressive if the images are stored on a compact flashcard or a networkshare via wireless lan, because the images are not read completely (like the most examples of exif extractors did that). My routine read and analyses the heady information of the images and stops as soon as the informations is found or not...

Bye
Lars

EDIT: If you are interested how this may look like in MediaPortal you should look at the following post: http://forum.team-mediaportal.com/sh...7&postcount=13
Attached Files
File Type: zip ExifThumbTestV01.zip (14.8 KB, 80 views)
__________________
Using a wide screen and tired of changing the aspect ratio via remote all the time? Use the ViewModeSwitcher Plugin and everything is working automatically.
Are you able to find your home in MediaPortal? Yes you are! With the WorldMap plugin!

Last edited by lkuech; 2007-08-08 at 11:32.
lkuech is offline   Reply With Quote
5 Users Say Thank You:
Old 2007-08-04, 15:12   #2 (permalink)
Portal Tester
 
The_Stig's Avatar
 
Join Date: Apr 2005
Posts: 712
Thanks: 19
Thanked 2 Times in 2 Posts

My System

Default

Great one! Will test and report later!

EDIT:

Works fast and good for me. How about joining on IRC and talk how to integrate this to MP directly?
__________________
Some say he works as a tester for Team Mediaportal and some say that he smells bugs, even before they are written into the Code. All we know is, he's called
The Stig.

Last edited by The_Stig; 2007-08-04 at 16:01.
The_Stig is offline   Reply With Quote
Old 2007-08-04, 16:30   #3 (permalink)
Portal Designer
 
Inker's Avatar
 
Join Date: Dec 2004
Posts: 1,550
Thanks: 34
Thanked 133 Times in 57 Posts

My System

Default

That's very impressive lkuech. I can confirm it works very fast even in a directory with lots of 5 mb+ images. It's almost scary, lol.

I also agree with your behaviour suggestion. One question, how big a resolutions do these thumbnails have (I didn't even know thumbnails were in exif)?

Would love to see this in MP.
__________________

There are only two industries that refer to their customers as "users".
- Edward Tufte
Inker is offline   Reply With Quote
Old 2007-08-04, 18:18   #4 (permalink)
Portal Developer
 
lkuech's Avatar
 
Join Date: Feb 2007
Location: Hamburg
Age: 34
Posts: 538
Thanks: 26
Thanked 42 Times in 16 Posts

Country:

My System

Default

Well. The size seems to vary depending on the camera that has taken the picture. But if I remember correctly they are 160x 120 in most cases.

@The_Stig: Regarding join the IRC. I just registered my Nick at the webIRC (start page)... so we will met us there


Edit:
Mhh. I would love to get a little bit more feedback on this before thinking of an integration. It looks like the thread doesn't get much attention here...

But anyway. I will try to start an experimental integration of the routine next week (hopefully). Then we will see how easy the integration is or if I need some help by a more experienced developer.

Bye
Lars
__________________
Using a wide screen and tired of changing the aspect ratio via remote all the time? Use the ViewModeSwitcher Plugin and everything is working automatically.
Are you able to find your home in MediaPortal? Yes you are! With the WorldMap plugin!

Last edited by lkuech; 2007-08-05 at 08:24. Reason: Automerged Doublepost
lkuech is offline   Reply With Quote
Old 2007-08-05, 11:12   #5 (permalink)
Portal Developer
 
Join Date: Jun 2004
Location: Germany
Posts: 508
Thanks: 9
Thanked 3 Times in 3 Posts

Country:


Default

Indeed VERY fast Tried it on some folders and the result was great!

Just out of interest: do you know what happens if you edit the original file (like red eye removal, cropping etc.), does the exif thumbnails gets recreated then? Or can it only be added by the camera so that we'll still see the original pic in the thumbnail?

Would be nice to see this icluded in MP

Maschine
Maschine is offline   Reply With Quote
Old 2007-08-05, 11:13   #6 (permalink)
Portal Tester
 
The_Stig's Avatar
 
Join Date: Apr 2005
Posts: 712
Thanks: 19
Thanked 2 Times in 2 Posts

My System

Default

The missing attention is most likely due to the fact that not much ppl watch the cpu load at a normal htpc-usage. But if you have once seen how much cpu-load it consumes to create thumbs on pictures folders, you will love a better function here.
__________________
Some say he works as a tester for Team Mediaportal and some say that he smells bugs, even before they are written into the Code. All we know is, he's called
The Stig.
The_Stig is offline   Reply With Quote
Old 2007-08-05, 11:23   #7 (permalink)
Portal Developer
 
Join Date: Jan 2005
Age: 30
Posts: 2,933
Thanks: 74
Thanked 82 Times in 67 Posts


Default

Quote:
Originally Posted by Maschine View Post
Indeed VERY fast Tried it on some folders and the result was great!

Just out of interest: do you know what happens if you edit the original file (like red eye removal, cropping etc.), does the exif thumbnails gets recreated then? Or can it only be added by the camera so that we'll still see the original pic in the thumbnail?
Depends on the software that is used for editing the image. Not all of those are able to update the exif thumbnail.
__________________
http://day2.no-ip.org/

"Commy64 - The problem there is that Oprah was on. MP tried to save you by blanking the screen"
tourettes is offline   Reply With Quote
Old 2007-08-05, 17:07   #8 (permalink)
Portal Member
 
Join Date: Dec 2006
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts

Country:

My System

Default

Quote:
Originally Posted by The_Stig View Post
The missing attention is most likely due to the fact that not much ppl watch the cpu load at a normal htpc-usage. But if you have once seen how much cpu-load it consumes to create thumbs on pictures folders, you will love a better function here.
Mybe I do not look at CPU usage ... but of course I saw that MP is very slow in creating thumb

I will test it and post reports asap

Anyway ... good job @lkuech
__________________
*********************************
Hail to captain Jack Sparrow
*********************************
Jack Sparrow is offline   Reply With Quote
Old 2007-08-06, 08:28   #9 (permalink)
Portal Developer
 
lkuech's Avatar
 
Join Date: Feb 2007
Location: Hamburg
Age: 34
Posts: 538
Thanks: 26
Thanked 42 Times in 16 Posts

Country:

My System

Default

I just took a brief look at the source code of MyPicture section of MP.

It seams that the integration becomes more complicated as I thought.

From my brief research I did not found a method that allows me to set the shown Thumb in the facadeView at runtime without loading a file from disk. All available methods seem to based on loading files (thumbs) from the harddrive, but that (of course) will slow down the whole routine because I have to save the thumb just to load it afterwards.

I've found the implementation of the OnRetrieveCoverArt. At this point it would easy to "turn to" my ExifExtractor to check if the item has an embedded and retrieve it. But how can I assign the retrieved image the the facadeView?

I tried something like this for testing (in the OnRetrieveCoverArt):
Code:
Bitmap tmpBitmap = new Bitmap(160, 120);
Graphics tmpGraphics = Graphics.FromImage(tmpBitmap);
tmpGraphics.FillEllipse(Brushes.Red,new Rectangle( 0, 0, 160, 120));

System.Drawing.Image img = (Image)tmpBitmap.Clone();

item.Thumbnail.MemoryImage = img;
But item.Thumbnail is always null. And create new GUIImage seems to need a filename again ...

The following code does work (Of course)... but this no solution.
Code:
Bitmap tmpBitmap = new Bitmap(160, 120);
Graphics tmpGraphics = Graphics.FromImage(tmpBitmap);
tmpGraphics.FillEllipse(Brushes.Red,new Rectangle( 0, 0, 160, 120));

System.Drawing.Image img = (Image)tmpBitmap.Clone();
img.Save("C:\\test.jpg", ImageFormat.Jpeg);

string thumbnailImage = "C:\\test.jpg";
item.ThumbnailImage = thumbnailImage;
Any ideas?

Bye
Lars
__________________
Using a wide screen and tired of changing the aspect ratio via remote all the time? Use the ViewModeSwitcher Plugin and everything is working automatically.
Are you able to find your home in MediaPortal? Yes you are! With the WorldMap plugin!
lkuech is offline   Reply With Quote
Old 2007-08-06, 10:28   #10 (permalink)
Retired Team Member
 
Join Date: Sep 2005
Posts: 618
Thanks: 5
Thanked 9 Times in 6 Posts

Country:

My System

Default

for me it works only if I specify a folder with jpg inside of it.

If I specify the folder above that, eg multiple folders the program just sits their doing nothing after i press start
__________________
go to the new My Music Wiki, to expand the capabilities of your music collection:
http://wiki.team-mediaportal.com/UsingMyMusic
idioteque is offline   Reply With Quote
Reply

Bookmarks

Tags
application, test

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MP Freeze with "Error in the Application - Exception in Microsoft Direct3D" LXB fixed 0.2.3.0 RC1 bugs 3 2007-06-20 01:46
How to disable recorded TV thumbnail creation Aquarius General Support 1 2007-01-24 09:45
Videos take forever to "catch up" when fast forwar tacroy General Support 4 2006-03-28 06:57
Disable folder.jpg thumbnail creation for picture folders? thorazine General Support 0 2006-01-12 19:02
Simplify the "My Application" thread Anonymous Improvement Suggestions 0 2004-10-24 10:58


All times are GMT +1. The time now is 02:26.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress