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_DIR=`dirname $ISO_PATH`
|
||||||
ISO_NAME=`basename $ISO_PATH`
|
ISO_NAME=`basename $ISO_PATH`
|
||||||
|
ISO_ARCH=`echo $ISO_NAME | sed "s|.*\.\([A-Za-z0-9_]*\)\.iso|\1|"`
|
||||||
|
|
||||||
[ -e $ISO_PATH ] || {
|
[ -e $ISO_PATH ] || {
|
||||||
echo "Error: file $ISO_PATH does not exist; aborting."
|
echo "Error: file $ISO_PATH does not exist; aborting."
|
||||||
@ -128,15 +129,19 @@ fi
|
|||||||
|
|
||||||
if [ ! "$VIEWMODE" ]; then
|
if [ ! "$VIEWMODE" ]; then
|
||||||
echo "Creating preview images"
|
echo "Creating preview images"
|
||||||
rm -f $ISO_DIR/preview/image-*.jpg
|
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-%02d.jpg >/dev/null
|
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
|
for i in `seq 22 -1 1`; do
|
||||||
f=`printf %02d $i`
|
f=`printf %02d $i`
|
||||||
[ -e $ISO_DIR/preview/image-$f.jpg ] && {
|
convert -resize 50x40 $ISO_DIR/preview/image-${ISO_ARCH}-$f.jpg $ISO_DIR/preview/image-${ISO_ARCH}-$f-50x40.jpg
|
||||||
convert -resize 320x200 $ISO_DIR/preview/image-$f.jpg $ISO_DIR/preview/preview-$ISO_VERSION.jpg
|
done
|
||||||
ln -sf preview-$ISO_VERSION.jpg $ISO_DIR/preview/preview.jpg
|
for i in `seq 22 -1 1`; do
|
||||||
convert -resize 400x300 $ISO_DIR/preview/image-$f.jpg $ISO_DIR/preview/preview-$ISO_VERSION-400x300.jpg
|
f=`printf %02d $i`
|
||||||
ln -sf preview-$ISO_VERSION-400x300.jpg $ISO_DIR/preview/preview-400x300.jpg
|
[ -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
|
break
|
||||||
}
|
}
|
||||||
done
|
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
|
ffmpeg2theora -y -i $ISO_DIR/preview/$ISO_NAME${VIDEO_EXT} $ISO_DIR/preview/$ISO_NAME${VIDEO_EXT2} >/dev/null
|
||||||
|
|
||||||
# cleanup old files
|
# 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
|
[ "$f" = "$ISO_DIR/preview/$ISO_NAME${VIDEO_EXT}" ] || rm -f $f
|
||||||
done
|
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
|
[ "$f" = "$ISO_DIR/preview/$ISO_NAME${VIDEO_EXT2}" ] || rm -f $f
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user