[=] Changed DZI zoom levels logic

This commit is contained in:
VoidVolker 2015-08-06 08:55:51 +03:00
parent 55f3e6724e
commit 9bb1401879
2 changed files with 23 additions and 16 deletions

View File

@ -34,16 +34,22 @@ Result:
[dir] 0 [dir] 0
[file] 0_0.jpg (1x1px) [file] 0_0.jpg (1x1px)
... ...
7
0_0.jpg (256x256px)
...
8 8
0_0.jpg (WxH) | (WxHpx) W<128, H<128
9
0_0.jpg (256x256)
x_y.jpg (WxH) W<256, H<256
...
10
0_0.jpg 0_0.jpg
0_1.jpg 0_1.jpg
1_0.jpg 1_0.jpg
1_1.jpg 1_1.jpg
...
x_y.jpg
... ...
N N (max zoom level)
0_0.jpg 0_0.jpg
... ...
x_y.jpg x_y.jpg
@ -166,7 +172,7 @@ Type: logic switch
### [ -a, --slicea ] ### [ -a, --slicea ]
Type of slicing - slice A. Image scale starts from image size to down. Inverts option `--scliceb`. Type of slicing - slice A. Image scale starts from image size to down. Inverts option `--sliceb`.
Default: true Default: true

View File

@ -215,7 +215,7 @@ aHelp(){
echo " [ -a, --slicea ]" echo " [ -a, --slicea ]"
if [ "$1" = true ] if [ "$1" = true ]
then then
echo " Type of slicing - slice A. Image scale starts from image size to down. Inverts option '--scliceb'." echo " Type of slicing - slice A. Image scale starts from image size to down. Inverts option '--sliceb'."
echo echo
echo " Default: true" echo " Default: true"
echo " Type: logic switch" echo " Type: logic switch"
@ -649,7 +649,7 @@ getZoomLevels(){ # imgLen(pixels) tileLen(pixels) step(int) # Calculate zoom lev
# done # done
# Do all zooms down to 1x1 px # Do all zooms down to 1x1 px
while [ "$imgLen" -gt 1 ] while [ "$imgLen" -ge 1 ]
do do
r[$cnt]=$imgLen r[$cnt]=$imgLen
let "cnt+=1" let "cnt+=1"
@ -739,11 +739,11 @@ sliceImage(){ # zoom image
sliceA(){ sliceA(){
infoMsg " Slicer A is running..." infoMsg " Slicer A is running..."
local scalesW=( `getZoomLevels $imageW $tileW $step` ) local scalesW=( `getZoomLevels $imageW $tileW $step` ) # Get width for each zoom level
local scalesH=( `getZoomLevels $imageH $tileH $step` ) local scalesH=( `getZoomLevels $imageH $tileH $step` ) # Get height for each zoom level
local zw=${scalesW[0]} local zw=${scalesW[0]} # Get zoom level for width
local zh=${scalesH[0]} local zh=${scalesH[0]} # Get zoom level for height
local scales=() local scales=() # Creating empty array
local zoomMax=0 local zoomMax=0
local zoom=0 local zoom=0
local hMod='' local hMod=''
@ -772,12 +772,13 @@ sliceA(){
let "zoom = zoomMax - s" let "zoom = zoomMax - s"
fi fi
infoMsg " Resizing next file..." infoMsg "    Resizing next file..."
debugMsg "    zoomMax=$zoomMax, zoomLevel=$s, wxhInex=$zoom, wxh=${hMod}${scales[$zoom]}"
file=`zoomImage $s "${hMod}${scales[$zoom]}"` file=`zoomImage $s "${hMod}${scales[$zoom]}"`
infoMsg " File resized: ${file}" infoMsg "    File resized: ${file}"
infoMsg " Slicing file..." infoMsg "    Slicing file..."
sliceImage $s $file sliceImage $s $file
rm -rf $file # rm -rf $file
# scalep=`scaleToPercents $scale` # scalep=`scaleToPercents $scale`
# s=${scales[zoom-1]} # s=${scales[zoom-1]}