Create a synology version of thumb.php
Create a simple replacement version of thumb.php for use with the Synology NAS server using the built-in command synothumb.
Location: /usr/syno/bin/synothumb
Syntax:
synothumb -size heightxwidth [ height2xwidth2 ] -type -src path/to/file.jpg [ another/file.jpg ... ] -pnum nr
what it does:
synothumb generates smaller versions of images. synothumb is much faster than p.e. ImageMagick. This performance gain has a down side: synothumb cannot generate thumbnails of arbitrary width and height as ImageMagick does. Instead it divides the original width and height by multiples of 2. (The calculation of the resized images is much simpler this way).
so p.e. if your source image is 1024x768: synothumb could create the following thumbnails for you: 512x384, 256x192, 128x96, etc.
synothumb tries to generate the smallest possible thumbnail that is not smaller than the dimensions you specify.
General: The synology photo web application divides the task of creating thumbnails between server and client. the server with very limited cpu power tries to reduce the image size as much as possible and as fast as possible, while the browser of the client has to handle the rest (resizing the generated thumbnail to the exact dimensions)
destination files:
synothumb creates the folder '@eaDir' in the folder of the source file(s). Within '@eaDir' it creates another folder named after the source filename p.e. 'file.jpg'. Within 'file.jpg' it creates one or two thumbnails named SYNOPHOTO:THUMB_B.jpg (the 'big' thumb) and SYNOPHOTO:THUMB_S.jpg (the 'small' thumb) respectively.
Once the folder 'file.jpg' exists, synothumb won't recreate the thumbnails - even if you specify other dimensions. You have to delete the folder 'file.jpg' containing the thumbnail(s) to force synothumb to go to work.
meaning of parameter 'type':
example:
> rm -r /volume1/public/thumbtest/@eaDir/pic.jpg
> /usr/syno/bin/synothumb -size 50x100 200x300 -smallbig -src /volume1/public/thumbtest/pic.jpg -pnum 1
Image file support:
Note: The aspect ratio of the source file is constrained
Location: /usr/syno/bin/synothumb
Syntax:
synothumb -size heightxwidth [ height2xwidth2 ] -type -src path/to/file.jpg [ another/file.jpg ... ] -pnum nr
- width, height, width2, height2: desired width and height of thumbnails.
- type: small, big, smallbig, bigsmall
- path/to/file.jpg: source file
- nr: the number of parallel process creating thumbnails
what it does:
synothumb generates smaller versions of images. synothumb is much faster than p.e. ImageMagick. This performance gain has a down side: synothumb cannot generate thumbnails of arbitrary width and height as ImageMagick does. Instead it divides the original width and height by multiples of 2. (The calculation of the resized images is much simpler this way).
so p.e. if your source image is 1024x768: synothumb could create the following thumbnails for you: 512x384, 256x192, 128x96, etc.
synothumb tries to generate the smallest possible thumbnail that is not smaller than the dimensions you specify.
General: The synology photo web application divides the task of creating thumbnails between server and client. the server with very limited cpu power tries to reduce the image size as much as possible and as fast as possible, while the browser of the client has to handle the rest (resizing the generated thumbnail to the exact dimensions)
destination files:
synothumb creates the folder '@eaDir' in the folder of the source file(s). Within '@eaDir' it creates another folder named after the source filename p.e. 'file.jpg'. Within 'file.jpg' it creates one or two thumbnails named SYNOPHOTO:THUMB_B.jpg (the 'big' thumb) and SYNOPHOTO:THUMB_S.jpg (the 'small' thumb) respectively.
Once the folder 'file.jpg' exists, synothumb won't recreate the thumbnails - even if you specify other dimensions. You have to delete the folder 'file.jpg' containing the thumbnail(s) to force synothumb to go to work.
meaning of parameter 'type':
- if you specify '-small': synothumb expects width and height and creates the thumb SYNOPHOTO:THUMB_S.jpg
- if you specify '-big': synothumb expects width and height and creates the thumb SYNOPHOTO:THUMB_B.jpg
- if you specify '-smallbig': synothumb expects width, height, width2 and height2 and creates the thumbs SYNOPHOTO:THUMB_S.jpg (using width and height) and SYNOPHOTO:THUMB_B.jpg (using width2 and height2)
- if you specify '-bigsmall': synothumb expects width, height, width2 and height2 and creates the thumbs SYNOPHOTO:THUMB_S.jpg (using width2 and height2) and SYNOPHOTO:THUMB_B.jpg (using width and height)
example:
> rm -r /volume1/public/thumbtest/@eaDir/pic.jpg
> /usr/syno/bin/synothumb -size 50x100 200x300 -smallbig -src /volume1/public/thumbtest/pic.jpg -pnum 1
Image file support:
- jpg (24bit color, non progressive): works
- png: partly (thumbnails have the same size as the original)
- everything else: untested
Note: The aspect ratio of the source file is constrained
Leave a comment