Manual Update of Album folder

Hi,

which class do I need / method do I have to call that the box starts an update of the folders in "album" and writes all new files to the database?

Doing this via browser isn't the best idea, so i thought i'll write me some script that just does the trick via cron and php on the command line.

That would avoid hitting the max execution time ...

Any hints are higly appreciated!

Thanks!

KR,

Grimeton

Comments

  • I am not understanding what you want. Do you want to force Zenphoto to "discover" newly uploaded images? It will do that when you "view" the containing album.

    If you want to code that you would use the album->getImages() method. Suggest you review the object model for answers to this kind of question.

    If you want the images "cached" as well you would have to invoke the cacheImage function with the appropriate parameters for the size/use you wish cached.

    But really, why would you want to do this? Is it the case that you will be constantly uploading lots of images? Using the browser works quite well, and if the count of images is so large that you do get the script timeout, just restart. Discovery happens only once. Seems really not worth the effort to make a cron job.
  • acrylian Administrator, Developer
    You should read on the troubleshooting guide how Zenphoto works being file system based. There is a diagram that explaines this.
  • Hm,

    doing it via Browser and restarting, or something else, isn't the best idea IMHO.

    I'm talking about 10 years of images which are about 2.2 MILLION images...

    They're all stored on a Synology box (that's how I found this software).

    So I want to write a script that runs at night and just updates what has to be updated and does the initial index.

    If it can be done by using the getImages method of the album class I'll give that a shot.

    Any other hints/ideas?

    KR,

    Grimeton
  • acrylian Administrator, Developer
    You did not read the article I suggested on how Zenphoto works, did you? It is not necessary to precache images as Zenphoto will do it if they are requested. This helps you to lower your server load instead of having all generated all at once.

    You can use the preache functions available on the backend. But that will surely block you server a while with 2.2 million images, especially if these might be hires..

    Also note that precaching will not help you if you use a theme that defines custom image sizes and overrides the main options.
  • the getImages() method will populate the database, but that really is not a great consumer of CPU. Most likely the issue will be the resizing of the images. That would require the use of the cacheImage() function--a much more involved process because, as I said, you have to know the right parameters for the images your theme will be using.
Sign In or Register to comment.