Gallery


Advanced search

Message boards : Website : Gallery

Author Message
Profile Istvan Burbank
Avatar
Send message
Joined: 3 Apr 08
Posts: 312
Credit: 58,920
RAC: 0
Message 9057 - Posted: 15 Jan 2009, 6:02:18 UTC

I was going thru my site a today, and remembered a project I made a few months go while I was learning PHP. This was my first project in PHP that I wrote from scratch, so don\'t laugh too hard:

http://istvan.us/php/gallery/index.php

It is an image gallery, which on-the-fly re-sizes all the images to thumbnail size, and displays them. When you click on one of the boxes you get a larger version of the image, again re-sized. There are two links, one of which takes you to a full-sized version of the image, and another which auto-magically scrolls down to where you were previously browsing. The re-sizing script doesn\'t distort the images at all, it simply finds the width/height of the image, and divides that by a number (compromises speed for margin of image size error) until it is below a margin; if the height/width is smaller to start with no scaling is applied. This means there is no caching of images. Another feature is captions. This script is designed to be easy for anyone to use, to create a new gallery simply place a folder containing files labeled 1.jpg 2.jpg etc. and a captions.txt file into a folder, into the main directory. The script generates the list of galleries and the gallery itself on the fly.

The reason I say all this is, that I am willing to take what I have learned and write a new script for burp (after I complete the rss torrent script). The idea being that the current \'session gallery\' page could be much more... interactive, customizable, etc.

i.e. you could say show me a gallery of all of X person\'s work, or show me stills of all the sessions. You could say show me the most popular sessions, or create a gallery for one session, showing every X frames (an image for frame 1, 20, 40, 60 etc).

Now obviously the script I wrote would need an overhaul, probably a re-write to work with burp, as the goals are different. This script was a project for me to learn from, and to use on a site where a non-techy person could log in with an ftp client and put a folder with some images and a file containing

caption 1 / caption 2 / caption 3

on to the server. If burp were to have a page like this, it would not be feasible to re-generate each image each time it was viewed. This could mean that the first time the script is called it generates the image and caches it, and later instances will simply return the cached image. It also means that captions wouldn\'t be stored in flat files, in fact most of the images would only have captions such as session number and frame number. This would also mean a completely different method to the sidebar, and overall a different look to fit the BURP site.

Why have a gallery such as this? Well I think it would be cool to use to find all the work one person has done, a place where you can look at some frames from a session all at once. An easy way for someone to come to burp\'s site and see what kind of work burp is able to churn out. Even a simple counter, that says \'just the images you see here would have taken one computer 10 years to complete\' or something like that would be a striking number to see. Taken even farther, a user could flag images to represent them, and these images would show up on a \'profile\' of their work. This would be a great place to link to in a forum, a page that has the best of your work. But the biggest reason I can think of is that Janus says in his profile (I think that is where I saw it) that one of BURP\'s original intentions was to show people some great blender animations. A page such as this would be a great place to spend time, looking at some of the beautiful work BURP has rendered.

~or this could all be a long rant of mine that is pointless because there is something underway already, or is un-feasible to do due to server limitations, or just doesn\'t need to be done - Istvan.

kraftman
Send message
Joined: 29 May 08
Posts: 12
Credit: 126,930
RAC: 0
Message 9060 - Posted: 15 Jan 2009, 10:32:01 UTC - in response to Message 9057.

what would be the difference between this and what the site has already? :S

Profile Istvan Burbank
Avatar
Send message
Joined: 3 Apr 08
Posts: 312
Credit: 58,920
RAC: 0
Message 9062 - Posted: 15 Jan 2009, 23:31:16 UTC

The page that currently exists only lets you see the sessions in reverse chronological order

http://burp.boinc.dk/gallery.php

and a separate script will let you see all of the sessions created by one user

http://burp.boinc.dk/my_gallery.php?userid=8896

What I have in mind is a script that would allow for more customization, where there would be a \'main\' gallery which could be sorter in either reverse chronological or chronological order. It would also have a \'hall of fame\' gallery, each user could have a gallery, and each user could create an \'album\' of their favorite works rendered on BURP. Also, each session could have a page with every Xth frame, etc.

Un-like my current test this script could also include videos, and would not require the specific naming of files. With the planned video streaming feature of BURP this one script could generate enough pages to show just about any kind of work, in any order, organized in any gallery.

Also, after some thinking about this script, I\'ve come up with a way to make it really easy to change/add to the stuff shown. by simply adding a function, and adding it to a list of functions to call, new features could be added. So to start the script might only allow images from all of burp. But then a module cold be written and another gallery would appear in the sidebar, making it possible to view images in another gallery. If a sub-module was created it could create sub-galleries. This would be useful to have because it means that if the script was well documented it would be easy for other developers to write simple PHP and be able to add to the BURP site much more easily. An example would be if a developer wanted to add the feature of following users, i.e. having the user\'s gallery in the sidebar, they would be able to write a function that adds an array of users associated with a logged in user to the list of galleries in the sidebar. The script itself would be fairly useless, only doing simple operations, but because BURP is open-source it means that developers have an easy way to contribute, without having to write their own page that provides some functionality.

~please leave your thoughts, and ideas for features that should be added for an \'api\' so that if this script does work out it can be done right - Istvan.

Profile Janus
Volunteer moderator
Project administrator
Avatar
Send message
Joined: 16 Jun 04
Posts: 4469
Credit: 2,094,806
RAC: 0
Message 9079 - Posted: 17 Jan 2009, 13:33:40 UTC
Last modified: 17 Jan 2009, 13:34:18 UTC

Ok, an attempt to summarize what you just said:
- You want to contribute something
- There should be a way to add sessions to a list of \"favorites\"
- The gallery should also allow sorting by chronologically ascending order
- You would like a separate page that displays the x\'th frame display (like the one which is on the session page next to the frame preview now)
- The session gallery should be more \"interactive\" somehow

Let me rephrase that in terms of todo-list items from the v.3 code:
- Session rating system that allows users to rate sessions with 1-5 stars. Average rating is displayed in session gallery, your rated sessions can be found on a home-subpage sorted by rating.
- Gallery search feature: Allow users to search in and sort the gallery display

Furthermore the X\'th frame display is replaced by streaming video. It is meant to be accompanied by the new \"multiple thumbnail system\" which will also be used for the screensaver (eventually). The revamped thumbnail system allows more than one thumbnail for each session and each thumbnail can define any portion of any frame in the session and can be displayed at any resolution. The first thumbnail output from this system is the one displayed in the streaming video player before you press \"play\".

Profile Istvan Burbank
Avatar
Send message
Joined: 3 Apr 08
Posts: 312
Credit: 58,920
RAC: 0
Message 9085 - Posted: 17 Jan 2009, 15:52:31 UTC

ah, ok cool. There are two other thing that I had in mind tho:

1. a way for each user to create a gallery of their own using selections of their work.

2. youtube has a system for subscribing to users, and looking at work that just they have done. I was thinking a one up from that. by creating a framework authors can make modules that allow users to subscribe to others, subscribe to a \'theme\' of videos using a search, or what ever else programmers can think of. My idea was to make a library and a display system, so other authors can add code that is useful to other people without worrying about replacing the curent system, or writing their own display code. in my example the sidebar is an array. each item in the array is printed on a new line, and the link is also generated on the fly (simply changing a GET variable). in my idea for a BURP version an author could write a module that searches using functions in the library, and then drops the results in the array. to add this functionality the author would simply use some pre-written functions that search for users, sessions, keywords in sessions, etc. the author could call a function that asks the user for a string. The author\'s script might process that string, call the search, and drop the results into a variable. really simple.

Why? well figuring out pre-made css, the database functions janus wrote, and variables that exist in BURP pertaining to sessions took me lots of hunting, poking, and asking. the script I have in mind would have a text file that goes along with it, or is placed at the top of the script that has a list of functions that can be called, how to use them, where to put the result of your script, and examples.
Another reason is that this means that if a developer has a feature they want to see in the image gallery they do not have to re-invent the wheel. This would allow many authors to create an extremely powerful, and useful image gallery, but maintaining one of the hardest and most important aspects to having muli-developer pages: consistency. authors would not write css, or create new sidebars.

~if it clears it up any, I took a look at facebook a few days ago, and realized that most of the draw (i think.. i don\'t use facebook) is created by other people making new games, and other modules (i\'m not sure what facebook calls them). I realized that BURP could become like that in a way, in that many people could add functionality and features, but might get bogged down in the issues i\'v raised above - istvan.

Profile Istvan Burbank
Avatar
Send message
Joined: 3 Apr 08
Posts: 312
Credit: 58,920
RAC: 0
Message 9103 - Posted: 19 Jan 2009, 1:22:06 UTC

Ok, well I thought this would be a fun project to make anyway, just to give to anyone that wanted it. It will be designed to fit into any existing infrastructure, so if BURP does decide to use it, the script would integrate extremely easily.

Profile Janus
Volunteer moderator
Project administrator
Avatar
Send message
Joined: 16 Jun 04
Posts: 4469
Credit: 2,094,806
RAC: 0
Message 9109 - Posted: 19 Jan 2009, 22:48:18 UTC

Alright. Please understand, however, that the aim of BURP is to develop a publicly distributed 3D rendering system. To accompany the 3D rendering system a minimal web-interface is added on top to allow users to communicate easily with the system and each other. The BURP website itself is merely an example of what you could build using BURP. In that spirit the website is being kept simple, yet functional.
We don\'t necessarily want hypercomplex expandable custom search features or dynamic sidebars that can be extended to show what the weather is like in the southern Greenland region (exaggeration to improve the point). Maybe we just want a regular search feature and static sidebars because it gets the job done and is simple in every aspect.

However, you may be very interested in knowing that in BURPv.3 there are other interfaces than the website for accessing BURP. More specifically an XML-RPC interface is being developed which gives anyone easy access to the data and control layers of the backend.
This may sound a bit technical, but I think this is exactly what you are asking for, but delivered in a slightly different way. Using XML-RPC you will be able to build a website on top of BURP - your own personal website that shows whatever you want it to show and displays it in whatever way you want it to be displayed.
This is very similar to how the statistics sites work now - except that the data will be about sessions rather than credit, live rather than extracted from stats files and two-way rather than only reading information from the project.

An example application could be a Facebook module where you can show your friends your favorite BURP sessions, maybe even let them rate the sessions.

Perhaps even more interesting is that the use of the XML-RPC is not limited to websites - and the real power of the system comes to play when BURP is used as a service in another application; for instance to queue and manage sessions directly from within Blender.

The XML-RPC interface is not yet complete but you can have a look at what it offers so far (creating and listing sessions) in the burp3/html/xmlrpc folder.

With all of that said you are of course still free to develop the features you mentioned (you may even be able to use them together with the XML-RPC system to create a custom BURP site). All I\'m saying is that it is unlikely that features that make the website dramatically more complex will be accepted into the main BURP CVS repository and deployed here if they are merely \"nice to have\" rather than \"required\".

Profile Istvan Burbank
Avatar
Send message
Joined: 3 Apr 08
Posts: 312
Credit: 58,920
RAC: 0
Message 9120 - Posted: 20 Jan 2009, 0:01:54 UTC
Last modified: 20 Jan 2009, 0:25:12 UTC

If that interface was well documented it could be a really cool tool to use!

I\'m not sure I stated the purpose of the script well, what I was really getting at was more that the functionality of many pages could be logically put into one script. I have a test version of the script up-and-running, and I will create a short video soon showing what it does.

The ability to add functions is not to have one page that does it all, but rather functions that can be customized to the needs of the script. The way I have it working is that there is a sidebar, and a main body of the page. The default script takes an array and turns it into the sidebar, and runs ONE function to create the body. Which function is executed is controlled by the user. the url has a get variable called \'action\', and if a user wants to search a function gives them a page to search with. Then they are presented with a few choices of search methods, in the examples case right now only image titles, and that selection calls another function that does the search, and presents the data.

The test I have so far can be found here:
http://istvan.us/php/gallery2/image_gallery.php

Note, the user can not run any function using the action, only ones that are approved. There are also features in this such as an image re-sizer that creates two sizes of images, and does so without distortion and rather quickly.

This would be good for BURP if it was used because on this one page a user would be able to call one function to search per user, or another for session name, or session forum comments. The script starts fairly featureless, and only features for burp would be used on a burp instance of the scripts.

[quote] the website is being kept simple, yet functional. [\\quote]

So in this case simple because there are less scripts/pages but functional because any amount of functionality can easily be added without cluttering the site with new pages and sections, and sub-sections etc.

Profile Istvan Burbank
Avatar
Send message
Joined: 3 Apr 08
Posts: 312
Credit: 58,920
RAC: 0
Message 9165 - Posted: 23 Jan 2009, 5:20:03 UTC
Last modified: 23 Jan 2009, 5:21:15 UTC

[edit:] The linking system seems to place ticks in the link, which will need to me be manually removed if you click the image!

Not to press too hard, but here is a screen shot of the current version, and ideas for the future:



So here I have made some notes as to how the gallery could work, and this system is designed to be easy to make fit an existing design with css, and also to fit an existing db system. The functions I have been talking about would allow one to do things such as this:



So here I have commented a little on what I\'m thinking. So for example, searches that would only apply to burp, and such. The sidebar could be on the right side, with the burp-sidebar look etc.

Why? well if i havn\'t said already, because it would be easy to look for a session, for example search for a session by \'Istvan\' with \'Dominoes\' in the short description. then you have a bunch of thumbnails of the projects that you are looking for. Want to see one bigger? no problem. Want to see the session page? well the link is there! The whole purpose of this editable functions is to do just that, to make each image link to a session, and match a title without changing the script structure.

The version from which those screen shots are from is very old, and it shouldn\'t be used as a guide to the future.

For anyone who cares here is the plan:


  • I have started to build a framework, where basically a few variables are turned into a page. The sidebar is an array for example, so the script takes the array, and displays it with proper formatting etc. Each \'image box\' is put into the correct div tags. The idea is that now to make a page you write a function that makes an array for the sidebar, and one that calls the thumb script and hands it the title, image link, and a few other things, and it will put them all in place with proper div tags, and classes, and formatting etc. All of this means that the page is consistant; the coder doesn\'t have to format each function they write, they use pre-build formats.

  • Then I will create a larger library to use. Not every function will be used, but it will be there. So if the coder wanted to create a function that makes a larger sized image preview they have a documented function to call. If they don\'t need this then it is there un-used.

  • I will eventually hand the code to the PHP community, and moderate other people\'s functions to create a huge library of functions.

  • I will then work on creating a simpler method to setting it up, a system of interconnected functions, so that a non-php coder could set it up without reading code, just typing a function name into a variable.



If anyone has ideas please say so, as if I get the OK to go ahead and develop for BURP I will make the first item on that list above to make a version that is designed for BURP. This would mean the first functions would be specific to ones that BURP would need.

~the thought being continuing that idea of simple, but functional.

Profile Janus
Volunteer moderator
Project administrator
Avatar
Send message
Joined: 16 Jun 04
Posts: 4469
Credit: 2,094,806
RAC: 0
Message 9172 - Posted: 24 Jan 2009, 17:00:05 UTC - in response to Message 9165.

I can\'t seem to be able to load the images from your image host. It is probably down.

Profile Istvan Burbank
Avatar
Send message
Joined: 3 Apr 08
Posts: 312
Credit: 58,920
RAC: 0
Message 9181 - Posted: 25 Jan 2009, 16:08:18 UTC

That host is down, and if it continues to be then you might want to delete those links to make the page not time out. The images can be found here:

http://istvan.us/burp/


Post to thread

Message boards : Website : Gallery