rejetto forum

thumbnail by macro

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
if i make the macro for running external software, this may be used run an external "thumbnailer" only when the thumbnail file doesn't exist.
would this fill the gap to get a template with real thumbnails?


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Maybe... but what if an entire gallery is not done? will the site sit there blank generating thumbnails then load up the page... or cache the thumbnails in the background and on next refresh they are there...


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
to solve such issue, i guess a template could, meeting a missing thumbnail, add the filename to a batch file, and output a placeholder to the browser.
at the end of the template generation, run the batch file as a background process (not stopping hfs).

this lead us to another problem: 2 visitors may issue twice the thumbnail making.
it can be solved by creating a "locking" temp file, by creating a file named "thumbs\"+filename+".lock", that will be deleted by the batch file after the generation.


Offline Giant Eagle

  • Tireless poster
  • ****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
if i make the macro for running external software, this may be used run an external "thumbnailer" only when the thumbnail file doesn't exist.
would this fill the gap to get a template with real thumbnails?

It would most certainly work for files that are being uploaded to the server. When they are uploaded, the thumbnails will get generated.

Maybe... but what if an entire gallery is not done? will the site sit there blank generating thumbnails then load up the page... or cache the thumbnails in the background and on next refresh they are there...

This needs some thougts, as a folder with 100+ images could take a while to convert (if you want acceptable thumbnails that is). Best thing would be to convert them in the background.

this lead us to another problem: 2 visitors may issue twice the thumbnail making.
it can be solved by creating a "locking" temp file, by creating a file named "thumbs\"+filename+".lock", that will be deleted by the batch file after the generation.

That could be solved by using a "only one instance" application. Just run the application multiple times with the location to the files as command line parameters. These files get stored in a "To-convert" list. Multiple files get discarded.