makedist-recordvm: multiple archs support and preview images thumbnails generation
This commit is contained in:
parent
87cdace8a0
commit
974c30e94b
@ -39,6 +39,7 @@ done
|
||||
|
||||
ISO_DIR=`dirname $ISO_PATH`
|
||||
ISO_NAME=`basename $ISO_PATH`
|
||||
ISO_ARCH=`echo $ISO_NAME | sed "s|.*\.\([A-Za-z0-9_]*\)\.iso|\1|"`
|
||||
|
||||
[ -e $ISO_PATH ] || {
|
||||
echo "Error: file $ISO_PATH does not exist; aborting."
|
||||
@ -128,15 +129,19 @@ fi
|
||||
|
||||
if [ ! "$VIEWMODE" ]; then
|
||||
echo "Creating preview images"
|
||||
rm -f $ISO_DIR/preview/image-*.jpg
|
||||
ffmpeg -y -i $ISO_DIR/preview/$ISO_NAME${VIDEO_EXT} -r 0.1 -f image2 $ISO_DIR/preview/image-%02d.jpg >/dev/null
|
||||
rm -f $ISO_DIR/preview/image-${ISO_ARCH}-*.jpg
|
||||
ffmpeg -y -i $ISO_DIR/preview/$ISO_NAME${VIDEO_EXT} -r 0.1 -f image2 $ISO_DIR/preview/image-${ISO_ARCH}-%02d.jpg >/dev/null
|
||||
for i in `seq 22 -1 1`; do
|
||||
f=`printf %02d $i`
|
||||
[ -e $ISO_DIR/preview/image-$f.jpg ] && {
|
||||
convert -resize 320x200 $ISO_DIR/preview/image-$f.jpg $ISO_DIR/preview/preview-$ISO_VERSION.jpg
|
||||
ln -sf preview-$ISO_VERSION.jpg $ISO_DIR/preview/preview.jpg
|
||||
convert -resize 400x300 $ISO_DIR/preview/image-$f.jpg $ISO_DIR/preview/preview-$ISO_VERSION-400x300.jpg
|
||||
ln -sf preview-$ISO_VERSION-400x300.jpg $ISO_DIR/preview/preview-400x300.jpg
|
||||
convert -resize 50x40 $ISO_DIR/preview/image-${ISO_ARCH}-$f.jpg $ISO_DIR/preview/image-${ISO_ARCH}-$f-50x40.jpg
|
||||
done
|
||||
for i in `seq 22 -1 1`; do
|
||||
f=`printf %02d $i`
|
||||
[ -e $ISO_DIR/preview/image-${ISO_ARCH}-$f.jpg ] && {
|
||||
convert -resize 320x200 $ISO_DIR/preview/image-${ISO_ARCH}-$f.jpg $ISO_DIR/preview/preview-${ISO_ARCH}-$ISO_VERSION.jpg
|
||||
ln -sf preview-${ISO_ARCH}-$ISO_VERSION.jpg $ISO_DIR/preview/preview-${ISO_ARCH}.jpg
|
||||
convert -resize 400x300 $ISO_DIR/preview/image-${ISO_ARCH}-$f.jpg $ISO_DIR/preview/preview-${ISO_ARCH}-$ISO_VERSION-400x300.jpg
|
||||
ln -sf preview-${ISO_ARCH}-$ISO_VERSION-400x300.jpg $ISO_DIR/preview/preview-${ISO_ARCH}-400x300.jpg
|
||||
break
|
||||
}
|
||||
done
|
||||
@ -146,10 +151,10 @@ if [ ! "$VIEWMODE" ]; then
|
||||
ffmpeg2theora -y -i $ISO_DIR/preview/$ISO_NAME${VIDEO_EXT} $ISO_DIR/preview/$ISO_NAME${VIDEO_EXT2} >/dev/null
|
||||
|
||||
# cleanup old files
|
||||
for f in `ls $ISO_DIR/preview/*${VIDEO_EXT}`; do
|
||||
for f in `ls $ISO_DIR/preview/*.${ISO_ARCH}.*${VIDEO_EXT}`; do
|
||||
[ "$f" = "$ISO_DIR/preview/$ISO_NAME${VIDEO_EXT}" ] || rm -f $f
|
||||
done
|
||||
for f in `ls $ISO_DIR/preview/*${VIDEO_EXT2}`; do
|
||||
for f in `ls $ISO_DIR/preview/*.${ISO_ARCH}.*${VIDEO_EXT2}`; do
|
||||
[ "$f" = "$ISO_DIR/preview/$ISO_NAME${VIDEO_EXT2}" ] || rm -f $f
|
||||
done
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user