Page 1 of 1

Pictures in web browse

Posted: Mon Sep 03, 2012 3:37 pm
by mrrouge

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!

Re: Pictures in web browse

Posted: Mon Sep 03, 2012 7:34 pm
by phibertron
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="' + + '" target="_blank"><div class="allPhotosItem"><img src="' + + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'P\')" style="' + thumbnailData.clip + '"/></div></a>');
case "M":

change the part that starts like this

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

to this by adding ?scale=1024x768

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


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 then do it, else dont


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

Re: Pictures in web browse

Posted: Tue Sep 04, 2012 9:46 am
by mrrouge
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!!!


Re: Pictures in web browse

Posted: Tue Sep 04, 2012 3:32 pm
by phibertron
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

Re: Pictures in web browse

Posted: Tue Sep 04, 2012 4:17 pm
by mrrouge
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.

Re: Pictures in web browse

Posted: Tue Sep 04, 2012 4:25 pm
by phibertron
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

Re: Pictures in web browse

Posted: Tue Sep 04, 2012 5:01 pm
by phibertron
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


Code: Select all

		<DisplayName>Remote Client Profile</DisplayName>
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

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

Re: Pictures in web browse

Posted: Tue Sep 04, 2012 5:41 pm
by phibertron
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

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

Re: Pictures in web browse

Posted: Wed Sep 05, 2012 10:10 am
by mrrouge
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="' + + '?scale=1024x768 " rel="lightbox">


Re: Pictures in web browse

Posted: Wed Sep 05, 2012 8:49 pm
by phibertron
Very Interesting, will take a look at it

Re: Pictures in web browse

Posted: Thu Sep 06, 2012 1:22 pm
by mrrouge
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!