Changeset 1072
- Timestamp:
- 09/16/06 23:25:35 (2 years ago)
- Files:
-
- feedmelinks/testing/icons/thumb.png (modified) (previous)
- feedmelinks/testing/new-profile-icons.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/testing/new-profile-icons.php
r1071 r1072 1 <% if( $type ) { %> 2 Try another format: 1 <title> 2 Test page: Create thumbnail for user 3 <title> 4 <% 5 include_once( "../modules/utils.inc.php" ); 6 %> 7 8 <% if( $user ) { %> 9 Try another user: 3 10 <% } %> 4 11 <form> 5 <select name=" type" onchange="form.submit();">6 <option value=""> pick a format</option>7 <option value="p ng">png</option>8 <option value="j pg">jpg</option>9 <option value=" gif">gif</option>12 <select name="user" onchange="form.submit();"> 13 <option value=""> pick a user </option> 14 <option value="pheezy">pheezy</option> 15 <option value="jm3">jm3</option> 16 <option value="eyeofaphrodite">eyeofaphrodite</option> 10 17 </select> 11 18 </form> 12 19 <% 13 20 14 if( $type ) { 15 $i = "icons/profile.$type"; 16 $out = thumbnailify_profile_image( $i ); 17 echo "Before: <a href='$i'><img src='$i' border='0'/></a> <br/>"; 18 $s = "icons/small.png"; 19 echo "(During:) <a href='$s'><img src='$s' border='0'/></a><br/>"; 20 echo "After: <a href='$out'><img src='$out' border='0'/></a>"; 21 if( $user ) { 22 $i = make_thumbnail_for_user( $user ); 23 echo "created thumbnail: <br/><a href='$i'><img src='$i' border='0'/></a> <br/>"; 21 24 } 22 23 # returns the PATH to the new thumbnail image 24 function thumbnailify_profile_image( $i ) { 25 $out = "icons/thumb.png"; 26 imagepng( get_png_thumbnail_from_image( $i ), $out ); 25 26 # returns the PATH to the newly created thumbnail 27 function make_thumbnail_for_user( $u ) { 28 $i = get_profile_image( $u ); 29 $out = "/" . get_user_folder( $u ) . "/thumb.png"; 30 imagepng( get_png_thumbnail_from_image( $i ), get_root() . $out ); 27 31 return $out; 28 32 } 29 33 34 # returns an image OBJECT of the newly created thumbnail 30 35 function get_png_thumbnail_from_image( $i ) { 31 36 $goal = 64;