I want to contribute my alternative solution. It's another perl script (use the same procedure to install as the other posted previously by benob here
http://forum.synology.com/enu/viewtopic.php?f=17&t=24083#p102578) but use the code below:
This code is provided AS IS and without any waranty. Use it at your own risk. Allways make a backup of the files before changing them.
- Code: Select all
#!/usr/bin/perl -w
@new_args = ();
$doLnk = 0;
for $arg(@ARGV) {
if($arg eq "-size") { $arg = "-sample"; }
if($arg eq "800x800"){ $doLnk = 1; }
if($arg eq "1280x1280"){ $doLnk = 1; }
push @new_args, $arg;
}
if($doLnk){
exec "ln", ("-sf", $ARGV[$#ARGV-1], $ARGV[$#ARGV]);
}
else{
exec "/lib/hddapp/usr/syno/bin/convert", @new_args;
}
This code does the following:
- Apply the "size" to "sample" change
- Generate symbolic links for 800x800 and for 1280x1280 sizes.
It theorically will:
- Speed up thumbnail building (as it will only generate the small thumbnails).
- Keep all the photo station functionality working.
- Save a lot of space as big thumbnails are not really generated
The bad thing is that as the big thumbnails (800x800 1280x1280) will not be real thumbnails but symbolic links to the original pictures, so when accesing the picture detail in photo station, the original picture will be downloaded so the transfered data will be bigger.
@synology people, IMO the correct way of managing this problem would be generating the thumbnails on demand when they are accesed through photo station instead of generating them on batch. This way they will only be generated when needed and only in the sizes requested (big pictures will only be generated when you access the picture detail). This will increase user experience of photo station (specially if you can add a progress bar of the thumbnail generation progress) and also save a lot of disk space (as all the pictures will only be generated if they are all accessed down to detail level).
edit: Another thing you should consider is changing the process as it seems that you execute the convert application for each thumbnail you want to generate. This implies reading the file 5 times! (One per thumbnail). Why don't you read the file once and then generate all the 5 thumbnails at a time in a single process... As reading the picture (mines are arround 10MB) is probably the more resource consuming task there it may theorically speed the process up saving almost 80% of the time...