{"id":306,"date":"2009-10-16T19:00:11","date_gmt":"2009-10-17T02:00:11","guid":{"rendered":"http:\/\/figureskatersonline.com\/news\/?p=306"},"modified":"2024-11-23T10:25:40","modified_gmt":"2024-11-23T15:25:40","slug":"rippon-third-after-personal-best-in-paris","status":"publish","type":"post","link":"https:\/\/figureskatersonline.com\/news\/2009\/10\/16\/rippon-third-after-personal-best-in-paris\/","title":{"rendered":"Rippon third after personal best in Paris"},"content":{"rendered":"<p>Two-time World Junior Champion Adam Rippon could be making his first appearance on a Grand Prix event podium after a personal best short program Friday at Trophee Eric Bompard in Paris, France. With his smooth performance to &#8220;Jonathan Livingston Seagull&#8221; written by Richard Bach, he secured a third place standing heading into the free skate with 75.82 points.<\/p>\n<p>Tomas Verner of the Czech Republic leads Japan\u2019s Nobunari Oda 81.00 to 79.20. Verner nailed a quadruple toe-triple toe combination, a triple axel and a triple lutz while Oda landed a triple axel, a triple lutz-triple toe and a triple flip, all in the early stages of his program.<\/p>\n<p>&#8220;It was a little bit shaky, but I&#8217;m happy with the jumps and the interpretation,&#8221; said Rippon, who was fifth and eighth at his Grand Prix events last year. He opened with a triple flip-triple toe combination and then went on to nail a triple axel, a jump that gave him trouble throughout the last season, and a variation of the Brian Boitano triple lutz with both hands clasped above his head.<\/p>\n<p>Rippon\u2019s triple axel \u201ctechnique really wasn&#8217;t spot on (last season),\u201d said coach Brian Orser, who is also the coach of ladies World Champion Yu-Na Kim of Korea. &#8220;Now, he&#8217;s a lot more confident with it.&#8221;<\/p>\n<p>Although his performance was strong, he lost points on the final combination spin of the program, receiving only a Level 1 for the move, something he attributes to rushing the opening camel. Most of Rippon\u2019s spins have received Level 3 or 4 in the past.<\/p>\n<p>Frenchman Brian Joubert, the 2007 World Champion who finished in third place behind American Evan Lysacek and Canadian Patrick Chan at the 2009 Worlds, is in sixth place after miscues on the landings of each of his jumping passes. He had no falls but still managed only 72.15, well off his personal best of 86.90 from last season\u2019s European Championships.<\/p>\n<p>American Ryan Bradley, the crowd pleaser who finished fourth at the 2009 U.S. Championships, is in eighth place with 65.21 points after botching the landing of his triple lutz, although he did not fall, and receiving only a Level 1 for his straight line step sequence. His program started with a quad toe-double toe and a triple axel.<\/p>\n<p>The men\u2019s competition concludes Saturday with the free skate starting at 1:30 p.m. local time.<\/p>\n<p>Earlier Friday in the compulsory dance, World bronze medalists Tessa Virtue and Scott Moir of Canada skated a solid Golden Waltz to position themselves in first place with 38.41. In second and third, Great Britain&#8217;s sibling team<br \/>\nSinead Kerr and John Kerr (36.13) and French champions Nathalie Pechalat and Fabian Bourzat (35.53).<\/p>\n<p>U.S. silver medalists Emily Samuelson and Evan Bates, who won a bronze medal at the NHK Trophy last season, are currently fourth with a score of 31.11. Two-time U.S. bronze medalists Kimberly Navarro and Brent Bommentre (29.19) sixth while Madison Hubbell and Keiffer Hubbell, fourth at the 2009 U.S. Championships, are seventh with 27.17.<\/p>\n<p>The ice dance competition continues Friday evening with the original dance. On Saturday at 6:15 p.m. local time, Trophee Eric Bompard wraps with the free dance.<\/p>\n<p>Trophee Eric Bompard is the first event of the 2009 International Skating Union (ISU) Grand Prix of Figure Skating circuit. The series, now in its 15th season, consists of six international events in a cumulative, point-scoring format. The top six scoring athletes in each discipline move onto the Grand Prix Final, Dec. 3-6, in Tokyo, Japan, which will be combined with the ISU Junior Grand Prix of Figure Skating Final for the second consecutive season.<\/p>\n<p>The six Grand Prix events are Trophee Eric Bompard, Oct. 15-18, in Paris, France; Rostelecom Cup, Oct. 22-25, in Moscow Russia; Cup of China, Oct. 29-Nov. 1, in Beijing, China; NHK Trophy, Nov. 5-8, in Nagano, Japan; Skate America, Nov. 12-15, in Lake Placid, N.Y.; and Skate Canada, Nov. 19-22, in Kitchener, Canada.<\/p>\n<p>The points toward the Grand Prix Final that are awarded for each place are 15 points for first; 13 points for second; 11 points for third; nine points for fourth; seven points for fifth; five points for sixth place; four points for seventh place; and three points for eighth. In pair skating, only the top six receive points.<br \/>\n__________<\/p>\n<p><em>Figure Skaters Online strives to be an accurate source of information related to the sport of figure skating. To report an error, please e-mail the news editor. Include the article date and title in your e-mail.<\/em><\/p>\n<div id=\"_mcePaste\" style=\"overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;\">&lt;?php<br \/>\n\/*<br \/>\nModified by Studio-XL.com<br \/>\nadded cropping position filter<br \/>\nmore info available at:http:\/\/blog.studio-xl.com\/work\/timthumb-cropping-mod<\/p>\n<p>TimThumb script created by Tim McDaniels and Darren Hoyt with tweaks by Ben Gillbanks<br \/>\nhttp:\/\/code.google.com\/p\/timthumb\/<\/p>\n<p>MIT License: http:\/\/www.opensource.org\/licenses\/mit-license.php<\/p>\n<p>Paramters<br \/>\n&#8212;&#8212;&#8212;<br \/>\nw: width<br \/>\nh: height<br \/>\nzc: zoom crop (0 or 1)<br \/>\nq: quality (default is 75 and max is 100)<\/p>\n<p>HTML example: &lt;img src=&#8221;\/scripts\/timthumb.php?src=\/images\/whatever.jpg&amp;w=150&amp;h=200&amp;zc=1&#8243; alt=&#8221;&#8221; \/&gt;<br \/>\n*\/<\/p>\n<p>\/*<br \/>\n$sizeLimits = array(<br \/>\n&#8220;100&#215;100&#8221;,<br \/>\n&#8220;150&#215;150&#8221;,<br \/>\n);<br \/>\n*\/<\/p>\n<p>define (&#8216;CACHE_SIZE&#8217;, 250);\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/ number of files to store before clearing cache<br \/>\ndefine (&#8216;CACHE_CLEAR&#8217;, 5);\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/ maximum number of files to delete on each cache clear<br \/>\ndefine (&#8216;VERSION&#8217;, &#8216;1.09&#8217;);\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/ version number (to force a cache refresh<\/p>\n<p>$imageFilters = array(<br \/>\n&#8220;1&#8221; =&gt; array(IMG_FILTER_NEGATE, 0),<br \/>\n&#8220;2&#8221; =&gt; array(IMG_FILTER_GRAYSCALE, 0),<br \/>\n&#8220;3&#8221; =&gt; array(IMG_FILTER_BRIGHTNESS, 1),<br \/>\n&#8220;4&#8221; =&gt; array(IMG_FILTER_CONTRAST, 1),<br \/>\n&#8220;5&#8221; =&gt; array(IMG_FILTER_COLORIZE, 4),<br \/>\n&#8220;6&#8221; =&gt; array(IMG_FILTER_EDGEDETECT, 0),<br \/>\n&#8220;7&#8221; =&gt; array(IMG_FILTER_EMBOSS, 0),<br \/>\n&#8220;8&#8221; =&gt; array(IMG_FILTER_GAUSSIAN_BLUR, 0),<br \/>\n&#8220;9&#8221; =&gt; array(IMG_FILTER_SELECTIVE_BLUR, 0),<br \/>\n&#8220;10&#8221; =&gt; array(IMG_FILTER_MEAN_REMOVAL, 0),<br \/>\n&#8220;11&#8221; =&gt; array(IMG_FILTER_SMOOTH, 0),<br \/>\n);<\/p>\n<p>\/\/ sort out image source<br \/>\n$src = get_request(&#8220;src&#8221;, &#8220;&#8221;);<br \/>\nif($src == &#8220;&#8221; || strlen($src) &lt;= 3) {<br \/>\ndisplayError(&#8220;no image specified&#8221;);<br \/>\n}<\/p>\n<p>\/\/ clean params before use<br \/>\n$src = cleanSource($src);<br \/>\n\/\/ last modified time (for caching)<br \/>\n$lastModified = filemtime($src);<\/p>\n<p>\/\/ get properties<br \/>\n$new_width \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0= preg_replace(&#8220;\/[^0-9]+\/&#8221;, &#8220;&#8221;, get_request(&#8220;w&#8221;, 0));<br \/>\n$new_height \u00a0\u00a0 \u00a0= preg_replace(&#8220;\/[^0-9]+\/&#8221;, &#8220;&#8221;, get_request(&#8220;h&#8221;, 0));<br \/>\n$zoom_crop \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0= preg_replace(&#8220;\/[^0-9]+\/&#8221;, &#8220;&#8221;, get_request(&#8220;zc&#8221;, 1));<br \/>\n$quality \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0= preg_replace(&#8220;\/[^0-9]+\/&#8221;, &#8220;&#8221;, get_request(&#8220;q&#8221;, 80));<br \/>\n$filters\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0= get_request(&#8220;f&#8221;, &#8220;&#8221;);<\/p>\n<p>\/\/ get crop position &#8211; added by studio-xl.com<br \/>\n$crop_from = get_request( &#8216;cropfrom&#8217;, &#8216;middle&#8217; ) ;<br \/>\n\/\/ get crop position &#8211; added by studio-xl.com<\/p>\n<p>if ($new_width == 0 &amp;&amp; $new_height == 0) {<br \/>\n$new_width = 100;<br \/>\n$new_height = 100;<br \/>\n}<\/p>\n<p>\/\/ set path to cache directory (default is .\/cache)<br \/>\n\/\/ this can be changed to a different location<br \/>\n$cache_dir = &#8216;.\/cache&#8217;;<\/p>\n<p>\/\/ get mime type of src<br \/>\n$mime_type = mime_type($src);<\/p>\n<p>\/\/ check to see if this image is in the cache already<br \/>\ncheck_cache( $cache_dir, $mime_type );<\/p>\n<p>\/\/ if not in cache then clear some space and generate a new file<br \/>\ncleanCache();<\/p>\n<p>ini_set(&#8216;memory_limit&#8217;, &#8220;30M&#8221;);<\/p>\n<p>\/\/ make sure that the src is gif\/jpg\/png<br \/>\nif(!valid_src_mime_type($mime_type)) {<br \/>\ndisplayError(&#8220;Invalid src mime type: &#8221; .$mime_type);<br \/>\n}<\/p>\n<p>\/\/ check to see if GD function exist<br \/>\nif(!function_exists(&#8216;imagecreatetruecolor&#8217;)) {<br \/>\ndisplayError(&#8220;GD Library Error: imagecreatetruecolor does not exist&#8221;);<br \/>\n}<\/p>\n<p>if(strlen($src) &amp;&amp; file_exists($src)) {<\/p>\n<p>\/\/ open the existing image<br \/>\n$image = open_image($mime_type, $src);<br \/>\nif($image === false) {<br \/>\ndisplayError(&#8216;Unable to open image : &#8216; . $src);<br \/>\n}<\/p>\n<p>\/\/ Get original width and height<br \/>\n$width = imagesx($image);<br \/>\n$height = imagesy($image);<\/p>\n<p>\/\/ don&#8217;t allow new width or height to be greater than the original<br \/>\nif( $new_width &gt; $width ) {<br \/>\n$new_width = $width;<br \/>\n}<br \/>\nif( $new_height &gt; $height ) {<br \/>\n$new_height = $height;<br \/>\n}<\/p>\n<p>\/\/ generate new w\/h if not provided<br \/>\nif( $new_width &amp;&amp; !$new_height ) {<\/p>\n<p>$new_height = $height * ( $new_width \/ $width );<\/p>\n<p>} elseif($new_height &amp;&amp; !$new_width) {<\/p>\n<p>$new_width = $width * ( $new_height \/ $height );<\/p>\n<p>} elseif(!$new_width &amp;&amp; !$new_height) {<\/p>\n<p>$new_width = $width;<br \/>\n$new_height = $height;<\/p>\n<p>}<\/p>\n<p>\/\/ create a new true color image<br \/>\n$canvas = imagecreatetruecolor( $new_width, $new_height );<br \/>\nimagealphablending($canvas, false);<br \/>\n\/\/ Create a new transparent color for image<br \/>\n$color = imagecolorallocatealpha($canvas, 0, 0, 0, 127);<br \/>\n\/\/ Completely fill the background of the new image with allocated color.<br \/>\nimagefill($canvas, 0, 0, $color);<br \/>\n\/\/ Restore transparency blending<br \/>\nimagesavealpha($canvas, true);<\/p>\n<p>if( $zoom_crop ) {<\/p>\n<p>$src_x = $src_y = 0;<br \/>\n$src_w = $width;<br \/>\n$src_h = $height;<\/p>\n<p>$cmp_x = $width\u00a0 \/ $new_width;<br \/>\n$cmp_y = $height \/ $new_height;<\/p>\n<p>\/\/ calculate x or y coordinate and width or height of source<\/p>\n<p>if ( $cmp_x &gt; $cmp_y ) {<\/p>\n<p>$src_w = round( ( $width \/ $cmp_x * $cmp_y ) );<br \/>\n$src_x = round( ( $width &#8211; ( $width \/ $cmp_x * $cmp_y ) ) \/ 2 );<\/p>\n<p>} elseif ( $cmp_y &gt; $cmp_x ) {<\/p>\n<p>$src_h = round( ( $height \/ $cmp_y * $cmp_x ) );<br \/>\n$src_y = round( ( $height &#8211; ( $height \/ $cmp_y * $cmp_x ) ) \/ 2 );<\/p>\n<p>}<\/p>\n<p>\/\/ Crop position &#8211; modification by Studi-XL.com<\/p>\n<p>if($crop_from ==&#8221;middle&#8221; )<br \/>\n\/\/ crop from center<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h ); }<br \/>\n\/\/ crop from middle left<br \/>\nelseif ($crop_from ==&#8221;middleleft&#8221; )<br \/>\n\/\/ crop from middle right<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, 0, $src_y, $new_width, $new_height, $src_w, $src_h ); }<br \/>\nelseif ($crop_from ==&#8221;middleright&#8221; )<br \/>\n\/\/ crop from top center<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, 2*$src_x, $src_y, $new_width, $new_height, $src_w, $src_h ); }<\/p>\n<p>elseif ($crop_from ==&#8221;topcenter&#8221; )<br \/>\n\/\/ crop from top center<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, 0, $new_width, $new_height, $src_w, $src_h ); }<br \/>\nelseif ($crop_from ==&#8221;topleft&#8221; )<br \/>\n\/\/ crop from top left<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $src_w, $src_h ); }<br \/>\nelseif ($crop_from ==&#8221;topright&#8221; )<br \/>\n\/\/ crop from top center<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, 2*$src_x, 0, $new_width, $new_height, $src_w, $src_h ); }<\/p>\n<p>elseif ($crop_from ==&#8221;bottomcenter&#8221; )<br \/>\n\/\/ crop from bottom center<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, 2*$src_y, $new_width, $new_height, $src_w, $src_h ); }<br \/>\nelseif ($crop_from ==&#8221;bottomleft&#8221; )<br \/>\n\/\/ crop from bottom left<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, 0, 2*$src_y, $new_width, $new_height, $src_w, $src_h ); }<br \/>\nelseif ($crop_from ==&#8221;bottomright&#8221; )<br \/>\n\/\/ crop from bottom center<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, 2*$src_x, 2*$src_y, $new_width, $new_height, $src_w, $src_h ); }<\/p>\n<p>elseif\u00a0 (!$crop_from)<br \/>\n\/\/ no data<br \/>\n{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h ); }<\/p>\n<p>\/\/ Crop position &#8211; modification by Studi-XL.com<\/p>\n<p>} else {<\/p>\n<p>\/\/ copy and resize part of an image with resampling<br \/>\nimagecopyresampled( $canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );<\/p>\n<p>}<\/p>\n<p>if ($filters != &#8220;&#8221;) {<br \/>\n\/\/ apply filters to image<br \/>\n$filterList = explode(&#8220;|&#8221;, $filters);<br \/>\nforeach($filterList as $fl) {<br \/>\n$filterSettings = explode(&#8220;,&#8221;, $fl);<br \/>\nif(isset($imageFilters[$filterSettings[0]])) {<\/p>\n<p>for($i = 0; $i &lt; 4; $i ++) {<br \/>\nif(!isset($filterSettings[$i])) {<br \/>\n$filterSettings[$i] = null;<br \/>\n}<br \/>\n}<\/p>\n<p>switch($imageFilters[$filterSettings[0]][1]) {<\/p>\n<p>case 1:<\/p>\n<p>imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);<br \/>\nbreak;<\/p>\n<p>case 2:<\/p>\n<p>imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);<br \/>\nbreak;<\/p>\n<p>case 3:<\/p>\n<p>imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);<br \/>\nbreak;<\/p>\n<p>default:<\/p>\n<p>imagefilter($canvas, $imageFilters[$filterSettings[0]][0]);<br \/>\nbreak;<\/p>\n<p>}<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ output image to browser based on mime type<br \/>\nshow_image($mime_type, $canvas, $cache_dir);<\/p>\n<p>\/\/ remove image from memory<br \/>\nimagedestroy($canvas);<\/p>\n<p>} else {<\/p>\n<p>if(strlen($src)) {<br \/>\ndisplayError(&#8220;image &#8221; . $src . &#8221; not found&#8221;);<br \/>\n} else {<br \/>\ndisplayError(&#8220;no source specified&#8221;);<br \/>\n}<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction show_image($mime_type, $image_resized, $cache_dir) {<\/p>\n<p>global $quality;<\/p>\n<p>\/\/ check to see if we can write to the cache directory<br \/>\n$is_writable = 0;<br \/>\n$cache_file_name = $cache_dir . &#8216;\/&#8217; . get_cache_file();<\/p>\n<p>if(touch($cache_file_name)) {<\/p>\n<p>\/\/ give 666 permissions so that the developer<br \/>\n\/\/ can overwrite web server user<br \/>\nchmod($cache_file_name, 0666);<br \/>\n$is_writable = 1;<\/p>\n<p>} else {<\/p>\n<p>$cache_file_name = NULL;<br \/>\nheader(&#8216;Content-type: &#8216; . $mime_type);<\/p>\n<p>}<\/p>\n<p>$quality = floor($quality * 0.09);<\/p>\n<p>imagepng($image_resized, $cache_file_name, $quality);<\/p>\n<p>if($is_writable) {<br \/>\nshow_cache_file($cache_dir, $mime_type);<br \/>\n}<\/p>\n<p>imagedestroy($image_resized);<\/p>\n<p>displayError(&#8220;error showing image&#8221;);<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction get_request( $property, $default = 0 ) {<\/p>\n<p>if( isset($_REQUEST[$property]) ) {<\/p>\n<p>return $_REQUEST[$property];<\/p>\n<p>} else {<\/p>\n<p>return $default;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction open_image($mime_type, $src) {<\/p>\n<p>if(stristr($mime_type, &#8216;gif&#8217;)) {<\/p>\n<p>$image = imagecreatefromgif($src);<\/p>\n<p>} elseif(stristr($mime_type, &#8216;jpeg&#8217;)) {<\/p>\n<p>@ini_set(&#8216;gd.jpeg_ignore_warning&#8217;, 1);<br \/>\n$image = imagecreatefromjpeg($src);<\/p>\n<p>} elseif( stristr($mime_type, &#8216;png&#8217;)) {<\/p>\n<p>$image = imagecreatefrompng($src);<\/p>\n<p>}<\/p>\n<p>return $image;<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n* clean out old files from the cache<br \/>\n* you can change the number of files to store and to delete per loop in the defines at the top of the code<br \/>\n*\/<br \/>\nfunction cleanCache() {<\/p>\n<p>$files = glob(&#8220;cache\/*&#8221;, GLOB_BRACE);<\/p>\n<p>$yesterday = time() &#8211; (24 * 60 * 60);<\/p>\n<p>if (count($files) &gt; 0) {<\/p>\n<p>usort($files, &#8220;filemtime_compare&#8221;);<br \/>\n$i = 0;<\/p>\n<p>if (count($files) &gt; CACHE_SIZE) {<\/p>\n<p>foreach ($files as $file) {<\/p>\n<p>$i ++;<\/p>\n<p>if ($i &gt;= CACHE_CLEAR) {<br \/>\nreturn;<br \/>\n}<\/p>\n<p>if (filemtime($file) &gt; $yesterday) {<br \/>\nreturn;<br \/>\n}<\/p>\n<p>unlink($file);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n* compare the file time of two files<br \/>\n*\/<br \/>\nfunction filemtime_compare($a, $b) {<\/p>\n<p>return filemtime($a) &#8211; filemtime($b);<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n* determine the file mime type<br \/>\n*\/<br \/>\nfunction mime_type($file) {<\/p>\n<p>if (stristr(PHP_OS, &#8216;WIN&#8217;)) {<br \/>\n$os = &#8216;WIN&#8217;;<br \/>\n} else {<br \/>\n$os = PHP_OS;<br \/>\n}<\/p>\n<p>$mime_type = &#8221;;<\/p>\n<p>if (function_exists(&#8216;mime_content_type&#8217;)) {<br \/>\n$mime_type = mime_content_type($file);<br \/>\n}<\/p>\n<p>\/\/ use PECL fileinfo to determine mime type<br \/>\nif (!valid_src_mime_type($mime_type)) {<br \/>\nif (function_exists(&#8216;finfo_open&#8217;)) {<br \/>\n$finfo = finfo_open(FILEINFO_MIME);<br \/>\n$mime_type = finfo_file($finfo, $file);<br \/>\nfinfo_close($finfo);<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ try to determine mime type by using unix file command<br \/>\n\/\/ this should not be executed on windows<br \/>\nif (!valid_src_mime_type($mime_type) &amp;&amp; $os != &#8220;WIN&#8221;) {<br \/>\nif (preg_match(&#8220;\/FREEBSD|LINUX\/&#8221;, $os)) {<br \/>\n$mime_type = trim(@shell_exec(&#8216;file -bi &#8220;&#8216; . $file . &#8216;&#8221;&#8216;));<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ use file&#8217;s extension to determine mime type<br \/>\nif (!valid_src_mime_type($mime_type)) {<\/p>\n<p>\/\/ set defaults<br \/>\n$mime_type = &#8216;image\/png&#8217;;<br \/>\n\/\/ file details<br \/>\n$fileDetails = pathinfo($file);<br \/>\n$ext = strtolower($fileDetails[&#8220;extension&#8221;]);<br \/>\n\/\/ mime types<br \/>\n$types = array(<br \/>\n&#8216;jpg&#8217;\u00a0 =&gt; &#8216;image\/jpeg&#8217;,<br \/>\n&#8216;jpeg&#8217; =&gt; &#8216;image\/jpeg&#8217;,<br \/>\n&#8216;png&#8217;\u00a0 =&gt; &#8216;image\/png&#8217;,<br \/>\n&#8216;gif&#8217;\u00a0 =&gt; &#8216;image\/gif&#8217;<br \/>\n);<\/p>\n<p>if (strlen($ext) &amp;&amp; strlen($types[$ext])) {<br \/>\n$mime_type = $types[$ext];<br \/>\n}<\/p>\n<p>}<\/p>\n<p>return $mime_type;<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction valid_src_mime_type($mime_type) {<\/p>\n<p>if (preg_match(&#8220;\/jpg|jpeg|gif|png\/i&#8221;, $mime_type)) {<br \/>\nreturn true;<br \/>\n}<\/p>\n<p>return false;<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction check_cache($cache_dir, $mime_type) {<\/p>\n<p>\/\/ make sure cache dir exists<br \/>\nif (!file_exists($cache_dir)) {<br \/>\n\/\/ give 777 permissions so that developer can overwrite<br \/>\n\/\/ files created by web server user<br \/>\nmkdir($cache_dir);<br \/>\nchmod($cache_dir, 0777);<br \/>\n}<\/p>\n<p>show_cache_file($cache_dir, $mime_type);<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction show_cache_file($cache_dir) {<\/p>\n<p>$cache_file = $cache_dir . &#8216;\/&#8217; . get_cache_file();<\/p>\n<p>if (file_exists($cache_file)) {<\/p>\n<p>$gmdate_mod = gmdate(&#8220;D, d M Y H:i:s&#8221;, filemtime($cache_file));<\/p>\n<p>if(! strstr($gmdate_mod, &#8220;GMT&#8221;)) {<br \/>\n$gmdate_mod .= &#8221; GMT&#8221;;<br \/>\n}<\/p>\n<p>if (isset($_SERVER[&#8220;HTTP_IF_MODIFIED_SINCE&#8221;])) {<\/p>\n<p>\/\/ check for updates<br \/>\n$if_modified_since = preg_replace(&#8220;\/;.*$\/&#8221;, &#8220;&#8221;, $_SERVER[&#8220;HTTP_IF_MODIFIED_SINCE&#8221;]);<\/p>\n<p>if ($if_modified_since == $gmdate_mod) {<br \/>\nheader(&#8220;HTTP\/1.1 304 Not Modified&#8221;);<br \/>\nexit;<br \/>\n}<\/p>\n<p>}<\/p>\n<p>$fileSize = filesize($cache_file);<\/p>\n<p>\/\/ send headers then display image<br \/>\nheader(&#8220;Content-Type: image\/png&#8221;);<br \/>\nheader(&#8220;Accept-Ranges: bytes&#8221;);<br \/>\nheader(&#8220;Last-Modified: &#8221; . $gmdate_mod);<br \/>\nheader(&#8220;Content-Length: &#8221; . $fileSize);<br \/>\nheader(&#8220;Cache-Control: max-age=9999, must-revalidate&#8221;);<br \/>\nheader(&#8220;Expires: &#8221; . $gmdate_mod);<\/p>\n<p>readfile($cache_file);<\/p>\n<p>exit;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction get_cache_file() {<\/p>\n<p>global $lastModified;<br \/>\nstatic $cache_file;<\/p>\n<p>if(!$cache_file) {<br \/>\n$cachename = $_SERVER[&#8216;QUERY_STRING&#8217;] . VERSION . $lastModified;<br \/>\n$cache_file = md5($cachename) . &#8216;.png&#8217;;<br \/>\n}<\/p>\n<p>return $cache_file;<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n* check to if the url is valid or not<br \/>\n*\/<br \/>\nfunction valid_extension ($ext) {<\/p>\n<p>if (preg_match(&#8220;\/jpg|jpeg|png|gif\/i&#8221;, $ext)) {<br \/>\nreturn TRUE;<br \/>\n} else {<br \/>\nreturn FALSE;<br \/>\n}<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n* tidy up the image source url<br \/>\n*\/<br \/>\nfunction cleanSource($src) {<\/p>\n<p>\/\/ remove slash from start of string<br \/>\nif(strpos($src, &#8220;\/&#8221;) == 0) {<br \/>\n$src = substr($src, -(strlen($src) &#8211; 1));<br \/>\n}<\/p>\n<p>\/\/ remove http\/ https\/ ftp<br \/>\n$src = preg_replace(&#8220;\/^((ht|f)tp(s|):\\\/\\\/)\/i&#8221;, &#8220;&#8221;, $src);<br \/>\n\/\/ remove domain name from the source url<br \/>\n$host = $_SERVER[&#8220;HTTP_HOST&#8221;];<br \/>\n$src = str_replace($host, &#8220;&#8221;, $src);<br \/>\n$host = str_replace(&#8220;www.&#8221;, &#8220;&#8221;, $host);<br \/>\n$src = str_replace($host, &#8220;&#8221;, $src);<\/p>\n<p>\/\/ don&#8217;t allow users the ability to use &#8216;..\/&#8217;<br \/>\n\/\/ in order to gain access to files below document root<\/p>\n<p>\/\/ src should be specified relative to document root like:<br \/>\n\/\/ src=images\/img.jpg or src=\/images\/img.jpg<br \/>\n\/\/ not like:<br \/>\n\/\/ src=..\/images\/img.jpg<br \/>\n$src = preg_replace(&#8220;\/\\.\\.+\\\/\/&#8221;, &#8220;&#8221;, $src);<\/p>\n<p>\/\/ get path to image on file system<br \/>\n$src = get_document_root($src) . &#8216;\/&#8217; . $src;<\/p>\n<p>return $src;<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n*<br \/>\n*\/<br \/>\nfunction get_document_root ($src) {<\/p>\n<p>\/\/ check for unix servers<br \/>\nif(@file_exists($_SERVER[&#8216;DOCUMENT_ROOT&#8217;] . &#8216;\/&#8217; . $src)) {<br \/>\nreturn $_SERVER[&#8216;DOCUMENT_ROOT&#8217;];<br \/>\n}<\/p>\n<p>\/\/ check from script filename (to get all directories to timthumb location)<br \/>\n$parts = array_diff(explode(&#8216;\/&#8217;, $_SERVER[&#8216;SCRIPT_FILENAME&#8217;]), explode(&#8216;\/&#8217;, $_SERVER[&#8216;DOCUMENT_ROOT&#8217;]));<br \/>\n$path = $_SERVER[&#8216;DOCUMENT_ROOT&#8217;] . &#8216;\/&#8217;;<br \/>\nforeach ($parts as $part) {<br \/>\n$path .= $part . &#8216;\/&#8217;;<br \/>\nif (file_exists($path . $src)) {<br \/>\nreturn $path;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ the relative paths below are useful if timthumb is moved outside of document root<br \/>\n\/\/ specifically if installed in wordpress themes like mimbo pro:<br \/>\n\/\/ \/wp-content\/themes\/mimbopro\/scripts\/timthumb.php<br \/>\n$paths = array(<br \/>\n&#8220;.&#8221;,<br \/>\n&#8220;..&#8221;,<br \/>\n&#8220;..\/..&#8221;,<br \/>\n&#8220;..\/..\/..&#8221;,<br \/>\n&#8220;..\/..\/..\/..&#8221;,<br \/>\n&#8220;..\/..\/..\/..\/..&#8221;<br \/>\n);<\/p>\n<p>foreach($paths as $path) {<br \/>\nif(@file_exists($path . &#8216;\/&#8217; . $src)) {<br \/>\nreturn $path;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ special check for microsoft servers<br \/>\nif(!isset($_SERVER[&#8216;DOCUMENT_ROOT&#8217;])) {<br \/>\n$path = str_replace(&#8220;\/&#8221;, &#8220;\\\\&#8221;, $_SERVER[&#8216;ORIG_PATH_INFO&#8217;]);<br \/>\n$path = str_replace($path, &#8220;&#8221;, $_SERVER[&#8216;SCRIPT_FILENAME&#8217;]);<\/p>\n<p>if( @file_exists( $path . &#8216;\/&#8217; . $src ) ) {<br \/>\nreturn $path;<br \/>\n}<br \/>\n}<\/p>\n<p>displayError(&#8216;file not found &#8216; . $src);<\/p>\n<p>}<\/p>\n<p>\/**<br \/>\n* generic error message<br \/>\n*\/<br \/>\nfunction displayError($errorString = &#8221;) {<\/p>\n<p>header(&#8216;HTTP\/1.1 400 Bad Request&#8217;);<br \/>\ndie($errorString);<\/p>\n<p>}<br \/>\n?&gt;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Two-time World Junior Champion Adam Rippon could be making his first appearance on a Grand Prix event podium after a personal best short program Friday at Trophee Eric Bompard in Paris, France. With his smooth performance to &#8220;Jonathan Livingston Seagull&#8221; written by Richard Bach, he secured a third place standing heading into the free skate with 75.82 points.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[41],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-gp","tag-adam-rippon"],"_links":{"self":[{"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":25,"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":47997,"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/posts\/306\/revisions\/47997"}],"wp:attachment":[{"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/figureskatersonline.com\/news\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}