I've a work arround for the thumbnail generation process time problem. The issue is that it takes forever to generate thumbnails (mine was spending arround a minute per picture, wich for my 25000 pictures means 18 days of thumbnail building).
With my workaround I've been able to build the thumbnails in 4 seconds per picture
The work arround does the following:
- Generate symbolic links to the original picture for 1280x1280 and 800x800 thumbnails (this also does save a lot of storage space while keeping photo station to work correctly).
- Build the 640x640 thumbnail using the main convert process.
- Build the 320x320 and 120x120 thumbnail using the 640x640 thumbnail as source instead of the original picture (this saves a lot of processing time and I/O).
- For all the thumbnails generated (the 3 smaller sizes) It uses -sample parameter instead of the -size one as sugested by benob http://forum.synology.com/enu/viewtopic.php?f=17&t=24083#p102578.
To install the patch do the following:
- READ THIS INSTRUCTIONS CAREFULLY
- IF YOU DON'T KNOW WHAT YOU'RE DOING, CONSIDER CLOSING THIS WINDOW
- Understand 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.
- open an administration console (i.e. using Putty, note the user name is "root" and not "admin". The password is the same one).
- create a file somewhere called convert-patch.pl (i.e. /usr/syno/bin/convert-patch.pl).
- Paste the following code inside (i.e. execute "vi /usr/syno/bin/convert-patch.pl", then hit 'a' key, then seccond click the putty screen while having the code in the clipboard. When code is pasted hit "ESC" and type ":wq")
- Code: Select all
#!/usr/bin/perl -w
@new_args = (); # Where we are going to copy the arguments
$doLnk = 0; # Flag meaning that we can generate a symbolic link to the original file
$chgSource = 0; # Flag meaning that we have to change the source to the medium sized picture
$copyPath = ""; # The path where we are generation the thumbnails. It comes in the registry:temporary-path parameter
for $arg(@ARGV) {
#Detect the folder of the thumbnails
if($arg =~ m/^registry.temporary.path./) {
$copyPath = $arg;
$copyPath =~ s/^registry.temporary.path.//;
}
elsif($arg eq "800x800"){ $doLnk = 1; }
elsif($arg eq "1280x1280"){ $doLnk = 1; }
elsif($arg eq "120x120"){ $chgSource = 1; }
elsif($arg eq "320x320"){ $chgSource = 2; }
elsif($arg eq "-size") { $arg = "-sample"; }
push @new_args, $arg;
}
#We change the source to the medium sized picture to save reading time.
if($chgSource){
$new_args[$#new_args-1] = $copyPath . "/SYNOPHOTO:THUMB_B.jpg";
}
#We make a symbolic link when ever it applies
if($doLnk){
exec "ln", ("-sf", $ARGV[$#ARGV-1], $ARGV[$#ARGV]);
}else{
# Nothing more to do... lets get the thumbnail!
exec "/lib/hddapp/usr/syno/bin/convert", @new_args;
}
- Now run the following commands (change the paths to point to the fiel you have created if it applyes).
- Code: Select all
chmod +x /usr/syno/bin/convert-patch.pl
ln -sf /usr/syno/bin/convert-patch.pl /usr/syno/bin/convert
- Now edit the files /usr/syno/etc.defaults/thumb.conf and /usr/syno/etc.defaults/thumb_high.conf exchanging the 120 and 640 thumbnail sizes and filenames (this step is needed for the 640x640 thumbnail to be generated before the 120x120 and 320x320).
- Code: Select all
[thumb 120]
size=640
quality=80
filename=SYNOPHOTO:THUMB_B.jpg
[thumb 320]
size=320
quality=90
filename=SYNOPHOTO:THUMB_M.jpg
[thumb 640]
size=120
quality=90
filename=SYNOPHOTO:THUMB_S.jpg
[thumb 800]
size=800
quality=90
filename=SYNOPHOTO:THUMB_L.jpg
[thumb 1280]
size=800
quality=90
filename=SYNOPHOTO:THUMB_XL.jpg
- Now reload the service:
- Code: Select all
/usr/syno/etc/rc.d/S77synomkthumbd.sh restart
- Now your thumbnails should be generating lightning fast now!!
To uninstall the patch just:
- Restore the backups you should have made of the thumb.conf and thumb-high.conf.
- Set the convert-patch.pl file contents to this:
- Code: Select all
#!/usr/bin/perl -w
exec "/lib/hddapp/usr/syno/bin/convert", @ARGV;
Hope this helps





