plugins/SpecialUpdownload.php
changeset 1364 68c17d935750
parent 1360 570abc94bd7f
equal deleted inserted replaced
1363:f1ed3e9298ae 1364:68c17d935750
   248 		$extension = $row['file_extension'];
   248 		$extension = $row['file_extension'];
   249 		if ( isset($_GET['fmt']) && in_array($_GET['fmt'], array('png', 'jpg')) )
   249 		if ( isset($_GET['fmt']) && in_array($_GET['fmt'], array('png', 'jpg')) )
   250 			$extension = ".{$_GET['fmt']}";
   250 			$extension = ".{$_GET['fmt']}";
   251 		
   251 		
   252 		$cache_filename = ENANO_ROOT . "/cache/{$filename}-{$row['time_id']}-{$width}x{$height}$extension";
   252 		$cache_filename = ENANO_ROOT . "/cache/{$filename}-{$row['time_id']}-{$width}x{$height}$extension";
   253 		if ( file_exists($cache_filename) )
   253 		if ( file_exists($cache_filename) && !isset($_GET['cache_override']) )
   254 		{
   254 		{
   255 			$fname = $cache_filename;
   255 			$fname = $cache_filename;
   256 		}
   256 		}
   257 		else
   257 		else
   258 		{
   258 		{
   279 					$allow_scale = true;
   279 					$allow_scale = true;
   280 				}
   280 				}
   281 			}
   281 			}
   282 			if ( $allow_scale )
   282 			if ( $allow_scale )
   283 			{
   283 			{
   284 				$result = scale_image($orig_fname, $fname, $width, $height);
   284 				$result = scale_image($orig_fname, $fname, $width, $height, isset($_GET['cache_override']));
   285 				if ( !$result )
   285 				if ( !$result )
   286 					$fname = $orig_fname;
   286 					$fname = $orig_fname;
   287 			}
   287 			}
   288 			else
   288 			else
   289 			{
   289 			{