Gossamer Forum
Home : Products : Links 2.0 : Customization :

Image (photo) database MOD in the works. Anyone interested in helping?

(Page 2 of 2)
> >
Quote Reply
Re: Image (photo) database MOD in the works. Anyone interested in helping? In reply to
OK, I understand.
Now, one more real lame question....please bear with me (I think the Blair Witch is influencing my senses).....but.....

In which script do I place this code? Links.cfg, admin.cgi, add.cgi, add.html???

This is real embarassing. But I guess you could consider me Perl quasi-illiterate. Gotta learn somehow {-:
Quote Reply
Re: Image (photo) database MOD in the works. Anyone interested in helping? In reply to
Where are you going to make the call?

Personally, I would try it in the admin.cgi section first, then generalize it to the rest of the scripts.

Give this power to the admin, make sure it works, then let users get to it.

You can put the subroutine whereever data validation occurs... think logically. Where are you going to use it?

Quote Reply
Re: Image (photo) database MOD in the works. Anyone interested in helping? In reply to
PugDog,
Would you kindly (if you have the time) take a look at my admin.cgi script ... http://retroworld.hypermart.net/admin.txt ... and let me know if I have the htmlthumbnail code configured correctly?

I ran an image upload and everything came out okay, but after I placed the code in the script, the link to the full-size picture was disabled and (when I checked the default image directory for the htmlthumbnail script) there is no image there. It still uploaded to my old upload directory.

Thanks
Quote Reply
Re: Image (photo) database MOD in the works. Anyone interested in helping? In reply to
You might have misunderstood me Smile

I really didnt' mean wedge it into the admin.cgi script, but rather that suite of scripts. (I've been working on something that's been keeping me busy, in between the sick kids).

my $new_graphic_file = 'file.ext';

You really want to just do this:

my $new_graphic_file;

and then assign it to the $filename of your uploaded file -- and pass that to the system call as below.

What you want to do is put the html_thumbnail call into a subroutine, and that should go in one of the files, possibly db_utils.pl where it will be included, and callable by the other modules.

You want to pass this subroutine the parameters that it needs:

1) the location of the html_thumbnail program (full unix path)
2) where the image is you want to convert to a thumbnail is located (full unix path + the file name)
3) the output dir - where you want the thumbnail image to go (full unix path)
4) any parameters you want to operate on.

If you look at the code of the html_thumbnail program, it looks for the image in the default directory -- butif you pass it a fully qualified set of paths, it will use those. It does it's own name mangling, you can override it by changing the mangling procedure in the program.

I really should have sat down and typed this all out, but I've been really overworked this week.

----------



my $htmlthumbnail_script ='/full/path/to/htmlthumbnail'; # a parameter to set
my $working_dir = '/filepath/at/some/location'; # another parameter to set -- where your file is located
my $thumbnail_dir; # where you want the thumbnail to go
my $new_graphic_file; # the variable to hold the file you are going to modify
chdir $working_directory; ## move to the working directory, logically.
## then invoke the html_thumbnail program to operate on the $new_graphic_file
## and put the thumbnail in the output directory you specify with the parameter
## [-catalogdir <sub-directory-name-for-icons>]
system($htmlthumbnail_script,'-update',$index_file,
'-output',$index_file,
'-link',1,
'-catalogdir', $thumbnail_dir,
$new_graphic_file);



Quote Reply
Re: Image (photo) database MOD in the works. Anyone interested in helping? In reply to
Has anything happened recently with this mod? Just checking. Thanks, and good luck.
-Greg
Quote Reply
Re: Image (photo) database MOD in the works. Anyone interested in helping? In reply to
Hey folks. Don't know if anyone is still working on this, but in my own digging on the same subject I can up with this:
http://www.virtualville.com/...pts/fiximg-1.3.tar.Z

This is a little perl script that will go through an HTML page, find all the image links in it, and insert image height and width tags for each. Supposedly it can be made to run recursively. It's a command line thing.

I haven't tried it yet, so I can't vouch for its stability, usefulness, or ability to intergrate with links... but hopefully I'll get a chance to test it out soon and will let you know.

Phoenix
Quote Reply
Re: Image (photo) database MOD in the works. Anyone interested in helping? In reply to
I've had to give up doing mods for Links 2.0, and concentrate on LinkSQL. I'll probably have something that works in a few days, and it might be reverse widgeted into Links 2.0.

The problem with 2.0 is that by being flat-file based, all the work has to be done by the programmer and cgi/perl.

With SQL, a _HUGE_ portion of the work is handled by the SQL database and the SQL query language -- with less resource usage. The DBD/DBI module standardizes the calls, and modifications can be made quickly and easily.

Our image database is 10's of 1000's of images and growing. I was able to prove that the "links" concept using 2.0 worked, and worked well for us, but the flexibility and power of the SQL database is essential.

I've posted enough pointers here for someone to have a real jumpstart on it, but I'm going to have to limit my programming to the SQL version.

I'll post the code, once I'm done... and the external routines will probably work with 2.0, but the specifics will be left to those here.

BTW ... if anyone is running their own servers, or their ISP makes MySQL available, the move to LinkSQL is beyond cool. If you have the ability to run PHP3 scripts, there is an admin interface to MySQL that makes administering the server trivial, and with the new MySQL and mSQL book from O'Reilly, all the open questions are answered.

We certainly could use the input in the SQL area, and extra hands and ideas would be more than welcomed!

As powerful and flexible as Links 2.0 is, LinkSQL is 2-3 orders of magnitude _more_ and the territory is all wide open.

> >