Thumbnail support for photos (RealFile.java)

Discuss issues related to PS3 Media Server development (only for programmers)

Re: Thumbnail support for photos (RealFile.java)

Postby tomeko » Tue Sep 14, 2010 7:03 pm

This patch is for r410 and I have Bravia KDL-40V5500. Max thumbnail size should be 120x120 (required by DLNA specification).
tomeko
Project Member
 
Posts: 154
Joined: Sat Jun 06, 2009 11:02 am

Re: Thumbnail support for photos (RealFile.java)

Postby patters » Wed Sep 15, 2010 7:29 pm

If I try to apply your patch to r410 from SVN I get:

patching file net/pms/configuration/ConfigurationProgramPaths.java
Hunk #1 FAILED at 14.
patch: **** malformed patch at line 22: }


Other patches, like WorldOfHurt's content range patch are fine. Is it caused by mismatches between tabs and spaces when I click Select All and copy it from this forum's CODE block? Could you attach it as a ZIP file please?
patters
 
Posts: 97
Joined: Sun Apr 11, 2010 12:06 pm

Re: Thumbnail support for photos (RealFile.java)

Postby tomeko » Wed Sep 15, 2010 9:38 pm

There's updated files.
Attachments
pms_image_thumbs.zip
(24.16 KiB) Downloaded 167 times
tomeko
Project Member
 
Posts: 154
Joined: Sat Jun 06, 2009 11:02 am

Re: Thumbnail support for photos (RealFile.java)

Postby patters » Thu Sep 16, 2010 9:07 am

Thanks tomeko. That works now! I've attached what should be a working patch taken from your files (no changes by me) using Tortoise SVN. I would suggest 160x120 rather than 160x90 for the thumbnail size though since that's what Windows Media Player's DLNA server uses and most photos are 4:3 aspect.

The Sony Bluray player needs the same special changes that IsBravia=true makes in the code. For that reason, in my changes for the Bluray player I created a new renderer conf file boolean called ForceJPGThumbnails to replace the IsBravia logic. The Sony DBP also doesn't seem to use the full size of the icon unless I set the dimensions to 160x120. The quality of the displayed thumbnail is bad though (jagged lines on diagonals), suggesting a much lower resolution. However the imagemagick thumbnail is fine so I wonder if it's maybe caused by failing to declare the file size and resolution of the thumbnail in the res tag. I'll test that tonight.

I also need to figure out why the Bluray player will show thumbs for photos but not for videos even though they are presented in exactly the same way... It all works on my Bravia KDL-32V5500 though.
Attachments
tomeko_image_thumbs.zip
patch for r410
(2.07 KiB) Downloaded 123 times
Last edited by patters on Thu Sep 16, 2010 6:34 pm, edited 1 time in total.
patters
 
Posts: 97
Joined: Sun Apr 11, 2010 12:06 pm

Re: Thumbnail support for photos (RealFile.java)

Postby tomeko » Thu Sep 16, 2010 10:24 am

tomeko wrote:Max thumbnail size should be 120x120 (required by DLNA specification).

My mistake, max thumbnail size should be 160x160.
tomeko
Project Member
 
Posts: 154
Joined: Sat Jun 06, 2009 11:02 am

Re: Thumbnail support for photos (RealFile.java)

Postby patters » Fri Sep 17, 2010 1:18 am

I've had a better look at the jaggy pixelated look of the thumbnails. It seems like the Sony renderers are taking the 160x90 image and rendering it at an even lower res - perhaps half of that. On the Bravia it's less obvious because the image is anitaliased (blurred), but on the Bluray you can see it on any diagonal lines in the image. However, by comparing the same images served from Windows Media Player I can see the same problem so it must be the renderer - not the way PS3MS is serving.
patters
 
Posts: 97
Joined: Sun Apr 11, 2010 12:06 pm

Re: Thumbnail support for photos (RealFile.java)

Postby WorldOfHurt » Fri Sep 17, 2010 8:57 am

Sounds like a good argument for renderer-configurable thumbnail support, with the Sony/WMP renderers having forced blurring to avoid the jaggies...?

Just my 2c :)
User avatar
WorldOfHurt
 
Posts: 252
Joined: Thu Mar 19, 2009 10:49 pm
Location: Winchester, UK

Re: Thumbnail support for photos (RealFile.java)

Postby Illico » Fri Sep 17, 2010 9:19 am

DLNA JPEG_TN thumbnails
The resolution of the image must not exceed 160 pixels in the Width field and must not exceed 160 pixels in the Height field.
The MIME type for this image profile must be "image/jpeg".
- EXIF Ver.1.x or later
- JFIF 1.02
Color space:
- sRGB
- Uncalibrated color space.

DLNA PNG_TN profile thumbnails
The resolution of the image must not exceed 160 pixels in the Width field and must not exceed 160 pixels in the Height field
The MIME type for this image profile must be "image/png".
The total number of bits needed to represent a color must not exceed 24 bits.
Sony Bravia KDL-46EX501 | Sony BDP-S373 | Sony SMP-N100 |Serviio / PS3MS | Buffalo 2Share DD
User avatar
Illico
 
Posts: 129
Joined: Wed Jun 30, 2010 2:28 pm
Location: France

Re: Thumbnail support for photos (RealFile.java)

Postby patters » Sat Sep 18, 2010 12:37 am

If you comment out the delete lines in the code as tomeko pointed out on the previous page and open up one of the imagemagick 160x120 thumbnails on the PC it's actually quite detailed (no bad jaggies, even on the ones that look bad on the TV) so it's pretty clear that the Sony renderer is doing some kind of lower quality approximation of it. Blurring it in advance probably won't help. Re: WMP - my point was that if I take the photos with jaggy thumbnails in PS3MS and serve them from WMP's DLNA server, the resulting thumbnail is identical on screen to the one PS3MS generates. I didn't mean WMP was used as a renderer. I wonder why the Bluray players seem to ignore JPEG_TN resources for music and video.
patters
 
Posts: 97
Joined: Sun Apr 11, 2010 12:06 pm

Re: Thumbnail support for photos (RealFile.java)

Postby patters » Sat Sep 18, 2010 7:00 pm

I have tested that tomeko's patch works well on Mac OS which is great because my photos are all stored in iPhoto, which it picks up fine. The only trouble is with Imagemagick. My method is this - I download the 409 beta for Mac OS, right-click and 'show package contents' on the app. Then I replace pms.jar inside the app with my patched and compiled one from Windows. Then I put Imagemagick's convert binary into the /Resources/Java/osx folder within the app. Despite downloading the Imagemagick Mac OS binary release and following the steps outlined here to set the environment variables for the library paths, they are not picked up when the convert binary is invoked from Java. Is this because the JVM runs in a different user context perhaps? I get this in the log:

Code: Select all
[Thread-23] DEBUG 18:41:54.822 dyld: Library not loaded: /ImageMagick-6.6.3/lib/libMagickCore.4.dylib
[Thread-23] DEBUG 18:41:54.822   Referenced from: /Applications/PS3 Media Server.app/Contents/Resources/Java/osx/convert
[Thread-23] DEBUG 18:41:54.822   Reason: image not found


The simple fix is to just copy the whole Imagemagick folder to the root of the filesystem. Not ideal but it works! I guess the next challenge will be to transcode non renderer supported image mime types to JPEG using Imagemagick.
patters
 
Posts: 97
Joined: Sun Apr 11, 2010 12:06 pm

Previous

Return to Developers

Who is online

Users browsing this forum: No registered users and 0 guests