bashologist
April 16th, 2011, 01:08 AM
Trasnsfer photos to your ipod on 4.2.1.
Warning: Jailbroken devices only. Only tested on ios 4.2.1 on an iPod Touch 4g. Use at your own risk.
Install ifuse and zenity. This will force the photos app to regenerate the photos database file. Uses zenity for file selection and progress bar.
#!/usr/bin/env bash
files=$(zenity --file-selection --multiple | tr "|" "\n")
filecount=$(echo "$files" | wc -l)
test -n "$files" || exit 1
test -d /mnt/ipod || gksudo mkdir /mnt/ipod
test -w /mnt/ipod || gksudo chmod a+w /mnt/ipod
test -d /mnt/ipod/private || ifuse --root /mnt/ipod || exit 1
cd /mnt/ipod/private/var/mobile/Media/DCIM/100APPLE || exit 1
counter=1
echo "$files" | while read file; do
echo "scale=1; 100 / ($filecount / $counter)" | bc
cp -n "$file" ./
((counter++))
done | zenity --progress --auto-close --width 700
counter=1
mkdir temp
for input in *.*; do
output=$(printf "IMG_%04d.${input##*.}" "$counter")
mv "$input" "temp/${output^^}"
((counter++))
done
mv temp/*.* ./
rmdir temp
mv -n ../../PhotoData/Photos.sqlite ../../PhotoData/Photos.sqlite.bak 2> /dev/null
cd
fusermount -u /mnt/ipod
After the transfer close and reopen the photos app for the changes to take effect.
Warning: Jailbroken devices only. Only tested on ios 4.2.1 on an iPod Touch 4g. Use at your own risk.
Install ifuse and zenity. This will force the photos app to regenerate the photos database file. Uses zenity for file selection and progress bar.
#!/usr/bin/env bash
files=$(zenity --file-selection --multiple | tr "|" "\n")
filecount=$(echo "$files" | wc -l)
test -n "$files" || exit 1
test -d /mnt/ipod || gksudo mkdir /mnt/ipod
test -w /mnt/ipod || gksudo chmod a+w /mnt/ipod
test -d /mnt/ipod/private || ifuse --root /mnt/ipod || exit 1
cd /mnt/ipod/private/var/mobile/Media/DCIM/100APPLE || exit 1
counter=1
echo "$files" | while read file; do
echo "scale=1; 100 / ($filecount / $counter)" | bc
cp -n "$file" ./
((counter++))
done | zenity --progress --auto-close --width 700
counter=1
mkdir temp
for input in *.*; do
output=$(printf "IMG_%04d.${input##*.}" "$counter")
mv "$input" "temp/${output^^}"
((counter++))
done
mv temp/*.* ./
rmdir temp
mv -n ../../PhotoData/Photos.sqlite ../../PhotoData/Photos.sqlite.bak 2> /dev/null
cd
fusermount -u /mnt/ipod
After the transfer close and reopen the photos app for the changes to take effect.