Create your own Gallery

Ideas and dreaming will go this forum
Post Reply

arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Create your own Gallery

Post by arris69 »

it isn't firmware specific, so i post it in this forum:
linux script to generate your own image gallery for the content library.

change
Thumb Pic_Fold BG_Music Lib_Ver and Prefix to fit your setup

you can find original suff at:
http://www.samsung.com/at/consumer/lear ... load.html#

have fun
arris

Code: Select all

#!/bin/sh

Thumb="/home/gizella/K?pek/dcim/105canon/img_0541.jpg"
Pic_Fold="/home/gizella/K?pek/dcim"
BG_Music="/home/Musik/Celine Dion/All the Way- A Decade of Song/08_my_heart_will_go_on.mp3"
Lib_Ver="2009_00001"
Prefix="swf/GALLERY"

####### nothing to change here ########
Gal_Name=$(basename "$Pic_Fold")
Gal_Dir="$Gal_Name"_"$Lib_Ver"

# GALLERY/art_2009_00001/art_img/credits/
# GALLERY/art_2009_00001/thumbnail/art.bmp
# GALLERY/art_2009_00001/bgm.mp3
# GALLERY/art_2009_00001/clmeta.dat

# Globals
Head='<?xml version="1.0" encoding="utf-8"?>
<contentlibrary>
<contentpack id="'${Gal_Dir}'">
<category>Gallery</category>'
Langs="Korean English English_USA German French French_USA Italian Russian Spanish Spanish_USA"
# Fix next in a loop
Title_a='<title language_id="'
Title_b='">'
Title_c='</title>'
Start_a='<startpoint language_id="'
Start_b='">./'
Start_c='/</startpoint>'
Tn_a='<thumbnailpath>./thumbnail/art.bmp</thumbnailpath>'
Fli_a='<filelist>./'
Fli_b='</filelist>'
Info_a='<info language_id="'
Info_b='">Contents for '
Info_c=' gallery<price></price>
<difficulty></difficulty>
<version></version>
<genre></genre>
<provider></provider>
<site></site></info>'

# Prepare dirstruct
mkdir -p "$Prefix/$Gal_Dir/$Gal_Name"
# mkdir -p "swf/GALLERY/$Gal_Dir/$Gal_Name"_img"/credits"
pushd "$Prefix"

# Background music
if [ ! -e "$Gal_Dir/bgm.mp3" ] ; then
        mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader "$BG_Music" && \
        lame -m s audiodump.wav -o "$Gal_Dir"/bgm.mp3 && \
        rm -f audiodump.wav
fi

# Thumbnail
if [ ! -e "$Gal_Dir/thumbnail/art.bmp" ] ; then
        mkdir -p "$Gal_Dir/thumbnail"
        convert "$Thumb" -scale 440x417 -depth 32 "$Gal_Dir/thumbnail/art.bmp"
fi


echo $Head > "$Gal_Dir"/clmeta.dat
for l in $Langs ; do
        echo $Title_a$l$Title_b$(basename "$Pic_Fold")$Title_c >> "$Gal_Dir"/clmeta.dat
done
for s in $Langs ; do
        echo $Start_a$s$Start_b$Gal_Name$Start_c >> "$Gal_Dir"/clmeta.dat
done
echo $Tn_a >> "$Gal_Dir"/clmeta.dat
# Link Photos
# mkdir -p "$Gal_Dir/$Gal_Name" # Done in Prepare dirstruct
for p in `find "$Pic_Fold" -iname "*.jpg"` ; do
        let cnt+=1
        iname="Image_"$(printf "%03d" $cnt)".jpg"
        convert "$p" -gravity center -resize 1920x1080 -background black -extent 1920x1080 "$Gal_Dir/$Gal_Name/$iname" &

        echo $Fli_a$Gal_Name/$iname$Fli_b >> "$Gal_Dir"/clmeta.dat
done
for i in $Langs ; do
        echo $Info_a$i$Info_b$Gal_Name$Info_c >> "$Gal_Dir"/clmeta.dat
done

Fot='<totalsize>'$(du -b -s "$Gal_Dir" | cut -f1 | tr -d [:space:])'</totalsize>
</contentpack>
</contentlibrary>'

echo $Fot >> "$Gal_Dir"/clmeta.dat
popd

Post Reply

Return to “[B] Brainstorm”