| http://deepliquid.com/content/Jcrop.html **/ require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php'); require_once( NGGALLERY_ABSPATH . '/lib/image.php' ); if ( !is_user_logged_in() ) die(__('Cheatin’ uh?')); if ( !current_user_can('NextGEN Manage gallery') ) die(__('Cheatin’ uh?')); global $wpdb; $id = (int) $_GET['id']; // let's get the image data $picture = nggdb::find_image($id); include_once( nggGallery::graphic_library() ); $ngg_options=get_option('ngg_options'); $thumb = new ngg_Thumbnail($picture->imagePath, TRUE); $thumb->resize(350,350); // we need the new dimension $resizedPreviewInfo = $thumb->newDimensions; $thumb->destruct(); $preview_image = NGGALLERY_URLPATH . 'nggshow.php?pid=' . $picture->pid . '&width=350&height=350'; $imageInfo = @getimagesize($picture->imagePath); $rr = round($imageInfo[0] / $resizedPreviewInfo['newWidth'], 2); if ( ($ngg_options['thumbfix'] == 1) ) { $WidthHtmlPrev = $ngg_options['thumbwidth']; $HeightHtmlPrev = $ngg_options['thumbheight']; } else { // H > W if ($imageInfo[1] > $imageInfo[0]) { $HeightHtmlPrev = $ngg_options['thumbheight']; $WidthHtmlPrev = round($imageInfo[0] / ($imageInfo[1] / $ngg_options['thumbheight']),0); } else { $WidthHtmlPrev = $ngg_options['thumbwidth']; $HeightHtmlPrev = round($imageInfo[1] / ($imageInfo[0] / $ngg_options['thumbwidth']),0); } } ?>