I'm studdying the WWDC session #104 for mastering UIScrollViews. I need to create a script or find a tool or write a script to generate the tiles needed for the CATiledLayer from some large jpg photo.
1000 500 and 250 scale factors are needed and the generated tiles need to respect a naming pattern like this:
name_scale_col_row.jpg
Any suggestion for a tool or script that I could use for this or do I need to write one?
EDIT: I'm working on my own little bash script. This is what I did until now:
#!/bin/sh
file_list=`ls | grep png`
for i in 25 50 100; do
for file in $file_list; do
convert $file -scale ${i}%x${i}% -crop 256x256 \
-set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" \
+repage +adjoin "${file%.*}_${i}0_%[filename:tile].${file#*.}"
done
done
Of cours it's far from being a real tool but it works and respect the Apple photoscroller example naming convention for tiles. Any suggestion, improvement appreciated.