Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Image Gallery/Picture Post

Quote Reply
Image Gallery/Picture Post
I'm easily sidetracked. I admit it.

But, I came across a program I had looked at before, and this time, was bitten to buy it for a number of reasons. The major one (besides mis-interpreting what it offered) was it seemed to be built on top of a links 2.0 (flat file) shell. Looking at the code, it's not, really. But it's using a design from an old dos/windows "database" program from 10 years ago, with numerous files making up the "database" linked by filename relations.

Anyway, this isn't the point.

The point is, that sitting back, looking at the issues, I can turn Links SQL 2.0 into a thumbnail gallery, picture post, postcards application fairly easily (templates/graphics aside). It requires a few mods to a few routines, database changes, and then an upload/convert set of utilities which seem to be based on ImageMagick as the standard now (that is included in many Unix systems now, and is [fairly] easily installed via CPAN or direct).

Let me explain a few things (those of you around almost 2 years ago might remember some of this from some musings at that time).

1) This is geared as a scalable solution, so that if you have 20 photos, it's exreme overkill, but if you grow to 20,000 the same process should work without change.

2) It does _not_ use flat file, multiple odd, hodgepodge linking. It's all SQL database/table based.

3) For now, (this stuff can change most likely once the program is actually working -- ie: bells and whistles) -- it has to make a few assumptions, based on stock-agency type indexing.
3a) each photo has a UNIQUE name/index number (this does not exclude a download name, title, etc)
3b) thumbnails have the same name as the main file, and are generated and kept in a subdirectory. (I thought about doing .EXT .ext, but that only works for Unix, and creates _major_ problems in the long run.) (I thought about using prefix or post-fix notation, but those have severe problems as well.)
3c) Disk layout does _not_ necessarily have to match the "gallery" layout. What this means, is that images can be kept on-disk in any format you want, by author, by year, etc, while the "directory" can be kept in a human-friendly format by category, or whatever. This is done by a relation such as the CatLinks file (more complex, but go with it for now).
3d) The Database and Images can be re-linked, if necessary, so that if the system got mixed up you can regenerate the directory from the database & vice versa, so that reorganization doesn't destroy the system.
3e) The file-name is the link between the database record and on-disk layout. This means for this "disaster" type system to work, each file must have a unique name matched to the database record. This is not a requirement for the system to work, but only for it to work well ;)

4) As few changes to routines in Links SQL as possible will be made to make it work. Once the plug-ins system is fleshed out completely, it might be able to be turned into that.

5) SUGGESTIONS: if you run this sort of site, or want this sort of site, please let me know now what features you need. Or what sites you like the functionality of.


I'm basing this on 2 years of trying to run the postcards sites, and manage what is really a very large image database. It has _not_ been viewed from the "picture post" or "adult" site angle, so there might be things I haven't thought about in that direction.

Hopefully I'll have a display-only version in a day or so. Maybe that will help with generating ideas.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
Can't wait to see it!


Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: Image Gallery/Picture Post In reply to
Hi ya pugdog.... fancy seeing a post about this :)

I really want this sort of feature hence showing it to you. The only thing is the program costs like $200 and another license for links would cost double this. So the natural question is will i need another license to use this as a picture post as i would love this feature.. or will it be a plugin (can't see how really) but might as well ask.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post In reply to
I reall should read more, you even said it could be a plugin. That would simply be.. well amazing :)

Ok things...

1) Automatic generation of database. Upload the files by FTP, press go and it fills the database.
2) Automatic generation of thumbnails using imagemagik i guess (i hear this is hard to install though....)
3) Possibility of having images on a different server, could the program FTP into the server (can with PHP not sure about CGI) look at them all there and then create the database that way? I hope that would be possible
4) Something like the lightbox or favourites thing at Imagefolio although this would just be some sort of modification of Jerry's Su mylinks.cgi
5) Multiple ways of viewing, as a gallery type system and also a 1 by 1 type thing as a pop-up with left and right buttons and simple going through that category.. (really a template thing i would think).
6) Upload needs admin checking i guess like links already has so shouldn't be hard....

thinking about it links SQL is really perfect for this so many things can be modified from it, hope it happens pugdog (as a plugin :) )

cheers.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post In reply to
Pugdog,

Great idea. Here's a peek at a script that I just bought and installed: (don't know if it's the same one you're talking about)
http://demo.imagefolio.com/...i-bin/imageFolio.cgi

They have a few nice features which include which you can read here:
http://www.imagefolio.com/features/pro.shtml

They've integrated their postcard script with their galleries which is kind of nice. Here's what I'd like to be able to do...which their script can not yet and I think LinksSQL is well positioned to manage this:

1) I'd like to be able to provide each of my users (currently in DBMan) with their own photo gallery or portfolio. Think about http://www.photonet.com/, that's the concept. True photo sharing with the option to choose whether you images should be available publicly or not.

2) Users should be able to add, delete and admin their images

3) Thumbnails should be created automatically... check their upload Add-on demo, it actually does this.

Now, I'm not much of a coder but I'd love to help with ideas and testing. Go for it!

Safe swoops
Sangiro
http://www.dropzone.com/
Quote Reply
Re: Image Gallery/Picture Post In reply to
Funny you should mention that....

But if you strip away the cute graphics, (and realize their site is running links 2.0) you have a program that is more of a shell than an application, and is quite fragmented both logically and database wise. I was curious how close they were to running Links 2.0, since they followed the Links naming convention. It's not even in the same species -- which is good for GT, but not necessarily for them.

Anyway... Significantly lighter in the pockets, I see this functionality as a plug-in or add-on to Links.

I think I can even make my postcards program a plug-in, without needing a new license, by adding a bit of overhead to the database records and build code.

-- all of this is related. As I work on one project, others that comprise parts of it make themselves evident. Which is why I understood the 6 month delay in Links NG, even if it drove me crazy.

I don't think I can release this as "free" code, for the same reasons as the postcards script, but it will be affordable, and certainly run as well as the rest of your site.

If anyone wants to contribute, there are two things right now that I could use someone else working on.

1) A program that will read a directory tree, match the files in 'directory' to the files in 'directory/thumbnails' and if they don't exist, call the routine to create the file. I have a source for the routine to do the conversion, but the directory traversal script is just a matter of time and work. This script should be the same format as the other Links scripts, since it will be part of the whole, and will be expanded to do the _reverse_ lookup as well. That means it should expect a starting directory as a parameter, and it's aware of any of the links variables in the $CFG hash. The directory walking code should be separate from the "do something" code, so that the "do something" code can be anything, such as #2 below.

2) A program that will read through the files in the directory, get the dimentions and file sizes, and insert them into the SQL database. These routines are part of ImageMagick, and just have to be called with the GT libraries to do an "update" of the matching record (by filename). This is actually just a "routine" to add to the program in #1

3) Graphics. This is the buttons for naviagtion, templates, etc. These should be "modular" meaning the can be inserted in a site's existing layout in the area between the

--- content start ----

--- content end -----

tags, in the same place you would put the <%category%> or <%links%> tags, for example.

For example, the ImageFolio pages are a good example, except it should be flexible enough to allow 1-6 columns, and an unlimited number of rows.



This can be a real group project, since 90% of the changes need to be in the templates, with about 10% to various routines and output codes.

It seems to be something people really have been asking for, and the more help with it from the group here, the faster, more robust, and less expensive any code I have to add will be. :)

As I said, I hope to have a demo site up in a day or two. I'm actually going to modify my beta4 site for postcards.com to work this way, so it will be a "real" site, not a "demo".



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
>> 1) Automatic generation of database. Upload the files by FTP, press go
>> and it fills the database.

This is possible, only if certain assumptions are made. In order to allow most flexibility, a combination of point and go, and user intervention is required to initially add images. (for instance, if disk location and directory location are un-linked, then some way of inserting the images into a category has to be applied -- understand?)


2) Automatic generation of thumbnails using imagemagik i guess (i hear this is hard to install though....)

It is hard, since I can't seem to reinstall it via CPAN, but I did manage to re-install 5.20 manually. I also installed the first version 4.?? on my system within the first few months of operating my server, so it can't be _too_ hard. Because it's included with Linux now, there is probably extra help out there to do it. There is also a script by a 3rd party I use to generate my current thumbnails, which is an interface into those modules.


3) Possibility of having images on a different server, could the program FTP into the server (can with PHP not sure about CGI) look at them all there and then create the database that way? I hope that would be possible

This is something I'm not going to deal with right now. Too many variables. If someone wanted to do it, it probably wouldn't be hard to do, as long as the script I mentioned in the last message was flexible enough to accept a remote directory as a location.

I don't see it being very complex for the program to ftp to a server, using LWP, or similar, and retrieve the images, and generate local thumbnails, the trick would be relating the foreign URL to the local image.

Again, this is _definitely_ not going to be version 1 or 2 <G>


4) Something like the lightbox or favourites thing at Imagefolio although this would just be some sort of modification of Jerry's Su mylinks.cgi

This is just a variation of the "mylinks" or "favorites" situation. How it would be implemented is dependent on the final version of LInks and how much we can do with the user records, as I am more comfortable linking certain things into the user record and associated tables than into cookies and/or sessions.

5) Multiple ways of viewing, as a gallery type system and also a 1 by 1 type thing as a pop-up with left and right buttons and simple going through that category.. (really a template thing i would think).

This would be templates. With static pages, it would require a special build, such as a thumbnail gallery, but with dynamic pages, would most likely be quite trivial.

6) Upload needs admin checking i guess like links already has so shouldn't be hard....

I don't like _any_ automatic visibility thing. I'm a BBS Sysop from the early days. I don't know what sort of file upload Alex has in mind, but hopefully it can be integrated with this easily, since whatever I come up with will be a basic add. I will have a way for users to submit individual images, but the Admin will really be required to upload via FTP and let the program find, thumbnail and present them for insertion and validation.


>> thinking about it links SQL is really perfect for this so many things can
>> be modified from it, hope it happens pugdog (as a plugin :)

I actually haven't found anything that can't really be done with it.

Which is why once it's finished, I wish Alex would concentrate more on developer libraries, and encourage development of other products using the core engines, so that a modular group of programs based on a core set of development tools could be started.

I have no desire or interest in low level coding. I'm more of an applications and interface programmer, and always have been.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
>> 1) Automatic generation of database. Upload the files by FTP, press go
>> and it fills the database.

This is possible, only if certain assumptions are made. In order to allow most flexibility, a combination of point and go, and user intervention is required to initially add images. (for instance, if disk location and directory location are un-linked, then some way of inserting the images into a category has to be applied -- understand?)

###
I think so, i imagine what i would mean is that you could upload a whole lot of images to directory /blah and press GO and then the images are added but with a custom name ie the category name does not have to be /blah.

A possible solution might be to have a .txt file inside each category which gives the script the inital details for that folder's details (ie category name, related categories etc). That might work.. but i am sure you know best here!

2) Automatic generation of thumbnails using imagemagik i guess (i hear this is hard to install though....)

It is hard, since I can't seem to reinstall it via CPAN, but I did manage to re-install 5.20 manually. I also installed the first version 4.?? on my system within the first few months of operating my server, so it can't be _too_ hard. Because it's included with Linux now, there is probably extra help out there to do it. There is also a script by a 3rd party I use to generate my current thumbnails, which is an interface into those modules.

###
Well if you find it even hard i have no chance. Do you mean the script that you use to generate your thumbnails needs imagemagik?

3)

Understood, it is not essential at all just a thought.

4 & 6 waiting for Alex i guess :).

Thanks though Pugdog, i really like this idea (but hope it will be a plugin as opposed to requiring a full linksql install).

Cheers,



http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post In reply to
oops.. didn't see the 1st post plugin will be cool. and charging is fair for all the work you are putting in.

I will think about the templates for it and see if i can come up with something that we could use.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post In reply to
oh one thing, pugdog wouldn't this be part of any postcard script? Ie this displays all the images and then there is a call to a postcard script like the postcard script is a plugin to this section, like imagefolio is or have i misunderstood how you are doing your postcard system?

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post In reply to
I'm probably going to integrate the two. It's something I've been thinking about for a long time.


PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
cool. I am looking forward to this. Good luck with it!

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post In reply to
Got it working for my postcards site. The display is like a slide page, or a table/grid like Image folio. (no neat graphics though).

Right now, the settings are set in the code, you have to edit the options, but hopefully I'll be able to make at least that part a plug-in.

I need some sleep, then I need to update the database records and the templates to show the various options -- then I have to create them <G>

Right now, you have to FTP the images up, FTP the thumbnails up, and enter them into the Links database manually as you would any link. But, you have to crawl before you can walks... :)

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
Ok,

I have several template sets working.

1) slides (for pictures that fit into a nn x nn square)
2) tables (for pictures that are odd-sized, either width fixed, or height fixed)
3) Tables - with and without headers/footers

These are randomly displayed in the demo, so each page that is called will look differently.

I can't really add in too many more features until I get a script that will read through the photos and insert height/width/size information into the database.

Any takers on that??? So I can keep working on the interfaces??



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
>> Any takers on that??? So I can keep working on the interfaces??

I'll give you a hand! Just email me at bocyber@aol.com or tell me here. :)

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: Image Gallery/Picture Post In reply to
What I really need is a script that walks through the directory tree, and inserts the height/width/size data into the links database.

Even a script that walks through the directory and writes the information to a delimited file, would be ok, since I can parse that and import it.

My mindset is so far away from flat-file manipulation, that things that used to be very easy, seem like hurdles to me now. Putting the data into the Links/SQL database is not hard for me (and it's probably what's hard for most people). Recursively walking through the directory, getting the list of files, opening them one by one, and getting the size/stats info and writing that out _is_ harder for me than the SQL queries (which used to be nothing but black magic) --and directory walking is one of the first things you do when you start programming!!

Send me an email, and I can send you some information to help you along your way, if you want to do this program.







PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
Error messages--->

"Send This Image"

In Reply To:

A fatal error has occured:

Invalid method: site_html_step2.html (step2.html.html)
Please enable debugging in setup for more details.


"Recommend this Link to a Friend

In Reply To:

Scipt was not posted
Unknown Tag: 'send_name'
Unknown Tag: 'send_email'
Unknown Tag: 'slogan'


Search Engine

In Reply To:

Unknown Tag: 'top5'
Unknown Tag: 'top5_most_recent'
Unknown Tag: 'top5_today'


Regards,

Eliot Lee
Quote Reply
Re: Image Gallery/Picture Post In reply to
Eliot,

None of that is connected. As I said, It's a pre-alpha, to show the layout. I still have to port over all the mods from 1.1x to 2.0. It takes time. Some of that is the debug code I mentioned.

But I'm looking for suggestions to work in as this develops.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
Additional Thoughts:

As I go along, I'm digging into my notes, and have to do "baby steps" first. Features can be added in later, as long as they are thought about up front :)

File Uploads:

1) Let's assume Links SQL is going to be your image management tool. Let's assume you are _not_ going to be linking to some vast external database, but you are building or importing your own. Reasonable assumptions for now.

2) Uploaded files should store a "download_name" in the record, but be stored on disk as LinkID.ext, to make easy linking to the record without jumping through hurdles possible. This would _also_ allow things such as:

LinkID.jpg
LinkID.gif
LinkID.mpg
LinkIDwww.ext

Where 'www' is an alphabetic extention that could be used for file-sizing.

Back in the pre-computer days, photo and negative storage, used unique file numbers, plus an alpha betic to determine category, format and other such. Often A,B,C,D,E in the first position were used to determine negative format, such as 35mm, 120, 4x5, etc.

In this way, you could offer high/low resolution versions of your site, simply by using the letter format, and using links such as:

....path/to/file/<%ID%>a.<%ext%>
....path/to/file/<%ID%>b.<%ext%>
....path/to/file/<%ID%>b.<%ext%>

To allow users to pick a small, medium or large version of the image.

This could be _external_ to the database, even, requiring only one entry to be made, and the program automatically figuring out if any other versions exist for that record -- even if they were added at a later date.

This has far, far greater benefits than using filename.ext formats for the files.

I imagine I could leave both options in eventually, but certain features would be available only for certain options -- such as the automatic versioning if you use <%ID%> for the file name, rather than a text string.

Make sense?? Comments?

3) I don't like world-writeable files, so I imagine that uploads will be to a temporary directory, and once validated/verified they are moved to a server-writable directory tree. You can have the option of Preview area or not (same concept of validating additions). Because the directory tree will be owned by the "server" group, it will be able to manage files within that tree.

4) Any comments??






PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
hello pugdog
that's somethin i wish or concrete:
users can upload files with adding/modifying links
users can upload files with modifying it's user profile
admin can add files for categories.

the older links-sql versions can make images to a .fil file
something like that is also suitable for links-SQL NG.
but there is one thing, there is no option to upload exe
doc or other file types minto a .fil file

see my complete wish list about images system in the custom modification jobs.
This is also the main wish of most links-SQL users, i think.




Quote Reply
Re: Image Gallery/Picture Post In reply to
Other things:

This version is going to require the user be logged in/registered. This is the safest way of doing it. If there is demand later, maybe allow non logged in uploads, but legally, there is really no reason a legitimate website would want to do this. Risks far, far outweigh the benefits.

That way, certain information is already known about the user -- ID, email, etc. And doesn't have to be re-entered or put on the forms.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Image Gallery/Picture Post In reply to
pugdog agreeing on all of this it makes lots of sense. You going to use your filenaming system for thumbnail as opposed to full size image as well. Perhaps the possibility of a number of different sizes (for a wallpaper directory 800x600, etc) might be possible with this type of method.

Autogeneration of filenames.

I would imagine a lot of us will want to just upload a bunch of images to a directory and then tell links to add all those images into a certain category (or follow category structure) are you then planning to have the script rename the files, add in the size of the image to the fulename and the rest?

Logging in for image upload seems very sensible. Also good if you could turn off authentication on a user by user basis so that after someone has uploaded 20 images and you trust them you just turn of the validation required.

One small thing.. bandwidth uses may be a concern for some things of interest (not really sure if this is really related to this script in particular though).

1) the htaccess rewrite needs to prevent external linking.
2) a way of preventing people running download programs (teleport pro springs to mind) that just go and download the whole directory. Perhaps using sessions have some limit on the number of images that can be downloaded. I really fear that a number of people deciding that downloading the whole 1GB directory of images is going to cause some major problems!

That is all for now :) so looking forward to this.

http://www.ASciFi.com/ - The Science Fiction Portal