Changeset 15346 for extensions/Histogram


Ignore:
Timestamp:
May 27, 2012, 2:06:02 PM (13 years ago)
Author:
grum
Message:

feature:2640 - Compatibility with Piwigo 2.4

Location:
extensions/Histogram
Files:
1 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/Histogram/hgram_aip.class.inc.php

    r8509 r15346  
    3939    $this->tabsheet->add('config',
    4040                          l10n('hgram_config'),
    41                           $this->getAdminLink()."&f_tabsheet=config");
     41                          $this->getAdminLink()."-config");
    4242  }
    4343
     
    5454  {
    5555    parent::initEvents();
    56     if($_REQUEST['f_tabsheet']=='search')
     56    if($_GET['tab']=='search')
    5757    {
    5858      // load request builder JS only on the search page
     
    7272    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/hgram_admin.tpl");
    7373
    74     switch($_REQUEST['f_tabsheet'])
     74    switch($_GET['tab'])
    7575    {
    7676      case 'config':
     
    7979    }
    8080
    81     $this->tabsheet->select($_REQUEST['f_tabsheet']);
     81    $this->tabsheet->select($_GET['tab']);
    8282    $this->tabsheet->assign();
    8383    $selected_tab=$this->tabsheet->get_selected();
     
    9797  protected function checkRequest()
    9898  {
    99     if(!isset($_REQUEST['f_tabsheet'])) $_REQUEST['f_tabsheet']='config';
     99    if(!isset($_GET['tab'])) $_GET['tab']='config';
    100100
    101     if(!($_REQUEST['f_tabsheet']=='config')) $_REQUEST['f_tabsheet']='config';
     101    if(!($_GET['tab']=='config')) $_GET['tab']='config';
    102102  }
    103103
  • extensions/Histogram/hgram_histogram.class.inc.php

    r8511 r15346  
    1818if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1919
     20define('MAX_PIXELS_ANALYZED', 1000000);
    2021
    2122
     
    9293        $imageHeight=imagesy($image);
    9394
     95
     96        $ratio=1;
     97        $nbPixels=$imageWidth*$imageHeight;
     98        if($nbPixels>MAX_PIXELS_ANALYZED) $ratio=$nbPixels/MAX_PIXELS_ANALYZED;
     99
     100        $imageWorkWidth=round($imageWidth/$ratio,0);
     101        $imageWorkHeight=round($imageHeight/$ratio,0);
     102        $imageWork=imagecreatetruecolor($imageWorkWidth,$imageWorkHeight);
     103        imagecopyresampled($imageWork, $image, 0, 0, 0, 0, $imageWorkWidth, $imageWorkHeight, $imageWidth, $imageHeight);
     104        //imagecopyresized($imageWork, $image, 0, 0, 0, 0, $imageWorkWidth, $imageWorkHeight, $imageWidth, $imageHeight);
     105        imagedestroy($image);
     106
    94107        $i=0;
    95         for($px=0;$px<$imageWidth;$px++)
    96         {
    97           for($py=0;$py<$imageHeight;$py++)
     108        for($px=0;$px<$imageWorkWidth;$px++)
     109        {
     110          for($py=0;$py<$imageWorkHeight;$py++)
    98111          {
    99112            $i++;
    100             $value=imagecolorat($image, $px, $py);
     113            $value=imagecolorat($imageWork, $px, $py);
    101114
    102115            $rgb=self::IntToRGB($value);
     
    116129        }
    117130
    118         imagedestroy($image);
     131        imagedestroy($imageWork);
    119132
    120133        self::$fileHistogram=Array(
    121           'pixels'   => $imageWidth*$imageHeight,
     134          'pixels'   => $imageWorkWidth*$imageWorkHeight,
    122135          'analyzed' => $i,
    123136          'time'     => microtime(true)-$time,
  • extensions/Histogram/hgram_version.inc.php

    r12221 r15346  
    1515  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1616
    17   define('HGRAM_VERSION',  '0.1.1');
    18   define('HGRAM_VERSION2', '00.01.01');
     17  define('HGRAM_VERSION',  '0.2.0');
     18  define('HGRAM_VERSION2', '00.02.00');
    1919  define('HGRAM_GPC_NEEDED', '3.5.2');
    2020?>
  • extensions/Histogram/main.inc.php

    r12221 r15346  
    22/*
    33Plugin Name: Histogram
    4 Version: 0.1.1
     4Version: 0.2.0
    55Description: Allow to make stat on pictures colors
    66Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=393
     
    2727|         |            |   . compatibility with Piwigo 2.2
    2828|         |            |
     29| 0.2.0   | 2011/09/25 | * mantis feature:2640
     30|         |            |   . compatibility with Piwigo 2.4
    2931|         |            |
    3032|         |            |
  • extensions/Histogram/templates/hgram_picture_histo.tpl

    r12221 r15346  
    1 {combine_script id="jquery" path="themes/default/js/jquery.min.js"}
     1{combine_script id="jquery" path="themes/default/js/jquery.js"}
    22
    33
    44<div id='iHistoContent' style='text-align:center;'>
    55{if $histoImg==''}
    6   {combine_script id="histogram.histoLoad" path="plugins/Histogram/js/histoLoad.min.js" require="jquery"}
     6  {combine_script id="histogram.histoLoad" path="plugins/Histogram/js/histoLoad.js" require="jquery"}
    77  <span id='iHistoTxt'>{'hgram_loading_histo'|@translate}</span>
    88  <script type='text/javascript'>
Note: See TracChangeset for help on using the changeset viewer.