Author Topic: thumbnails on the fly  (Read 4823 times)

0 Members and 1 Guest are viewing this topic.

Offline SamePaul

  • Occasional poster
  • *
  • Posts: 72
    • View Profile
Re: thumbnails on the fly
« Reply #15 on: August 06, 2010, 11:50:52 AM »
Yes, I saw this a while ago. But it required manual building of thumbnails with specially provided tool. Maybe it has changed since then, didn't really check it lately.

Offline SamePaul

  • Occasional poster
  • *
  • Posts: 72
    • View Profile
Re: thumbnails on the fly
« Reply #16 on: August 06, 2010, 07:15:46 PM »
you should consider accessing /folder/~thumbnail?file=picture1.jpeg
and then using {.?file.} to know the file

experimented a bit with this and unfortunately this is not really working.
1) accessing /folder/~thumbnail gives "404 Not found" whereas /~thumbnail works
2) file's location is unknown when HFS process [thumbnail] section as well as folder url & path.

Also it is not clear how to apply 1st proposed solution with creating thumbnails on disk. How can I determine full path to file? Just giving %item-name% doesn't work since current directory is not where file exists.

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1222
  • ....... chut ! shh!
    • View Profile
Re: thumbnails on the fly
« Reply #17 on: August 07, 2010, 01:32:19 AM »
Hi !

It is rather difficult to answer you if every time you give us bits of information.
Try to explain what exactly you want to do, how you go about it, shows some snippets of code and a sample content of your section [thumbnail], so we can understand the context.

This may be vast, the use of thumbnails.
For a pictures gallery: Only with the template? On a separate HTML page? With a Flash applet, Java? in Ajax scripting?
Could you use thumblists XML? ...

Have an idea of the program that you use to generate the thumbnails can be useful to develop a strategy for the script, to distrib the result.

For your troubles with variables, know the context of use can help to understand why, and most certainly how integrate them into a script.

%folder%, %item-name%, %folder%%item-name%.xxx, %item-ext%, %item-resource% ...etc

The [thumbnail] section, if it behaves like a HTML page, may restrict the use of variables.

It is much easier to consider the wishes of users, if we do not have to guess them.

So, if you can tell us more ...

« Last Edit: August 07, 2010, 02:23:29 AM by SilentPliz »

Offline SamePaul

  • Occasional poster
  • *
  • Posts: 72
    • View Profile
Re: thumbnails on the fly
« Reply #18 on: August 07, 2010, 01:24:46 PM »
SilentPliz what can I say bro... maybe you will take a look at my previous messages? you'll find there everything: what it was about, code snippets, sample content of the section etc.
Especially the key point, that I quoted for you once, but seems you need to hear it again.. dunno.
I'll try to rephrase for you:

I want to AVOID SENDING WHOLE MULTY-MEGABYTE IMAGE OVER NETWORK. I want to send SMALL THUMBNAIL instead.

Don't know how make it any clearer.
Look, I really appreciate your efforts to be helpful. It maybe would make just a bit more sense to help in what user (me) wants, rather than in what you think is better for 99% of the world.

Offline r][m

  • Tireless poster
  • ****
  • Posts: 347
    • View Profile
Re: thumbnails on the fly
« Reply #19 on: August 07, 2010, 03:31:31 PM »
@SamePaul
I've read this thread coulpe of times, and like SP I really don't
clearly understand either.
This is what I do.
Create thumbnails (any good image software should do it).
Use diff tpl to create page of thumbnails, on that page thumbnail links
to full image with archive. Clicking the link shows full image in browser,
or check the archive check boxes to DL several at once?
If you want to be able to dump you images in a folder and it does the rest
automatically, create it yourself.
No one else has been able to, so far, with out creating a system overload.
The closest is what the RAWR team has done.

Offline SamePaul

  • Occasional poster
  • *
  • Posts: 72
    • View Profile
Re: thumbnails on the fly
« Reply #20 on: August 07, 2010, 04:05:32 PM »
@SamePaul
I've read this thread coulpe of times, and like SP I really don't
clearly understand either.
Then seems rejetto is able to read my mind. Otherwise I can't explain how he was not just able to understand me, he also proposed 2 solutions. You definitely noticed them when you read the thread, right?

Now, if anyone knows way to get full local path to current %item-name% - please, tell me. I'd love to hear. Really.
Just please, no more "alternative solutions".  :)

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1222
  • ....... chut ! shh!
    • View Profile
Re: thumbnails on the fly
« Reply #21 on: August 07, 2010, 04:21:19 PM »
rather than in what you think is better for 99% of the world.

 ::)


%item-resource%  = c:\...

%folder%%item-name%   = /folder/filename
« Last Edit: August 07, 2010, 04:27:52 PM by SilentPliz »

Offline SamePaul

  • Occasional poster
  • *
  • Posts: 72
    • View Profile
Re: thumbnails on the fly
« Reply #22 on: August 07, 2010, 04:36:17 PM »
%item-resource%  = c:\...
a-muuuusing :) thanx man!

Maybe you know as well how to get only path? Lets say I have %item-resource%  = "c:\folder1\folder2\file.ext" and I need take only "c:\folder1\folder2\" part and append to it "preview/file.ext".

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1222
  • ....... chut ! shh!
    • View Profile
Re: thumbnails on the fly
« Reply #23 on: August 07, 2010, 07:03:39 PM »
Path without file.ext:


c:\folder1\folder2\
=
{.filepath|%item-resource%.}

Edit:

http://www.rejetto.com/wiki/index.php/HFS:_scripting_commands
« Last Edit: August 07, 2010, 07:33:01 PM by SilentPliz »

Offline bacter

  • Operator
  • Tireless poster
  • *****
  • Posts: 682
    • View Profile
Re: thumbnails on the fly
« Reply #24 on: August 08, 2010, 11:08:15 AM »
If you want to do something like that:



Perhaps the following code may help you:

Code: [Select]
[file_foto]
<div style="width:150px; height:130px; overflow:hidden; float:left; font-size:9px; " title="%item-size% %item-modified%">
{.set|fn|{.replace|%20| |{.replace|/|\|%encoded-folder%thumbs/%item-name%.}.}.}
{.if|{.exists|{.^fn.}.}|
{:{.set|fn|thumbs/%item-name%.}:}|
{:{.if|{.pos|%item-ext%|.jpg.gif.bmp.png.}|
{:{.set|fn|%item-name%.}{.comment|******.}:}|
{:{.set|fn|.}:}
.}:}
.}
<a href="%item-url%"><div align="center">
{.if|{.^fn.}|
{:<img  height="110px;" src="{.^fn.}" />:}|
{:<img  style="border:35px solid transparent;" height="40px;"  src="%item-icon%">:}.}
</div>
<div style="background-color:#d0d0f8; color:black;">%item-name%</div></a>
{.if|%item-comment%|<div class="comment">{.^cmttxt.}</div>.}
</div>

I use this section when a folder should be presented as images. When no thumb exists, the full picture is used - i have placed there the {.comment|******.} because there is where you can place the exec to create the thumbnail.
your computer has no brain - use your own !

Offline SamePaul

  • Occasional poster
  • *
  • Posts: 72
    • View Profile
Re: thumbnails on the fly
« Reply #25 on: August 08, 2010, 01:00:46 PM »
SilentPliz thanks again. Now it works

bacter Thank you, but don't need it either for same reason I didn't want RAWR or Live: it's workaround which just makes something that looks like what I need, but not solution.

rejetto Do you think it will be possible in some future to run sections on arbitrary folder, not only on root? I mean, if I have [mysec] section in template, will URL http://mysite.com/some/folder/~mysec work?
« Last Edit: August 08, 2010, 01:10:09 PM by SamePaul »

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1222
  • ....... chut ! shh!
    • View Profile
Re: thumbnails on the fly
« Reply #26 on: August 08, 2010, 01:59:40 PM »
Quote
rejetto Do you think it will be possible in some future to run sections on arbitrary folder, not only on root? I mean, if I have [mysec] section in template, will URL http://mysite.com/some/folder/~mysec work?


I'm not sure of that.
But until an answer or solution from rejetto, you can use the template that includes [mysec] in folders of your choice as diff template, and keep the template without [mysec] as default template.

It's just an idea, don't be angry. :D

Edit:

It depends on the contents of your section, but you can also cut in your template your [section] and paste it in the diff template tab of "properties" of choosed  folders.
« Last Edit: August 08, 2010, 02:38:18 PM by SilentPliz »

Offline SamePaul

  • Occasional poster
  • *
  • Posts: 72
    • View Profile
Re: thumbnails on the fly
« Reply #27 on: August 08, 2010, 02:45:14 PM »
I'm not sure of that.

Actually it was his idea, so I hope he's going to make it work as well ;)
you should consider accessing /folder/~thumbnail?file=picture1.jpeg
and then using {.?file.} to know the file



But until an answer or solution from rejetto, you can use the template that includes [mysec] in folders of your choice as diff template, and keep the template without [mysec] as default template.
I guess it can work. However it will work for a specific folder added directly to VFS and only for it. Not even for subfolders, as the become inaccessible...

Anyway, I think that my phrase "picture gallery" mislead most of you, guys. I used this term only for example. My real objective is to preview any picture accessible via HFS. That's why I can't use "preprocessing" tools like TPGen.

It's just an idea, don't be angry. :D
Nah, I'm not that bad ;)

Offline r][m

  • Tireless poster
  • ****
  • Posts: 347
    • View Profile
Re: thumbnails on the fly
« Reply #28 on: August 08, 2010, 03:55:45 PM »
However it will work for a specific folder added directly to VFS and only for it. Not even for subfolders, as the become inaccessible...
Diff tpl applies to subfolders here, at least where all are real.

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1222
  • ....... chut ! shh!
    • View Profile
Re: thumbnails on the fly
« Reply #29 on: August 08, 2010, 04:11:59 PM »
r][m is right!  :)

Quote
Actually it was his idea, so I hope he's going to make it work as well ;)

you should consider accessing /folder/~thumbnail?file=picture1.jpeg
and then using {.?file.} to know the file

This already be working.



« Last Edit: August 08, 2010, 04:54:51 PM by SilentPliz »