This repository was archived by the owner on Apr 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.sh
More file actions
executable file
·50 lines (40 loc) · 1.35 KB
/
make.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -e
if [[ -z $1 ]]; then
echo "USAGE: $0 images_path"
exit 1
fi
dest_dir=./files/images/
img_list=./files/images_list.txt
rm -rf $dest_dir/
rm -f $img_list
#images=$(find $1 -type f | sort | head -n10)
images=$(find $1 -type f | sort)
for image in $images;
do
echo "processing $image ..."
uid=$(uuidgen)
echo $uid >> $img_list
mkdir -p $dest_dir/$uid
original=$dest_dir/$uid/original.jpg
medium=$dest_dir/$uid/medium.jpg
tiny=$dest_dir/$uid/tiny.jpg
timeline=$dest_dir/$uid/timeline.jpg
cp $image $dest_dir/$uid/original.jpg
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 50% $original $medium
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 10% $original $tiny
convert $medium -resize 256x256 $timeline
done
exit
# gestion d'images en mémoire en js avec {
# tiny: [ImageData]:max10000,
# medium: [ImageData]:max2000,
# original: [ImageData]:max1000,
# }
# préchargement depuis l'image courante pour lecture
# gestion du download passive en cache
# make icon:
# convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 images.jpeg output-32x32.ico
# convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 images.jpeg output-16x16.ico
# convert output-16x16.ico output-32x32.ico favicon.ico
# scp favicon.ico perso:baku/server/files/favicon.ico