Changeset 22367 for extensions/Autosize
- Timestamp:
- Apr 26, 2013, 1:51:34 PM (11 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r22360 r22367 773 773 $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 774 774 foreach($defined_types as $type){ 775 if(preg_match("|get_infos|", $DEBUG_autosize, $val)) $infos_message .= "$type, " ; 775 776 if($type!="Autosize" && $type!="SelMaxi" ){ 776 777 $last_derivative= $type ; … … 805 806 806 807 if(preg_match("|get_infos|", $DEBUG_autosize, $val)) 807 $infos_message .= "<br> get_min_max() $theMainImageWidth,$theMainImageHeight,$theContainerWidth,$theContainerHeight <br>" ; 808 809 foreach ($img_all as $img_select){ 810 808 $infos_message .= "<br> get_min_max() $pictureSelType $theMainImageWidth,$theMainImageHeight,$theContainerWidth,$theContainerHeight <br>" ; 809 foreach ($img_all as $img_select){ 811 810 $img_type = $img_select->get_type(); 812 $img_url = $img_select->get_path(); 811 $img_url = $img_select->get_path(); 812 if ($img_type=="square" || $img_type=="thumb" ) continue ; 813 813 $max_crop = 0 ; 814 814 $imgWH = self::Get_Size($img_select); 815 if ($img_type=="square" || $img_type=="thumb" ) continue ; 815 if(preg_match("|get_infos|", $DEBUG_autosize, $val)){ 816 $infos_message .= " $img_type $img_url "; 817 $infos_message .= $theImage_def. " Maxi:" . $theImage_maxi. " Mini:" . $theImage_mini; 818 } 819 816 820 if($img_type=="Autosize" || $img_type=="SelMaxi"){ 817 818 continue;821 $theImage_def +=1 ; 822 continue; 819 823 } 820 824 if(!file_exists(PHPWG_ROOT_PATH.$img_url)){ … … 823 827 if(preg_match("|get_infos|", $DEBUG_autosize, $val)) 824 828 $infos_message .= " File: $nofile <br>" ; 825 } 826 827 if(file_exists(PHPWG_ROOT_PATH.$img_url)){ 828 } // if file 829 829 } 830 830 if ($theImage_def==0){ 831 831 // Avant Autosize ou Original; 832 832 if($img_type=="Original") { 833 $theImage_def = 1;834 $theImage_maxi =1;835 $theImage_mini =1;833 $theImage_def += 1; 834 $theImage_maxi += 1; 835 $theImage_mini += 1; 836 836 if($ok==0){ 837 837 $last_image->type=$img_type; … … 840 840 } 841 841 }else{ 842 $last_derivative =$img_type ;843 $last_image =$img_select;842 $last_derivative = $img_type ; 843 $last_image = $img_select; 844 844 } 845 845 } 846 if ($theImage_maxi ==0){847 $maxi_image = $img_select;848 } 849 if ($theImage_mini ==0){846 if ($theImage_maxi == 0){ 847 $maxi_image = $img_select; 848 } 849 if ($theImage_mini == 0){ 850 850 $mini_image= $img_select; 851 851 } … … 859 859 } 860 860 if( $img_type=="Original" && $theImage_def==0 ){ 861 $theImage_def =1;861 $theImage_def +=1; 862 862 $img_type = $last_derivative ; 863 $img_url= $derivative->get_path();864 $imgWH = $derivative->get_size();863 $img_url= $derivative->get_path(); 864 $imgWH = $derivative->get_size(); 865 865 866 866 $default_image->type=$img_type; … … 869 869 870 870 } 871 $test= $imgWH[1] >= $theMainImageHeight;871 $test= ($imgWH[1] >= $theMainImageHeight); 872 872 if($has_pamoorama!=true){ 873 873 $test=( $imgWH[0] >= $theMainImageWidth) && $test; 874 } 874 } 875 875 //=================================================== 876 if($theImage_maxi==0) 877 if( $test==true ){ 878 $theImage_maxi=1; 876 if( $test==true ){ 877 $theImage_maxi +=1; 879 878 $maxi_image->type = $img_type; 880 879 $img_type=$img_select->get_type(); 881 if($img_type=="Original")882 $maxi_image = $last_image;883 else884 $maxi_image = $img_select;885 886 $maxi_image->url = $maxi_image->get_path();887 888 } else {889 890 $mini_image->type=$img_type;891 $mini_image->url=$img_url;892 $mini_image=$img_select;893 $mini_image->url = $mini_image->get_path(); 894 } 880 if($img_type=="Original") 881 $maxi_image = $last_image; 882 else 883 $maxi_image = $img_select; 884 885 $maxi_image->url = $maxi_image->get_path(); 886 } else { 887 $mini_image->type=$img_type; 888 $mini_image->url=$img_url; 889 $mini_image = $img_select; 890 $mini_image->url = $mini_image->get_path(); 891 } 892 893 895 894 if(preg_match("|get_infos|", $DEBUG_autosize, $val)){ 896 if (($imgWH[1] >= $theMainImageHeight)) $infos_message .="<span style='color:red'>";897 898 $infos_message .= ($imgWH[1] >= $theMainImageHeight)." Maxi:" . $maxi_image->url899 . " ---------- ImageUrl: $img_url "895 if($test) $infos_message .="<span style='color:red'>"; 896 $infos_message .= " Maxi_Url :" . $maxi_image->url 897 . " ImageUrl: $img_url " 898 . " Mini_Url :" . $mini_image->url 900 899 . $max_crop ." -> " . $img_type . " <br>" 901 900 . print_r($imgWH,true). " <br >"; 902 if ($test) $infos_message .="</span >"; 901 if ($test) $infos_message .="</span >"; 902 903 903 } 904 904 } // for … … 907 907 $img_url = $img_select->src_image->get_url(); 908 908 $imgSizeWH = $img_select->src_image->get_size(); 909 $liste_type["Original"]="Original".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 909 if(isset($liste_type["SelMaxi"])) die(); 910 $liste_type["SelMaxi"] = "SelMaxi".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 911 $liste_type["Autosize"] = "Autosize".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 912 $liste_type["Original"] = "Original".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 910 913 911 914 $retour=(object)'' ; 912 if ($pictureSelType=="Autosize") $retour= $maxi_image ;913 else if ($pictureSelType=="SelMaxi") $retour= $mini_image ;915 if ($pictureSelType=="Autosize") $retour = $maxi_image ; 916 else if ($pictureSelType=="SelMaxi") $retour = $mini_image ; 914 917 else{ 915 918 $types = array_intersect(array_keys($liste_type), array($pictureSelType)); … … 917 920 $pictureSelType="Original"; 918 921 } 919 $retours = explode(",",$liste_type[$pictureSelType]);920 $retour =$SelType_image;922 $retours = explode(",",$liste_type[$pictureSelType]); 923 $retour = $SelType_image; 921 924 $retour->type=$retours[0]; 922 925 $retour->url=$retours[1]; … … 927 930 $retour->type = $retour->get_type(); 928 931 $retour->url = $retour->get_path(); 929 930 932 } 931 933 if (isset( $retour->type) && $retour->type=="Original" ){ … … 941 943 if(preg_match("|get_minfos|", $DEBUG_autosize, $val)) 942 944 $infos_message .= $pictureSelType . " -> " . $retour->type . " : " . 943 $retour->url . 945 $retour->url .cl_print_var($liste_type) . 944 946 cl_print_var($retour->get_size()) . "<br >"; 945 947 -
extensions/Autosize/include/affiche.php
r22360 r22367 19 19 //=========================================================================== 20 20 $size= array( 21 'src_img_h' => $imgSizeWH[1],22 'src_img_w' => $imgSizeWH[0],23 'window_height' => $windowHeight,24 'window_width' => $windowWidth21 'src_img_h' => ($imgSizeWH[1]==0)?$_COOKIE['theMainImageHeight']:$imgSizeWH[1], 22 'src_img_w' => ($imgSizeWH[0]==0)?$_COOKIE['theMainImageWidth']:$imgSizeWH[0], 23 'window_height' =>($windowHeight==0)?$_COOKIE['windowHeight']:$windowHeight, 24 'window_width' => ($windowWidth==0)?$_COOKIE['windowWidth']:$windowWidth 25 25 ); 26 if($imgSizeWH[1]==0){ 27 print_r($size); 28 } 29 $ratio=$imgSizeWH[0]/$imgSizeWH[1]; 30 if(preg_match("|fin_affiche|", $DEBUG_autosize, $val)){ 31 echo "<pre>"; 32 echo $DEBUG_autosize.$infos_message." 33 "; 34 print_r(explode(",","$infos_message")); 35 print_r($events); 36 37 echo $pictureDeriv . " " . $pictureDeriv . " " . $pictureSelType; 38 39 echo "WH: " . $windowHeight . "x " .$windowWidth; 40 print_r($imgSizeWH); 41 print_r($_COOKIE); 42 43 44 die(); 45 } 46 47 26 $ratio=$size['src_img_w']/$size['src_img_h']; 48 27 $my_path = AUTOSIZE_PATH_ABS; 49 $theme=$user['theme']; 50 28 $theme=$user['theme']; 51 29 $user_status = $user['status'] ; 52 30 $template->assign( array( … … 65 43 $value = $type_size; 66 44 if($type_size != "square" && $type_size != "thumb" ) 67 $options[$value] = $type_size;45 $options[$value] = $type_size; 68 46 } 69 47 $autosize_parametres = cl_autosize_Get_Options(); … … 78 56 79 57 //=========================================== 80 $COOKIE_PATH = cookie_path() ;58 $COOKIE_PATH = cookie_path() ; 81 59 82 60 … … 169 147 ); 170 148 149 if(preg_match("|fin_affiche|", $DEBUG_autosize, $val)){ 150 echo "<pre>"; 151 echo $DEBUG_autosize."<br>"; 152 echo "autosize_parametres; ";print_r($autosize_parametres); 153 echo "infos_message; ";print_r(explode(",","$infos_message")); 154 echo "events; ";print_r($events); 155 echo $pictureDeriv . " " . $pictureDeriv . " " . $pictureSelType; 156 echo "WH: " . $windowHeight . "x " .$windowWidth; 157 echo "Size : ".print_r($size); 158 echo "COOKIE:".print_r($_COOKIE); 159 160 161 die(); 162 } 163 171 164 172 165 //unset($_POST); -
extensions/Autosize/js/Affiche_script.js
r22360 r22367 1 // problème avec GMaps+diaporama:1 // problème avec GMaps+diaporama: 2 2 // corriger gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow'])) 3 3 //============================================================== … … 218 218 219 219 } 220 Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);220 Zone_image.zoom = Zone_image.image.height / Zone_image.image_init.height; 221 221 zoom_cl = parseInt(100 * Zone_image.zoom) + "%"; ; 222 222 if (!Valid) { … … 448 448 break; 449 449 } 450 } 451 452 453 if (jQuery("#derivativeCheckedSelMaxi").length == 0) { 454 m1 = '<span style="visibility: hidden;" id="derivativeCheckedSelMaxi" class="switchCheck">✔ </span>'; 455 m1 += '<a style="visibility: visible;" href=""> SelMaxi<span class="derivativeSizeDetails"> (800 x 600)</span> </a><br>'; 456 m1 += '<span style="visibility: hidden;" id="derivativeCheckedAutosize" class="switchCheck">✔ </span>'; 457 m1 += '<a style="visibility: visible;" href=""> Autosize<span class="derivativeSizeDetails"> (800 x 600)</span> </a><br>'; 458 jQuery("#derivativeSwitchBox").append(m1); 459 450 460 } 451 461 options.liste_type = new_liste; … … 1040 1050 return; 1041 1051 } 1042 // jQuery(theImg).width(Zone_image.image_init.width);1043 for (n in options.liste_type) {1044 if (options.liste_type[n][0] == options.pictureSelType) {1045 Zone_image.image_init.height = options.liste_type[n][3];1046 Zone_image.image_init.width = options.liste_type[n][2];1047 break;1048 }1049 }1050 1051 1052 1052 jQuery(theImg).height(Zone_image.image_init.height); 1053 1053 set_cl("no"); … … 1115 1115 if (img_objs.length > 0) { 1116 1116 jQuery(img_objs).each(function (e) { 1117 // init_h1 = jQuery(this).height();1118 // init_w1 = jQuery(this).width();1119 }); 1117 // init_h1 = jQuery(this).height(); 1118 // init_w1 = jQuery(this).width(); 1119 }); 1120 1120 } 1121 1121 dp1 = jQuery("#charlie").offset(); … … 1134 1134 w01 = Math.ceil(h01 * Zone_image.image.rapport); 1135 1135 } 1136 jQuery("#theMainImage").height(png_h 1136 jQuery("#theMainImage").height(png_h); 1137 1137 jQuery("#theMainImage").width(w01 + wpng); 1138 1138 jQuery("#theMainImage").css({ verticalAlign: "middle", … … 1153 1153 1154 1154 1155 // jQuery("#charlie object").attr("width", w01);1155 // jQuery("#charlie object").attr("width", w01); 1156 1156 jQuery("#charlie object").attr("height", h01); 1157 // jQuery("#charlie embed").attr("width", w01); // firefox opera1157 // jQuery("#charlie embed").attr("width", w01); // firefox opera 1158 1158 jQuery("#charlie embed").attr("height", h01); 1159 1159 jQuery("#charlie embed").css("margin", "auto"); … … 1434 1434 options.pictureDeriv = last_id; 1435 1435 1436 return { url: pt[n][1], pictureDeriv: last_id, pictureMap: last_id, width: p t[n][2], height: pt[n][3]};1436 return { url: pt[n][1], pictureDeriv: last_id, pictureMap: last_id, width: parseInt(pt[n][2]), height: parseInt(pt[n][3]) }; 1437 1437 } 1438 1438 return { imgSrc: "", pictureDeriv: "", width: "", height: "" }; … … 1445 1445 Select_Image = function () { 1446 1446 memoire = options.imgSrc; 1447 if (options.imgSrc.match(RegExp(" gif", "gi")))1447 if (options.imgSrc.match(RegExp(".gif", "gi"))) 1448 1448 return; 1449 1449 var pt = options.liste_type; … … 1476 1476 return; 1477 1477 } 1478 Zone_image.zoom = Math.ceil(Zone_image.image.height / Zone_image.image_init.height);1478 Zone_image.zoom = Zone_image.image.height / Zone_image.image_init.height; 1479 1479 if (!theImg.src) 1480 1480 return true; … … 1942 1942 } 1943 1943 1944 marges_llgbo = options.marges_llgbo; 1944 marges_llgbo = options.marges_llgbo; // 48 ! 1945 1945 } 1946 1946 … … 2211 2211 // ========================================================== 2212 2212 2213 }); // ready2213 }); // ready 2214 2214 jQuery("#derivativeSwitchBox a").click(function (e) { 2215 2215 k1 = 0; -
extensions/Autosize/maintain.inc.php
r22122 r22367 114 114 $arr = @unserialize($conf['derivatives']); 115 115 if(!isset($arr['d']['Autosize'])){ 116 $arr['d']['SelMaxi']=ImageStdParams::get_custom( 9,9);117 $arr['d']['Autosize']=ImageStdParams::get_custom(10 , 10);116 $arr['d']['SelMaxi']=ImageStdParams::get_custom(800,600); 117 $arr['d']['Autosize']=ImageStdParams::get_custom(1008, 756); 118 118 $conf['derivatives']=serialize($arr); 119 119 $arr = @unserialize($conf['derivatives']);
Note: See TracChangeset
for help on using the changeset viewer.