plugins/gallery/fetcher.php
changeset 27 3d8ec1f7d191
parent 26 023a21c8f47c
child 28 36ea553da7ba
--- a/plugins/gallery/fetcher.php	Thu May 15 21:09:04 2008 -0400
+++ b/plugins/gallery/fetcher.php	Thu May 15 21:10:19 2008 -0400
@@ -92,11 +92,6 @@
       {
         die('Missing width or height.');
       }
-      $src_filename  = ENANO_ROOT . '/files/' . $row['img_filename'];
-      $dest_filename = ENANO_ROOT . '/cache/' . $row['img_filename'] . "-embed-$width-$height.$ext";
-      $filename =& $dest_filename;
-      $ext = get_file_extension($filename);
-      
       $width = intval($_GET['width']);
       $height = intval($_GET['height']);
       if ( empty($width) || empty($height) || $width > 2048 || $height > 2048 )
@@ -104,6 +99,11 @@
         die('Bad width or height');
       }
       
+      $src_filename  = ENANO_ROOT . '/files/' . $row['img_filename'];
+      $dest_filename = ENANO_ROOT . '/cache/' . $row['img_filename'] . "-embed-$width-$height.$ext";
+      $filename =& $dest_filename;
+      $ext = get_file_extension($filename);
+      
       if ( !file_exists($dest_filename) )
       {
         if ( !scale_image($src_filename, $dest_filename, $width, $height, false) )