Pictures in web browse

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
mrrouge
Posts:5
Joined:Mon Sep 03, 2012 2:29 pm
AV Hardware:Qnap 219p+
Samsung PS59D550
Pictures in web browse

Post by mrrouge » Mon Sep 03, 2012 3:37 pm

Hello,

I have just installed TwonkyServer Premium 7.0.9 on Qnap NAS, and modified some code to access from wan at port 9000 to solve the internal lan IP problem. Now it works.

The web browse is very fast compared to all other products, and i found it very useful for access my photos from outside.
The only problem is that when i click on a thumbnail, i can only display a picture at 100% size, and it takes too much to download. It is possible to set a resize, like 1024x768?

Thank you very much!
R.

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Pictures in web browse

Post by phibertron » Mon Sep 03, 2012 7:34 pm

In the config.js
go to the function loadMediaContents
scroll down till you get to the section case "P":
the last few lines of this very small section look like this

else $(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '" target="_blank"><div class="allPhotosItem"><img src="' + thumbnailData.link + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'P\')" style="' + thumbnailData.clip + '"/></div></a>');
break;
case "M":

change the part that starts like this

else $(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '" target="_blank">

to this by adding ?scale=1024x768

else $(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '?scale=1024x768 " target="_blank">

Note:

this effects local web browse also
It might be possible to use an if then based on the external url being used to access the page
to do this only for that url
for example, if the url being used was http://myhouse.com:9000 then do it, else dont

also,

say you were accessing it remotely, and you did want the actual full size file
with the picture open in the browser, just delete the ?scale=1024x768 from the url and hit enter
and it will load the full file unscaled from the server
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

mrrouge
Posts:5
Joined:Mon Sep 03, 2012 2:29 pm
AV Hardware:Qnap 219p+
Samsung PS59D550

Re: Pictures in web browse

Post by mrrouge » Tue Sep 04, 2012 9:46 am

Thanks, it works perfect now!
I was trying to create/edit a profile, but it wasn't working, now it's fixed.
BTW how fast is Twonky with pictures!!!


R.

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Pictures in web browse

Post by phibertron » Tue Sep 04, 2012 3:32 pm

Glad to hear its working for you
Yeah, a client profile tactic could/should have worked
Ill take a look at that idea, as it is an interesting idea
outside of getting it to work, assigning it to the wan is the curious part
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

mrrouge
Posts:5
Joined:Mon Sep 03, 2012 2:29 pm
AV Hardware:Qnap 219p+
Samsung PS59D550

Re: Pictures in web browse

Post by mrrouge » Tue Sep 04, 2012 4:17 pm

Of course, the media renderer in this case is the lan gateway's ip, but i'm very new so it's very likely that i did something wrong trying.
It should be useful also a profile with customizable pagination, as the default is only 35 items per page.

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Pictures in web browse

Post by phibertron » Tue Sep 04, 2012 4:25 pm

You can modify the pagination count be editing var largeMediaBrowsePageCount = in the config.js
Not sure If we can alter that variable via a client profile setting
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Pictures in web browse

Post by phibertron » Tue Sep 04, 2012 5:01 pm

I was able to get the resize to work from a client profile
I put the following example profile in the devicedb folder, and restarted the server
so that it would be picked up as a choice to use

Remote_Client_Profile.xml

Code: Select all

<Client>
	<DeviceId>
		<DisplayName>Remote Client Profile</DisplayName>
		<MappingUpdatePolicy>FIX</MappingUpdatePolicy>
	</DeviceId>
	<Capabilities>
		<Scaling>
			<Target>JPEG1024x768</Target>
		</Scaling>
	</Capabilities>
	<Adaptations>
		<DLNA>
			<Version>DLNA15</Version>
		</DLNA>
	</Adaptations>
</Client>
Note:
there is a bug in function updateMediaReceivers(element, data) in config.js
It affects the reliability of what you see in the list, and thus what changes are made to it

change the following

data.pop(); //delete last element

to this

//data.pop(); //delete last element

Also,
there seems to be a bug in auto detect of clients
in that, even if one changes the client profile
on server restart the client gets auto detected
not sure what profile twonky is assigning the client from the wan ip
but in any case, you can just change it once connected if need be
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Pictures in web browse

Post by phibertron » Tue Sep 04, 2012 5:41 pm

I just changed a setting in my example
to resolve the change not surviveing a server reboot
worked perfectly
so basically you need to connect via the wan, and then edit the profille to the remote client profile
hit save settings, and you should be all set

I changed <MappingUpdatePolicy>AUTO</MappingUpdatePolicy>
to <MappingUpdatePolicy>FIX</MappingUpdatePolicy>

This is from the definition from the clients.db for what MappingUpdatePolicy does

FIX, AUTO, FIXPC
set to FIX if the entry can only be overruled by manual user interaction,
FIXPC for PC software clients,
set to auto if a different client identify string can overrule this entry
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

mrrouge
Posts:5
Joined:Mon Sep 03, 2012 2:29 pm
AV Hardware:Qnap 219p+
Samsung PS59D550

Re: Pictures in web browse

Post by mrrouge » Wed Sep 05, 2012 10:10 am

Maybe someone already did this, however:

You can browse your photos with Lightbox too.
It works and it's superb imo, except for no back and forward arrows to move between photos.

1) You have to download the package from Lightbox website and upload to /webconfig

2) Then edit index.htm:

(I used Lightbox jquery:)
<!-- <script src="/webconfig/jquery-1.5.1.min.js" type="text/javascript"></script> --!>
<script src="/webconfig/js/jquery-1.7.2.min.js"></script>

add also Lightbox css and lightbox.js

3) Then in config.js edit:
- else $(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '?scale=1024x768 " rel="lightbox">

done!

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Pictures in web browse

Post by phibertron » Wed Sep 05, 2012 8:49 pm

Very Interesting, will take a look at it
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

mrrouge
Posts:5
Joined:Mon Sep 03, 2012 2:29 pm
AV Hardware:Qnap 219p+
Samsung PS59D550

Re: Pictures in web browse

Post by mrrouge » Thu Sep 06, 2012 1:22 pm

two more side questions:

1) scaling is very fast but the output quality is low. it is possible to find a balance with some anti-aliasing?
2) it wolud be very nice to have prev/next buttons working in Lightbox. Play slideshow a dream?

thanks for any help!
R.

Locked