rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: Data-Base on April 22, 2006, 10:12:35 PM

Title: what abouit showing thumbnail for Images
Post by: Data-Base on April 22, 2006, 10:12:35 PM
hello,

is it possible to add function to show thumbnail for Images in the file listing ?

Thanks for the cool program :-)
Title: what abouit showing thumbnail for Images
Post by: maverick on April 22, 2006, 10:45:35 PM
Check the To-Do list.  Poll isn't necessary.
Title: what abouit showing thumbnail for Images
Post by: Data-Base on April 22, 2006, 10:57:29 PM
Quote from: "maverick"
Check the To-Do list.  Poll isn't necessary.


oppps  :#)

i was reading it but some how  :roll:  i didn't see this line.

sorry & thanks mate
Title: Pictures + Thumbs Preview
Post by: MusicMan on April 23, 2006, 03:26:27 AM
Pictures + Thumbs Preview

i found some code for that, and modifieded it a bit ...

i have a dir with pictures in it.
then i made thumbs from those pictures 100x100,
and placed them in a dir called "thumb"
when i list the pictures, a thumb is showed from the thumb dir...
this works very well, but................

the only drawback is:
1. when i dont have created the thumbs yet
2. the thumb dir is visible

so anyone knows how solve this:
1. if no thumb(file) exist, show the original picture (some kind of case/if structure)
2. make the thumb dir hidden

ofcource i have alot of picture dirs, and possible thumb dirs

info:
Code: [Select]
%encoded-folder%  =  directory
thumb  =  is thumbdir
%item-name%"  =  filename


Code: [Select]
[file]
<tr><td class=row>%new% <a href="%item-url%">

<script language="javascript">
var c='%item-name%';
switch (  c.substr(  c.lastIndexOf('.')  ) .toLowerCase()  )
   {
case '.jpg' : case '.jpeg' : case '.gif' : case '.png' :case '.ico' :case '.bmp' : document.write('<a href="%item-url%" target="_blank"><img align=middle width="100" height="100" src="%encoded-folder%thumb/%item-name%"> </a> ');break;
   default      : document.write('<img align=middle src="/~img_file"> ');
   }
</script>

 %item-name%</a>%comment%<td class="row right">%item-size%<td class="row right">%item-modified%<td class="row right">%item-dl-count%
</tr>


http://img190.imageshack.us/img190/5139/screenshot0013rh.jpg
http://img166.imageshack.us/img166/5670/screenshot0027sg.jpg
http://img166.imageshack.us/img166/5153/screenshot0030tp.jpg
http://img166.imageshack.us/img166/7698/screenshot0048yo.jpg
Title: what abouit showing thumbnail for Images
Post by: rejetto on April 24, 2006, 01:41:49 AM
musicman, improve the quality of thumbnails. in the program you use, search for "resample".
Title: what abouit showing thumbnail for Images
Post by: maverick on April 24, 2006, 03:35:28 AM
musicman,

In addition to improving the quality of the thumbnails, keep aspect ratio and you won't have images that are distorted like you have now (stretched etc.).
Title: what abouit showing thumbnail for Images
Post by: MusicMan on April 24, 2006, 10:10:36 AM
Quote from: "rejetto"
musicman, improve the quality of thumbnails. in the program you use, search for "resample".

hee rejetto, and maverick, thx for reply, but .................

your answer has nothing to do with my question ?!


the question is how to test if a thumbfile exist, in thumb dir i.e.
so if i list a page with pictures, show a thumb (if exist) if not show the original picture 100x100
this because hfs has not yet an on the fly thumbcreation...

look at the code, now it wil use the thumbs, but if they dont exist, it shows now no picture !?

hope its clear now  :o
Title: what abouit showing thumbnail for Images
Post by: maverick on April 24, 2006, 01:16:20 PM
musicman,

Give all your thumbs a unique name to distinquish them from the full picture. Example tn_Nickie Cox.jpg. Add a tn_ in front of all your thumbnails. Adjust your code so that only the thumbs that do exist in your folder are shown. (example tn_*.jpg or tn_*.* etc).
Title: Re: what abouit showing thumbnail for Images
Post by: rejetto on April 25, 2006, 02:55:01 PM
Quote from: "MusicMan"
the question is how to test if a thumbfile exist, in thumb dir
it is a problem. javascript is client-side and the thumbnail is on the server.
anyway, i'm not a javascript programmer.
Title: what abouit showing thumbnail for Images
Post by: rejetto on April 28, 2006, 06:02:06 AM
in version 2.1 you no longer need to use javascript
Title: what abouit showing thumbnail for Images
Post by: MusicMan on April 30, 2006, 01:14:27 AM
Quote from: "rejetto"
in version 2.1 you no longer need to use javascript

cool, i did see that you bin working hard  ;)  for 2.1

and my  :?:  for descript.ion

wil test this .............

 :D  :D  :D  :D  :D  :D  :D  :D