Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Deepwinter
committed
Jun 28, 2012
1 parent
5dc9d04
commit 662fc12
Showing
6 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
#identify -format "<key>%f/key> <dict> <key>width</key> <string>%w</string> <key>height</key> <string>%h</string> </dict>" [0-9]*-[0-9]*.jpg | ||
identify -format "<key>%f</key> <dict> <key>width</key> <string>%w</string> <key>height</key> <string>%h</string> <key>name</key> <string>%f</string> </dict>" $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
#This script was created by Mike Lin | ||
#See http://www.mikelin.ca/blog/2010/06/iphone-splitting-image-into-tiles-for-faster-loading-with-imagemagick/ | ||
file=$1 | ||
function tile() { | ||
convert $file -scale ${s}%x -crop 256x256 \ | ||
-set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" \ | ||
+repage +adjoin "../../tiles/${file%.*}_${s}_%[filename:tile].${file#*.}" | ||
} | ||
s=100 | ||
tile | ||
s=50 | ||
tile | ||
s=20 | ||
tile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
#This script was created by Mike Lin | ||
#See http://www.mikelin.ca/blog/2010/06/iphone-splitting-image-into-tiles-for-faster-loading-with-imagemagick/ | ||
file=$1 | ||
function tile() { | ||
convert $file -scale ${s}%x -crop 256x256 \ | ||
-set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" \ | ||
+repage +adjoin "../../tiles/${file%.*}_${s}_%[filename:tile].${file#*.}" | ||
} | ||
s=$2 | ||
tile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
find . *[0-9]-[0-9]* -exec ~/image-scripts/tile.sh {} \; |