Announcement

#1 2015-02-02 00:09:47

oneiro
Guest

NAS + Piwigo - many files on server + background job

Hi,

I'm a new user, start using today Piwigo (download current version), greate photo server.

Have NAS in home with lost of photos.  My NAS configuration is System HDD (few GB) and Matrix RAID (few TB).  On data volume have about 0,5 TB.   Piwogo www root is on system HDD. System: linux 32 bit, 4 GB RAM + 1,6 GHz Intel Atom.

After install and using have couple of questions:

1. Local download photos - there are some simple way?  I have simple make symbolic link to gallery folder in root_www dir and work, but this is not user-firiendly solution. Probalby I do not know all and exist simples way?

2. Background job for resizing/thumbs/miniatures.    As I understood there are to way to make minatures/resizing
- go to album and automaticly generating "what you see" only
- go to batch managment and process (greate feature) BUT it is working only is my local browser is working.

My NAS work 24/7 but laptop not, so question - there is something like background job on sever?   I mena "batch managment" but working only on server without need open web page on my laptop or processing?  Only launch for view or pause/stop the backgrond job. 
If I have houndrest of thousends photos and only 1,6 GHz so processing all photos will take days/weeks....

BR, Krzysiek

 

#2 2015-02-04 12:56:22

cnoork
Guest

Re: NAS + Piwigo - many files on server + background job

Hi oneiro,

I found the following post:
http://piwigo.org/forum/viewtopic.php?id=22465

But on my synology it is unfortunaly not working yet, maybe it is working for your "server". If the command is working I will make a linux script to process all photo's.

With kind regards,
Chris

 

#3 2015-02-06 00:48:59

oneiro
Guest

Re: NAS + Piwigo - many files on server + background job

Hi,

I try using absolute path like:

http://192.168.10.2:83/i.php?/mnt/backu … G_5682.jpg

And get error:

Invalid chars in request


When I try use relative paht (start from www_root, and www_root/glleries) or put some not true file like:

http://192.168.10.2:83/i.php?a.jpg

I get:

Missing -


If i.php is responsilbe for processing then (as I do not know php) how set pramteres to i.php like
- source filename (and is need absolute or relative, if relative then where is "root"?)
- destination (probably this is not to set :( )
- size out file (mianture, thublr, small, large etc)
- roatation information (auto, +/- 90, drection)

This is question to same php specialist

 

#4 2015-02-17 15:45:20

oneiro
Guest

Re: NAS + Piwigo - many files on server + background job

He PIWIGO Team

You know PHP, could anybody help me?

 

#5 2015-02-21 22:48:16

cnoork
Member
2015-02-05
12

Re: NAS + Piwigo - many files on server + background job

Hi oneiro,

I have solved it for now with my own script. I captured the convert commands (ps ww | grep convert) and made a script around it. I am not sure if it is all correct but for now it is working like I want to use it. I had more than 10.000 pictures where I could generate the thumbnails etc in a "screen"session. The scipt will generate one by one resized images. This resulted for me in a NAS which keeps responding during his task.

Because some jobs take a long time I have also made a escape posibility by placing a a file "${tmp_dir}/piwigo_thumbnail2.stop" (in my case "/volume1/system/tmp/piwigo_thumbnail2.stop")

Let it know if this helped you or found that it did not work, then maybe I can help to let it work also for you.

With kind regards,
Chris


====start piwigo_thumbnail.sh=====
piwigo_dir="/volume1/web/piwigo"
tmp_dir="/volume1/system/tmp"
log_dir="/volume1/system/tmp"
piwigo_jpg_lst="${tmp_dir}/piwigo_thumbnail2.lst"
piwigo_log="${log_dir}/piwigo_thumbnail2.log"
piwigo_stop="${tmp_dir}/piwigo_thumbnail2.stop"


### Remove stop file
find ${tmp_dir} -name piwigo_thumbnail.stop -exec rm {} \;

### Create list from all jpg files in piwigo
find ${piwigo_dir} -name *.[jJ][pP][gG] -print | grep -e upload | grep -v buffer | gawk -F"/" '
/piwigo\/upload/{
   source[substr($(NF),1,length($(NF))-4)]=$0
   }
/piwigo\/_data\/i\/upload/{
   destin[substr($(NF),1,length($(NF))-4)]=$0
   }
END{
   parm["th"]="-filter Lanczos -resize 144x91! -strip -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["2s"]="-filter Lanczos -resize 240x151! -strip -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["xs"]="-filter Lanczos -resize 432x273! -strip -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["xm"]="-filter Lanczos -resize 576x364! -strip -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["me"]="-filter Lanczos -resize 792x520! -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["la"]="-filter Lanczos -resize 1008x637! -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["xl"]="-filter Lanczos -resize 1224x773! -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["xx"]="-filter Lanczos -resize 1656x1046! -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["sq"]="-crop 2240x2240+652+0 -filter Lanczos -resize 120x120! -strip -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["cu_e250"]="-crop 2264x2264+644+0 -filter Lanczos -resize 250x250! -strip -quality 95 -interlace line -sampling-factor 4:2:2"
   parm["cu_s9999x200"]="-filter Lanczos -resize 300x200! -strip -quality 95 -interlace line -sampling-factor 4:2:2"

   # place in all the sizes you want to generate
   all="cu_e250 cu_s9999x200 th me sq"
   c=split(all,size," ")
   for (i=1;i<=c;i++){
      for (file in source){
         if (file "-" size[i] in destin)
            dummy=""
         else{
            destination=substr(source[file],1,length(source[file])-4) "-" size[i] "."substr(source[file],length(source[file])-2)
            gsub("piwigo/upload","piwigo/_data/i/upload",destination)
            cmd="convert " source[file] " " parm[size[i]] " " destination " > /dev/null 2>&1"
#            cmd="ls -l " source[file]
#            print cmd
            system(cmd)
            done++
            print done "  " size[i] "  " strftime("%Y-%m-%d %H:%M:%S")
            if (done % 10 == 0) {
               if(system("test -f /volume1/system/tmp/piwigo_thumbnail.stop") == 0 ) {
                  printf( "file \"/volume1/system/tmp/piwigo_thumbnail.stop\" exists\n" );
                  exit
                  }
               }
            }
         }
      }
   print done
   print "till end"
   }'
====start piwigo_thumbnail.sh====

Offline

 

#6 2015-02-27 00:41:38

oneiro
Guest

Re: NAS + Piwigo - many files on server + background job

Hi cnoork,

I try use you script but without successful :(

First of all I add on 1st #/bin/bash.   Next I install gawk, but I get error:

Code:

root@omv:/mnt/backup/test/iga# bash pt.sh
pt.sh: line 8: $'\r': nie znaleziono polecenia
find: brak argumentu dla `-exec'
pt.sh: line 11: $'\r': nie znaleziono polecenia
find: ścieżki muszą poprzedzać wyrażenie: DSC07327.JPG
Składnia: find [-H] [-L] [-P] [-Opoziom] [-D help|tree|search|stat|rates|opt|exec] [ścieżka...] [wyrażenie]

till end

Could you please send to some server on internet to further download?

BR, Krzysiek

 

#7 2015-03-05 11:07:16

cnoork
Member
2015-02-05
12

Re: NAS + Piwigo - many files on server + background job

Hi Krzysiek

It look like the following line is not working for your server.

# find ${tmp_dir} -name piwigo_thumbnail.stop -exec rm {} \;

I will look for a solution taht you can download the script.

With kind regards,
Chris

Offline

 

#8 2015-03-15 15:23:42

oneiro
Guest

Re: NAS + Piwigo - many files on server + background job

Hi Chris,

In time when you making changes in code please provide original script in other way that this forum, probably due to text formatting on this forum CTRL+C could not copy exactly  1:1.
If you could please send script to:  oneiro  _(at)_  o2  dot pl.

Thanks, Krzysiek

 

#9 2015-03-15 20:38:12

cnoork
Member
2015-02-05
12

Re: NAS + Piwigo - many files on server + background job

Hi Krzysiek,

I have emailed the script.

With kind regards,
Chris

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact