<?php session_start(); header("Cache-Control: no-cache, must-revalidate"); header("Content-type: image/jpg"); include_once 'imasetClass.php'; $imaset = new Imaset; $imaset->extFiltros();//cargo los filtros externos $img = substr(__FILE__,0,strpos(__FILE__,'plugins')).$_GET['img']; $im = $imaset->nuevaImagen($img); //aplico el historial de filtros $fi = $_GET['filt']; if(!empty($fi)) { if(ereg(';',$fi)) $filtros = explode(';',$fi); else $filtros = array($fi); $cant = count($filtros); for($i=0;$i<$cant;$i++) { if(ereg('-',$filtros[$i])){ $pts = explode('-',$filtros[$i]); $f = $pts[0]; $e = explode(',',$pts[1]); } else{ $f = $filtros[$i]; $e = false; } $im = $imaset->aplicaFiltro($im,$f,$e); } } //Resuelvo los tamaños if($_GET['dim']) $max = explode('x',$_GET['dim']); if($_GET['snap']) $max = array(128,128); if($im AND $max) { $ow = imagesx($im); $oh = imagesy($im); //tamanos originales $mw = $max[0]; $mh = $max[1]; // maximos if($oh>$mh){ $nh = $mh; $nw = $nh*$ow/$oh; if($nw>$mw){ $nh = $mw*$mh/$nw; $nw = $mw; } } elseif($ow>$mw) { $nw = $mw; $nh = $nw*$oh/$ow; if($nh>$mh){ $nw = $mh*$mw/$nh; $nh = $mh; } } if($nh && $nw){ $snap = imagecreatetruecolor($nw,$nh); imagecopyresized($snap, $im, 0, 0, 0, 0, $nw, $nh, $ow, $oh); $im = $snap; } } $imaset->exportaImagen($im,$img); ?>
<?php // You can customize imaset here || Personaliza algunos parametros define('IMASET_BACKGROUND','FFFFFF'); // Hex Background color | color de fondo en hexadecimal //Default languages included: 'es_ES', 'en', 'it_IT', 'zh_CN' define('IMASET_LANG','es_ES'); //language to use if avaliable (ie. 'en') | idioma a usar (ej. 'es_ES') define('IMASET_SRC','src/'); //folder to store images for watermark | carpeta donde almacenar tus imagenes para marcas de agua define('IMASET_AVOIDF','(plugins|languages|themes)'); // Folders to avoid | carpetas a evitar define('IMASET_AVOIDE','(thumbnail|miniatura)'); //Filetype extensions to avoid | extensiones de archivo a evitar ?>
#imasetDLayer { background-color: black; width: 100%; left: 0%; top: 0%; z-index: 1001; height: 2000px; position: absolute; -moz-opacity: 0.7; opacity: .7; filter: alpha(opacity=70) } #imasetLoading { display: none; background: #FFF url(<?php echo bloginfo( 'wpurl' ); ?>/wp-content/plugins/imaset/img/ajax-loader.gif) no-repeat left 50%; padding: 5px; padding-left: 40px; font-size:1.8em; position:absolute; left:25%; top: 40px; -moz-opacity: 0.8; opacity: .8; filter: alpha(opacity=80); } #imasetBackLoad {text-align:center;} #imasetBackLoad.proceso { background: transparent url(<?php echo bloginfo( 'wpurl' ); ?>/wp-content/plugins/imaset/img/ajax-loader.gif) no-repeat 50% 50%; } #imasetContent { background-color: white; border: 4px solid #CCC; width: 80%; left: 10%; top: 10%; z-index: 1002; height: 80%; position: absolute; padding: 10px; overflow:auto; } #imasetContent .sidebar { width:30%; background-color:#E8F3F8; border: 1px solid #3B729E; float:right; z-index: 1003; } #imasetContent .sidebar h3 { margin: 8px; padding: 0; font-family: sans-serif; } #imasetContent .sidebar h4 { margin: 0; padding: 4px 8px; background-color: #ACD4E6; border-bottom: 1px solid #3B729E; cursor: pointer; } #imasetContent .sidebar h4:hover { background-color: #7DB9D4; } #imasetContent .sidebar ul { margin: 4px; padding: 0; display: none; } #imasetContent .sidebar li { list-style: none; margin: 0; padding: 2px 4px; } #imasetContent .sidebar a { } #imasetContent .sidebar a.filtro { width: 50px; height: 50px; margin: 4px; display: block; float: left; border: 1px solid #6c7074; background-color: #FFF; } #imasetContent .sidebar img.imasetH { border: 0; width: 16px; height: 16px; padding: 0 4px; margin: 0; text-decoration: none; cursor: pointer; } #imasetContent .deshacer { display:block; clear:left; text-align:center; padding:4px; background-color: #BADB76; color: #3B6100; } #imasetContent .deshacer:hover { background-color: #D8FF88; } #imasetContent .sidebar #imasetMsg { clear: left; border: 1px solid #FFBE76; background-color: #FFF9C4; padding: 4px; margin: 5px; color: #603F00; } #imasetContent #imasetFiltersL { padding: 0 1em; } #imasetContent #imasetFiltersL li{ padding: 3px; background-color: #FFF; margin: 0; border-bottom: 1px solid #CCC; font-weight: bold; } #imasetContent #imasetFiltersL li a.imasetX{ font-size: 0px; display: block; float: left; border: 0; background: transparent url(<?php echo bloginfo( 'wpurl' ); ?>/wp-content/plugins/imaset/img/cross.png) no-repeat; width: 16px; height: 16px; padding: 0 4px; margin: 0; text-decoration: none; } #imasetContent .view { width: 60%; } #imasetContent .view #imasetImg { margin: 10px auto; display: block; } #imasetContent .view #imasetImg.proceso { -moz-opacity: 0.4; opacity: .4; filter: alpha(opacity=40) } #imasetContent .view #imasetPrevw { margin-top: 5px; border-top: 4px solid #45648B; } #imasetContent .view #imasetPrevw .page-numbers { background-color: #FFFFFF; } #imasetContent .view #imasetPrevw a.img { width: 128px; height: 128px; display: block; float: left; margin: 3px; }
<?php /* Plugin Name: Imaset Plugin URI: http://codis.boozox.net/proyecto/Imaset Description: Trata tus imágenes almacenadas en Wordpress con interesantes efectos Version: 2.1 Author: Alex Barros Author URI: http://boozox.net */ ## Licencia: GNU/GPL v3+ ## // JavaScript y CSS function imasetPS() { wp_print_scripts( array( 'sack' )); // biblioteca AJAX de Wordpress echo '<script type="text/javascript">'; ?> <!-- var imasetBUrl = '<?php bloginfo( 'wpurl' ); ?>'; var imasetFContent = '<? echo substr(__FILE__,0,strpos(__FILE__,'plugins')); ?>'; function ima$et(n) { return document.getElementById("imaset"+n); } function imasetStartLoad() { imasetCursor('wait'); imasetDLayer(); /* Load the dark background layer */ imasetContent('<span id="imasetLoading" style="float:left">Loading...</span>'); imasetLoadJS('../wp-content/plugins/imaset/imasetJS.php'); } function imasetCursor(c) { document.body.style.cursor = c; } function imasetDLayer() { document.location = '#'; if (ima$et("DLayer") != null) return false; var i = document.createElement("div"); i.id = "imasetDLayer"; i.setAttribute('onClick','imasetErase()'); document.body.appendChild(i); } function imasetErase() { imasetCursor('default'); var a = ima$et("Content"); if(a) a.parentNode.removeChild(a); var b = ima$et("DLayer"); if(b) b.parentNode.removeChild(b); } function imasetContent(t) { var ct = ima$et("Content"); if (ct == null) { ct = document.createElement("div"); ct.id = "imasetContent"; document.body.appendChild(ct); } ct.innerHTML = t; } function imasetLoadJS(src) { var j = document.createElement("script"); j.type = "text/javascript"; j.src = src; document.body.appendChild(j); } --> <?php echo '</script>'; echo '<style type="text/css">'; include('imasetStyle.css'); echo '</style>'; } //Ajax call function | funcion a la que llama Ajax function imasetAjax() { include_once 'imasetClass.php'; $imaset = new Imaset; $q = $_POST['q']; $qe = explode(':',$q); if($q == 'ini') { $imaset->explora(); //explora los directorios en busca de imagenes $imaset->extFiltros(); //incorpora los filtros exteriores if($imaset->num < 1) { $html = "<p>No images!</p>"; if(!empty($imaset->error)) foreach($imaset->error as $e) $html .= "<p>$e</p>"; } else { $html = "<div class=\"sidebar\"><h3>".$imaset->i('filters').":</h3>"; foreach($imaset->filtros as $c=>$v) { $html .= "<h4 onClick=\"imasetSidebarShow(this.id)\" id=\"imaset".$c."\">".$imaset->i($c)."</h4><ul id=\"imaset".$c."L\">"; foreach($v as $n=>$f) { $paramshw = $f['param'] ? ' <img class="imasetH" href="#" onClick="imasetAjax(\'filtro:'.$n.'\')" src="../wp-content/plugins/imaset/img/wand.png"/> ' : ''; $html .= "<li><a href=\"#\" onClick=\"imasetNewF('$n','".$imaset->i($n)."')\">".$imaset->i($n)."</a>$paramshw</li>"; } $html .= "</ul>"; } $html .= "<a class=\"deshacer\" onClick=\"imasetUndo(-1)\" href=\"#\">«".$imaset->i('undo')."</a><div id=\"imasetMsg\">".$imaset->i('choose_filter')."</div><ol id=\"imasetFiltersL\"></ol><input type=\"button\" class=\"button\" value=\"".$imaset->i('save')."\" onClick=\"imasetSave(); imasetMsg('".$imaset->i('wait')."');\" /><input type=\"button\" class=\"button\" value=\"".$imaset->i('import')."\" onClick=\"imasetAddImg(); imasetMsg('".$imaset->i('wait')."')\" /><input type=\"button\" class=\"button delete\" value=\"".$imaset->i('exit')."\" onClick=\"imasetClose()\" />"; $html .= "</div><div class=\"view\"><p id=\"imasetLoading\">".$imaset->i('loading')."</p><div id=\"imasetBackLoad\"><img onLoad=\"imasetImgLoaded()\" id=\"imasetImg\" src=\"../wp-content/plugins/imaset/prev.php?save=1&img=".$imaset->ims[0]."&dim=400x300&r=".mt_rand()."\" /></div><div id=\"imasetPrevw\">"; $html .= paginacio(0,$imaset->num); if($imaset->num < 12) $max = $imaset->num; else $max = 12; for($i=0;$i<$max;$i++) { $html .= "<a class=\"img\" href=\"#\" onClick=\"imasetToogleImg('".$imaset->ims[$i]."',1,0); imasetSaved = true;\"><img src=\"../wp-content/plugins/imaset/prev.php?snap=1&img=".$imaset->ims[$i]."&r=".mt_rand()."\" /></a>"; } $html .= '<div style="clear:left;"></div>'; $html .="</div></div>"; } die('imasetContent(\''.str_replace(array("\n","'"),array('',"\'"),$html).'\'); imasetSrc = "'.$imaset->ims[0].'";'); } elseif($qe[0]=='save') { $imaset->extFiltros(); //incorpora los filtros exteriores $im = $imaset->nuevaImagen($imaset->content.$qe[1]); if(!empty($qe[2])) { if(ereg(';',$qe[2])) $filtros = explode(';',$qe[2]); else $filtros = array($qe[2]); $cant = count($filtros); for($i=0;$i<$cant;$i++) { if(ereg('-',$filtros[$i])){ $pts = explode('-',$filtros[$i]); $f = $pts[0]; $e = explode(',',$pts[1]); } else{ $f = $filtros[$i]; $e = false; } $im = $imaset->aplicaFiltro($im,$f,$e); } } $s = $imaset->creaImagen($im,$imaset->content.$qe[1]); if($s) $msg = '<strong style=\\"color:green;\\">'.$imaset->i('saved_YES').'</strong>'; else $msg = '<strong style=\\"color:red;\\">'.$imaset->i('saved_NO').'</strong>'; die(' imasetMsg("'.$msg.'"); imasetSaved = true; imasetReset();'); } elseif(ereg("filtro",$q)) { $imaset->extFiltros(); //incorpora los filtros exteriores $f = $qe[1]; $pa = $imaset->Fa($f); if(isset($pa)) { $pa = $pa['param']; if($pa) { $msg = ''; if(is_array($pa)) { foreach($pa as $c=>$v) { $id = 'imasetPam_'.$c; $msg .= "<p>".$imaset->i($f.'_param_'.$c)."</p>"; if(is_array($v)) { $msg .= '<select id="'.$id.'">'; foreach($v as $vv) { if($c == 'file') $msg .= '<option value="'.$vv.'">'.$vv.'</option>'; else //special behaviour for marca filter $msg .= '<option value="'.$vv.'">'.$imaset->i($f.'_opt_'.$vv).'</option>'; } $msg .= '</select>'; } else { $msg .= '<input type="text" id="'.$id.'" value="'.$v.'">'; } $pams[] = '\'+ima$et(\'Pam_'.$c.'\').value+\''; } } else { $msg .= "<p>".$imaset->i($qe[1].'_param')."</p>"; } $msg .= "<p><input type=\"button\" class=\"button\ type=\"button\" onClick=\"imasetNewF('$f-".implode(',',$pams)."','".$imaset->i($f)."');\" value=\"".$imaset->i('apply')."\"></p>"; die('imasetMsg(\''.str_replace(array("\n","'"),array('',"\'"),$msg).'\');'); } else { die('imasetUpdateImg();'); } } else { die("imasetMsg('".$imaset->i('error')."')"); } } elseif(ereg("desde",$q)) { $imaset->explora(); //explora los directorios en busca de imagenes $p = $qe[1]; $html = paginacio($p,$imaset->num); if($imaset->num < ($p+12)) $max = $imaset->num; else $max = $p+12; for($i=$p;$i<$max;$i++) { $html .= "<a class=\"img\" href=\"#\" onClick=\"imasetToogleImg('".$imaset->ims[$i]."',1,0); imasetSaved = true\"><img src=\"../wp-content/plugins/imaset/prev.php?snap=1&img=".$imaset->ims[$i]."&r=".mt_rand()."\" /></a>"; } $html .= '<div style="clear:left;"></div>'; die('imasetPrevw(\''.str_replace(array("\n","'"),array('',"\'"),$html).'\');'); } elseif(ereg('alt',$q)) { $pts = explode(':',$q); $p = $pts[1]; global $wpdb; $alt_img = $wpdb->get_var("select post_title from $wpdb->posts where guid LIKE '%".mysql_real_escape_string($p)."'"); die( "imasetAddToEd('$alt_img'); imasetMsg('".$imaset->i('inserted').".');" ); } else { die("alert('Error')"); } } function paginate_links2( $args = '' ) { $defaults = array( 'base' => '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below) 'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number 'total' => 1, 'current' => 0, 'show_all' => false, 'prev_next' => true, 'prev_text' => __('« Previous'), 'next_text' => __('Next »'), 'end_size' => 1, // How many numbers on either end including the end 'mid_size' => 2, // How many numbers to either side of current not including current 'type' => 'plain', 'add_args' => false // array of query args to aadd ); foreach($defaults as $dfk => $dfv) { if(empty($args[$dfk])) $args[$dfk] = $dfv; } //$args = wp_parse_args( $args, $defaults ); // No wp v.1 compatible extract($args, EXTR_SKIP); // Who knows what else people pass in $args $total = (int) $total; if ( $total < 2 ) return; $current = (int) $current; $end_size = 0 < (int) $end_size ? (int) $end_size : 1; // Out of bounds? Make it the default. $mid_size = 0 <= (int) $mid_size ? (int) $mid_size : 2; $add_args = is_array($add_args) ? $add_args : false; $r = ''; $page_links = array(); $n = 0; $dots = false; $per = (int)$per; if ( $prev_next && $current && 1 < $current ) : $link = str_replace('%_%', 2 == $current ? '' : $format, $base); $link = str_replace('%#%', $current - 1, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); //$page_links[] = "<a class='prev page-numbers' href='" . clean_url($link) . "'>$prev_text</a>"; $link = ($current-2)*$per; $page_links[] = '<a class="next page-numbers" href="#" onclick="imasetAjax(\'desde:' . $link . '\')">'.$prev_text.'</a>'; endif; for ( $n = 1; $n <= $total; $n++ ) : if ( $n == $current ) : $page_links[] = "<span class='page-numbers current'>$n</span>"; $dots = true; else : if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : $link = str_replace('%_%', 1 == $n ? '' : $format, $base); $link = str_replace('%#%', $n, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); // $page_links[] = "<a class='page-numbers' href='" . $link . "'>$n</a>"; $link = ($n-1)*$per; $page_links[] = '<a class="next page-numbers" href="#" onclick="imasetAjax(\'desde:' . $link . '\')">'.$n.'</a>'; $dots = true; elseif ( $dots && !$show_all ) : $page_links[] = "<span class='page-numbers dots'>...</span>"; $dots = false; endif; endif; endfor; if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) : $link = str_replace('%_%', $format, $base); $link = str_replace('%#%', $current + 1, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); $link = $current*$per; $page_links[] = '<a class="next page-numbers" href="#" onclick="imasetAjax(\'desde:' . $link . '\')">'.$next_text.'</a>'; endif; switch ( $type ) : case 'array' : return $page_links; break; case 'list' : $r .= "<ul class='page-numbers'>\n\t<li>"; $r .= join("</li>\n\t<li>", $page_links); $r .= "</li>\n</ul>\n"; break; default : $r = join("\n", $page_links); break; endswitch; return $r; } //funcion de paginacion para imaset function paginacio($p,$total,$per=12){ $paged = ceil($p / $per); $paged++; $page_links = paginate_links2( array( 'base' => '%#%',//add_query_arg( 'paged', '%#%' ) 'format' => '', 'total' => ceil($total / $per), 'current' => $paged ? $paged : 1, 'prev_text' => '«', 'next_text' => '»', 'per' => $per )); if ( $page_links ) return '<p style="text-align:center;">'.$page_links.'</p>'; } function imasetBotonUso(){ echo '<input type="button" class="button" style="padding: 4px; margin:4px;" value="Imaset" onClick="imasetStartLoad()" />'; } add_action("admin_print_scripts", "imasetPS"); add_action('wp_ajax_imasetAjax', 'imasetAjax' ); add_action("edit_form_advanced", "imasetBotonUso"); ?>
<?php ## License | Licencia: GNU/GPL v3+ ## include 'settings.php'; class Imaset { var $error; // array que contiene los errores ocurridos durante la ejecucion var $lang; // array con las traducciones / metodo de traduccion var $i; //idioma var $content; //la direccion hasta wp-content var $dir; // directorio del plugin var $ims; // imagenes de un directorio var $num; //Cantidad de imagenes var $filtros; //Filtros disponibles var $extF; //Array asociativo, "nombre de filtro externo"=>funcion var $RGB, $Red, $Green, $Blue; function Imaset($i=false) { $this->i = $i; //idioma $this->dir = str_replace('imasetClass.php','',__FILE__); $this->content = substr(__FILE__,0,strpos(__FILE__,'plugins')); $rgb = $this->hexdec(IMASET_BACKGROUND); $this->Background = IMASET_BACKGROUND; $this->RGB = $rgb; $this->Red = $rgb[0]; $this->Green = $rgb[1]; $this->Blue = $rgb[2]; //Filtros disponibles por defecto $this->F('decoration','shadow',array('col'=>'CECECE','t'=>6)); $this->F('decoration','frame',array('col'=>'FFFFFF','t'=>6,'sha_col'=>'CECECE','sha_t'=>6)); $this->F('decoration','reflekt',array('s'=>30,'oi'=>60)); $this->F('decoration','perspectiva',array('lado'=>array('izq','der'))); $this->F('color','invertir',false); $this->F('color','colorizar',array('color'=>'DAFF00')); $this->F('effect','softblur',false); $this->F('effect','hardblur',false); $this->F('custom','marca',array('file'=>$this->dir_marcas(),'x'=>array('left','center','right'),'y'=>array('top','center','bottom'))); $this->F('custom','resize',array('w'=>'50%','h'=>'')); #TODO # revisar http://es2.php.net/manual/es/function.create-function.php para filtros nuevos # perfilar marca agua # filtro desplazar colores # hacer 3D reflect http://www.ajaxorized.com/reflection/reflection2.html # filtro smartShadow => interpreta el color de fondo y los muy próximos como transparentes, y hace sombra alrededor de la figura. Trabajarlo con matrices # efecto desvanecer http://www.hachemuda.com/2007/11/05/la-chuleta-de-wordpress-en-espanol/ $this->include_filters(); } function F($cat,$name,$param,$core=true,$e_lang=false) //New filter (category,name,parameters array,needs the this object(0/1),is in the core(0/1)) { $this->filtros[$cat][$name] = array ( 'param'=>$param, //parametros 'core'=>$core //true si es una funcion interna ); $this->add_lang($e_lang); } function Fa($n)//returns array with the name as key and the rest of parameters as value. If $n is set, returns its values { if($this->filtros) { foreach($this->filtros as $x) { foreach($x as $c=>$v) $a[$c] = $v; } if($n) return $a[$n]; else return $a; } else return null; } function i($c) { if($this->lang) { if(is_array($this->lang)) return empty($this->lang[$c]) ? $c : str_replace(array("'"),array("\'"),$this->lang[$c]); else return $c; } else { $this->lang(); return $this->i($c); } } function extFiltros() { $filts = $this->lee_dir($this->dir.'filters/',true,'\.xml$'); if(empty($filts)) return false; foreach($filts as $fi) { if(file_exists($this->content.$fi)) { $conts = implode('',file($this->content.$fi)); if(ereg('<filter>(.*)</filter>',$conts,$filter)) { $filter = $filter[1]; if(ereg('<name>(.*)</name>',$filter,$name)) $name = $name[1]; else $name = $fi; if(ereg('<category>(.*)</category>',$filter,$category)) $category = $category[1]; else $category = 'external'; if(ereg('<function>(.*)</function>',$filter,$function)) $function = $function[1]; else $function = 'return $im;'; if(ereg('<parameters>(.*)</parameters>',$filter,$parameters)) { preg_match_all('#<pa>(.*?)</pa>#ei',$parameters[1],$pa); $pa = $pa[1]; } else $pa = false; // prepare parameters unset($fpa); if(!empty($pa)) { $params = '$im,$imaset,'.implode(',',$pa); foreach($pa as $dpa) { $dpa = str_replace(array('$','"',"'"),'',$dpa); // remove characters i dont want $dpa = explode('=',$dpa); $n = trim($dpa[0]); $fpa[$n] = trim($dpa[1]); } } else { $params = '$im,$imaset'; $fpa = false; //no parameters } //create the function $this->extF[$name] = create_function($params,$function); //include the filter $this->F($category,$name,$fpa,false); } } } } function hexdec($h) { $h = str_replace('#','',$h); //drop # symbol if(strlen($h) == 3) return array(hexdec($h[0].$h[0]),hexdec($h[1].$h[1]),hexdec($h[2].$h[2])); // three characters return array(hexdec($h[0].$h[1]),hexdec($h[2].$h[3]),hexdec($h[4].$h[5])); // six characters } function ddir($dir) //por cuestion de estetica y de espacio, se considera raiz al directorio desde donde testea { return str_replace($this->content,'',$dir); } function explora() // orden para inspeccionar todas las imagenes disponibles { if(empty($this->ims)) $this->ims = $this->lee_dir($this->content,true); $this->num = count($this->ims); return $this->ims; } function lee_dir($dir,$ord=true,$types='\.(jpg|gif|png)$') //lee todo un directorio, si ord=true ordena los indices y los numera, sino la clave es la fecha de modificacion { $files = array(); if(substr($dir,-1)!='/') $dir .= '/'; //importante que acabe en "/" if (is_dir($dir)) { if ($gd = @opendir($dir)) { while (($ar = @readdir($gd)) !== false) { if($ar != '.' AND $ar != '..') //Evito el propio directorio y el directorio padre { if(is_dir($dir . $ar)) { if(!eregi(IMASET_AVOIDF,$ar)) // Si puedo leer subdirectorios... $files = $files + $this->lee_dir($dir.$ar,false); } else { if(eregi($types,$ar) AND !eregi('\.'.IMASET_AVOIDE,$ar)) { $tm = filemtime($dir.$ar); if(empty($tm)) $tm = 0; $files[$tm] = $this->ddir($dir).$ar; } } } } closedir($gd); if(!$ord) return $files; // No ordenar... if(!empty($files)) { krsort($files); //ordeno inversamente por claves, para mostrarlas en las mas nuevas primero foreach($files as $i) //coloco indices ordenados $ims[] = $i; $files = $ims; } return $files; } else { $this->error[] = 'Imposible abrir el directorio '.$dir ; return false; } } else { $this->error[] = $dir.' no es un directorio.' ; return false; } } // Misc function lang() //function that loads the language associative array { $opl = array($this->i,IMASET_LANG,'en'); $traduce = 'no'; $this->i = false; $dn = dirname(__FILE__); for($i=0;$i<count($opl);$i++) { $r = $dn.'/lang/'.$opl[$i].'.php'; if(!empty($opl[$i]) && $traduce=='no' && file_exists($r)) { include($r); $traduce = $imaset_lang; $this->i = $opl[$i]; } } $this->lang = $traduce; } function add_lang($q) //adds new content to the language array. $q must be an associative array { if(is_array($q)) { foreach($q as $c=>$v) if(empty($this->lang[$c])) $this->lang[$c] = $v; } } function dir_marcas() { $dir = $this->lee_dir($this->dir.IMASET_SRC); if(empty($dir)) return array(); foreach($dir as $d) $ndir[] = str_replace('plugins/imaset/'.IMASET_SRC,'',$d); return $ndir; } function include_filters() { $filts = $this->lee_dir($this->dir.'filters/',true,'\.php'); if(empty($filts)) return false; foreach($filts as $fi) { if(file_exists($this->content.$fi)) include($this->content.$fi); } } function chk($ar,$def) //check an array. $ar = array to check, $def = default array { if(is_array($ar) && is_array($def)) { foreach($def as $c=>$v) { if(isset($ar[$c])) $o[$c] = $ar[$c]; else $o[$c] = $v; } return $o; } else return false; } function lim($v,$max,$min) { if($v>$max) return $max; elseif($v<$min) return $min; return $v; } // Manejo de imagenes en GD function nuevaImagen($img) { $im = false; switch(true) { case eregi('\.jpg',$img): $im = imagecreatefromjpeg($img); break; case eregi('\.gif',$img): $imp = imagecreatefromgif($img); $x = imagesx($imp); $y = imagesy($imp); $im = imagecreatetruecolor($x,$y); imagefilledrectangle($im,0,0,$x,$y,imagecolorallocate($im,$this->Red,$this->Green,$this->Blue)); imagecopy($im,$imp,0,0,0,0,$x,$y); break; case eregi('\.png',$img): $imp = imagecreatefrompng($img); $x = imagesx($imp); $y = imagesy($imp); $im = imagecreatetruecolor($x,$y); imagefilledrectangle($im,0,0,$x,$y,imagecolorallocate($im,$this->Red,$this->Green,$this->Blue)); imagecopy($im,$imp,0,0,0,0,$x,$y); break; } return $im; } function creaImagen($im,$img) { $t = false; switch(true) { case eregi('\.jpg',$img): $t = imagejpeg($im,$img); break; case eregi('\.gif',$img): $t = imagegif($im,$img); break; case eregi('\.png',$img): $t = imagepng($im,$img); break; } imagedestroy($im); return $t; } function exportaImagen($im,$img) { $t = false; switch(true) { case eregi('\.jpg',$img): $t = imagejpeg($im); break; case eregi('\.gif',$img): $t = imagegif($im); break; case eregi('\.png',$img): $t = imagepng($im); break; } imagedestroy($im); return $t; } function aux($x,$y) { $im = imagecreatetruecolor($x,$y); imagefilledrectangle($im,0,0,$x,$y,imagecolorallocate($im,$this->Red,$this->Green,$this->Blue)); return $im; } #### #### Core filters #### function put_img($im,$src,$pr) // (original image source, new image dir, properties) { $default = array('align'=>'top left','alpha'=>100,'width'=>false,'height'=>false,'repeat'=>false); $pr = $this->chk($pr,$default); if(!file_exists($src)) {$this->error[] = 'Error on put_img filter. Src file does not exist'; return $im;} $im2 = $this->nuevaImagen($src); $ix = imagesx($im2); $iy = imagesy($im2); //new image sizes $ox = imagesx($im); $oy = imagesy($im); //original image sizes # { New image positioning } $pos = explode(' ',$pr['align']); // y position switch($pos[0]) { case 'top': $y = 0; break; case 'middle': case 'center': $y = ($oy/2)-($iy/2); break; case 'bottom': $y = $oy-$iy; break; default: $y = 0; } //x position switch($pos[1]) { case 'left': $x = 0; break; case 'middle': case 'center': $x = ($ox/2)-($ix/2); break; case 'right': $x = $ox-$ix; break; default: $x = 0; } # { New image sizes } // width if($pr['width']) $sx = $pr['width']; else $sx = $ix; // height if($pr['height']) $sy = $pr['height']; else $sy = $iy; # {New image Alpha} if($pr['alpha']) { $pr['alpha'] = $this->lim($pr['alpha'],100,0); //limit values to min 0 and max 100 imagecopymerge($im, $im2, $x, $y, 0, 0, $sx, $sy,$pr['alpha']); } else { imagecopy($im, $im2, $x, $y, 0, 0, $sx, $sy); } return $im; } function resize($im,$w='50%',$h='') { $ox = imagesx($im); $oy = imagesy($im); // Height if(ereg('[0-9]+\%',$h)) { $h = str_replace('%','',$h); $y = $oy * $h / 100; } elseif(is_numeric($h)) $y = $h; else $y = false; // Width if(ereg('[0-9]+\%',$w)) { $w = str_replace('%','',$w); $x = $ox * $w / 100; } elseif(is_numeric($w)) $x = $w; else $x = false; // If both are empty if(!$x && !$y) return $im; // no resize // New sizes if(!$x) { // if i dont care about x $ny = $y; $nx = $ny*$ox/$oy; } elseif(!$y) { // if i dont care about y $nx = $x; $ny = $nx*$oy/$ox; } else { // if x and y are set $nx = $x; $ny = $y; } // Let's resize! $im2 = $this->aux($nx,$ny); imagecopyresampled($im2,$im,0,0,0,0,$nx,$ny,$ox,$oy); return $im2; } function rounded($im,$col='FFFFFF',$or=10,$ma=5) // (Image resource, color (hex), Outer Radius, Margin, Full) Dibuja un rectangulo redondeado en im { $ox = imagesx($im); $oy = imagesy($im); $sx = 2*$ox; // duplico para mejor calidad (suavizar pixelado) $sy = 2*$oy; $or *= 2; $ma *= 2; $wi *= 2; $im2 = $this->aux($sx,$sy); //imagen auxiliar imagecopyresampled($im2,$im,0,0,0,0,$sx,$sy,$ox,$oy); //duplico tamaño if(is_array($col)) $rgb = $col; else $rgb = $this->hexdec($col); $color = imagecolorallocate($im2, $rgb[0],$rgb[1],$rgb[2]); //color deseado imagefilledarc($im2, $or+$ma, $or+$ma, $or*2, $or*2, 90, 0, $color, IMG_ARC_PIE); // TopLeft imagefilledarc($im2, $sx-$or-$ma, $or+$ma, $or*2, $or*2, 180, 90, $color, IMG_ARC_PIE); // TopRight imagefilledarc($im2, $or+$ma, $sy-$or-$ma, $or*2, $or*2, 0, 270, $color, IMG_ARC_PIE); // BottomLeft imagefilledarc($im2, $sx-$or-$ma, $sy-$or-$ma, $or*2, $or*2, 270, 180, $color, IMG_ARC_PIE); // BottomRight imagefilledrectangle($im2, $ma, ($or+$ma), $sx-$ma, ($sy-$or-$ma), $color); // 1st Rectangle imagefilledrectangle($im2, ($or+$ma), $ma, ($sx-$or-$ma), $sy-$ma, $color); //2nd Rectangle imagecopyresampled($im,$im2,0,0,0,0,$ox,$oy,$sx,$sy); //devuelvo el tam original return $im; } function shadow($im,$col='CECECE',$t=6) { $ox = imagesx($im); $oy = imagesy($im); $t = $this->lim($t,100,0); $sx = $ox+2*$t; $sy = $oy+2*$t; $im2 = $this->aux($sx,$sy); $rgb=$this->hexdec($col); $n = 0; for($i=$t;$i>0;$i--) { $color = array( $rgb[0]+(($this->Red-$rgb[0])/($t-1))*($i-1), $rgb[1]+(($this->Green-$rgb[1])/($t-1))*($i-1), $rgb[2]+(($this->Blue-$rgb[2])/($t-1))*($i-1)); $im2 = $this->rounded($im2,$color,10+$i,$n); $n++; } imagecopymerge($im2,$im,$t,$t,0,0,$ox,$oy,100); return $im2; } function frame ($im,$col='FFFFFF',$t=6,$sha_col='CECECE',$sha_t=6) { $ox = imagesx($im); $oy = imagesy($im); $t = $this->lim($t,100,0); $sha_t = $this->lim($sha_t,100,0); $sx = $ox+2*$t+2*$sha_t; $sy = $oy+2*$t+2*$sha_t; $im2 = $this->aux($sx,$sy); $rgb=$this->hexdec($sha_col); $n = 0; for($i=$sha_t;$i>0;$i--) { $color = array( $rgb[0]+(($this->Red-$rgb[0])/($sha_t-1))*($i-1), $rgb[1]+(($this->Green-$rgb[1])/($sha_t-1))*($i-1), $rgb[2]+(($this->Blue-$rgb[2])/($sha_t-1))*($i-1)); $im2 = $this->rounded($im2,$color,10+$i,$n); $n++; } $im2 = $this->rounded($im2,$col,$t,$sha_t); imagecopymerge($im2,$im,$t+$sha_t,$t+$sha_t,0,0,$ox,$oy,100); return $im2; } function reflekt($im,$s=30,$oi=60) // s: tamaño reflejo; oi: opacidad inicial { //controlo los limites $s = $this->lim($s,300,1); $oi = $this->lim($oi,100,5); $sx = imagesx($im); $sy = imagesy($im); $x = $sx; $y = $sy+$s; $reflekt = imagecreatetruecolor($x,$y); $color = imagecolorallocate($reflekt, $this->Red,$this->Green,$this->Blue); //Fondo imagefilledrectangle($reflekt, 0, 0, $x, $y, $color); //Relleno el fondo imagecopy($reflekt, $im, 0, 0, 0, 0, $sx, $sy); for($i=0;$i<=$s;$i++) imagecopymerge($reflekt, $im, 0, $sy+$i, 0, $sy-($i+1), $x, 1, round($oi-($i*$oi/$s))); return $reflekt; } function marca($im,$mar,$x,$y) { if(!$mar) { $dirm = $this->dir_marcas(); $mar = $dirm[0]; } return $this->put_img($im,$this->dir.IMASET_SRC.$mar,array('align'=>$y.' '.$x)); } function perspectiva($im,$dir = 'der') // der = right perspective; Any other value = left perspective { $porc = 20; // el porcentaje de reducción $x = imagesx($im); $y = imagesy($im); $ampl = 2; //a cuanto ampliar la imagen para mejorar la resolucion $tx = $x * $ampl; $ty = $y * $ampl; $pers = imagecreatetruecolor($tx,$ty); $color = imagecolorallocate($pers, $this->Red,$this->Green,$this->Blue); //Color de fondo imagefilledrectangle($pers, 0, 0, $tx, $ty, $color); //Relleno el fondo $factor = ($porc/100)/$x ; $derecha = $dir == 'der'; for($i=0;$i<$tx;$i++) { $hy = round($ty-($y*($i+1)*$factor*$ampl)); $py = round(($ty-$hy)/2); if($derecha) $j = $i; else $j = $tx-$i; imagecopyresampled( $pers, $im, $j, $py, $j/$ampl, 0, 1, $hy, 1, $y ); } $pers2 = imagecreatetruecolor(0.7*$x,$y); imagecopyresampled($pers2, $pers, 0, 0, 0, 0, 0.7*$x, $y, $tx, $ty); return $pers2; } function invertir($im) //invert colours { $sx = imagesx($im); $sy = imagesy($im); for($x=0;$x<$sx;$x++) { for($y=0;$y<$sy;$y++) { $rgb = ImageColorAt($im, $x, $y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; $c = imagecolorallocate($im,(255-$r),(255-$g),(255-$b)); //genero el color inverso imagesetpixel($im,$x,$y,$c); //lo aplico en la imagen } } return $im; } function mono(&$im, $hex = 'FFFFFF') { //hex2dec $tint_r = hexdec($hex[0].$hex[1]); $tint_g = hexdec($hex[2].$hex[3]); $tint_b = hexdec($hex[4].$hex[5]); $width = imagesx($im); $height = imagesy($im); $dest = imagecreate ($width, $height); for ($i=0; $i<256; $i++) imagecolorallocate ($dest, $i, $i, $i); imagecopyresized ($dest, $im, 0, 0, 0, 0, $width, $height, $width, $height); for ($i = 0; $i < 256; $i++) imagecolorset ($dest, $i, min($i * abs($tint_r) / 255, 255), min($i * abs($tint_g) / 255, 255), min($i * abs($tint_b) / 255, 255)); $img = imagecreate ($width, $height); imagecopy ($im, $dest, 0, 0, 0, 0, $width, $height); imagedestroy ($dest); return $im; } function imageconvolution($src, $filter, $filter_div, $offset) // http://es2.php.net/manual/es/function.imageconvolution.php { if ($src==NULL) { return 0; } $sx = imagesx($src); $sy = imagesy($src); $srcback = ImageCreateTrueColor ($sx, $sy); ImageCopy($srcback, $src,0,0,0,0,$sx,$sy); if($srcback==NULL){ return 0; } for ($y=0; $y<$sy; ++$y) { for($x=0; $x<$sx; ++$x) { $new_r = $new_g = $new_b = 0; $alpha = imagecolorat($srcback, $pxl[0], $pxl[1]); $new_a = $alpha >> 24; for ($j=0; $j<3; ++$j) { $yv = min(max($y - 1 + $j, 0), $sy - 1); for ($i=0; $i<3; ++$i) { $pxl = array(min(max($x - 1 + $i, 0), $sx - 1), $yv); $rgb = imagecolorat($srcback, $pxl[0], $pxl[1]); $new_r += (($rgb >> 16) & 0xFF) * $filter[$j][$i]; $new_g += (($rgb >> 8) & 0xFF) * $filter[$j][$i]; $new_b += ($rgb & 0xFF) * $filter[$j][$i]; } } $new_r = ($new_r/$filter_div)+$offset; $new_g = ($new_g/$filter_div)+$offset; $new_b = ($new_b/$filter_div)+$offset; $new_r = ($new_r > 255)? 255 : (($new_r < 0)? 0:$new_r); $new_g = ($new_g > 255)? 255 : (($new_g < 0)? 0:$new_g); $new_b = ($new_b > 255)? 255 : (($new_b < 0)? 0:$new_b); $new_pxl = ImageColorAllocateAlpha($src, (int)$new_r, (int)$new_g, (int)$new_b, $new_a); if ($new_pxl == -1) { $new_pxl = ImageColorClosestAlpha($src, (int)$new_r, (int)$new_g, (int)$new_b, $new_a); } if (($y >= 0) && ($y < $sy)) { imagesetpixel($src, $x, $y, $new_pxl); } } } imagedestroy($srcback); return 1; } function convolution($im,$m) { if (function_exists('imageconvolution')) imageconvolution($im, $m, 16, 0); else $this->imageconvolution($im, $m, 16, 0); return $im; } // Filtros derivados function colorizar($im,$col) { if(!$col) $col = 'DAFF00'; return $this->mono($im,$col); } function softblur($im) { return $this->convolution($im,array(array( 1, 1, 1 ),array( 1, 8, 1 ),array( 1, 1, 1 ))); } function hardblur($im) { return $this->convolution($im,array(array( 2, 2, 2 ),array( 2, 2, 2 ),array( 2, 2, 2 ))); } function reflect3d($im,$s,$h,$oi) { //controlo los limites $s = $this->lim($s,300,1); $oi = $this->lim($oi,100,5); $sx = imagesx($im); $sy = imagesy($im); $x = $sx+2*$h; $y = $sy+$s; $reflekt = imagecreatetruecolor($x,$y); $color = imagecolorallocate($reflekt, $this->Red,$this->Green,$this->Blue); //Fondo imagefilledrectangle($reflekt, 0, 0, $x, $y, $color); //Relleno el fondo imagecopy($reflekt, $im, $h, 0, 0, 0, $sx, $sy); for($i=0;$i<=$s;$i++) # Falta acabar!!! imagecopyresampled($reflekt, $im, $h-($h/$s)*$i, $sy+$i, 0, $sy-($i+1), $x, 1, round($oi-($i*$oi/$s))); return $reflekt; } // aplicacion de filtros || function to apply any avaliable filter function aplicaFiltro($im,$n,$e=array()) //resource im, nombre n, extra e { $f = $this->Fa($n); if(isset($f)) { $func = $f['core'] ? array($this,$n) : $this->extF[$n]; //funcion a llamar if(!$e) $e = array(); $params = $f['core'] ? array_merge(array($im),$e) : array_merge(array($im,$this),$e); //parametros pasados $im2 = call_user_func_array($func,$params); return $im2; //if(is_resource($im2)) return $im2; //else return $im; } else return $im; } } ?>
<?php include('imasetClass.php'); $i = new Imaset; if($i->Background != 'FFFFFF') echo 'ima$et(\'Content\').style.backgroundColor = \'#'.$i->Background.'\';'; ?> imasetDisplay(); // START! var imasetON = false; var imasetSrc = false; var imasetSaved = true; var imasetLLF = 0; var imasetFilt= new Array(); // keis for filters var imasetFiltN = new Array(); // names of filters // General functions function imasetDisplay() { imasetCursor('progress'); imasetContent('<span id="imasetLoading" style="float:left"><?php echo $i->i('loading'); ?></span>'); imasetAjax('ini'); ima$et('DLayer').setAttribute('onClick','imasetClose()'); imasetON = true; return true; } function imasetPrevw(c) { ima$et("Prevw").innerHTML = c; } function imasetClose() { if(imasetFilt.length > 0 && !imasetSaved) { if(confirm("<?php echo $i->i('alert_not_saved')?>")) { imasetSaved = true; imasetClose(); } } else { imasetErase(); imasetON = false; } return false; } function imasetSave() { if(imasetFilt.length == 0) alert("<?php echo $i->i('no_changes')?>"); else { imasetMsg("<?php echo $i->i('wait')?>"); imasetAjax('save:'+imasetSrc+':'+imasetFilters()); } } function imasetNewF(s,d) { var n = imasetFilt.length; imasetFilt[n] = s; imasetFiltN[n] = d; imasetUpdateImg(); } function imasetUndo(n) { if(imasetFilt.length == 0) return 0; if(n>-1) { imasetFilt.splice(n,1); //removes the n filter imasetFiltN.splice(n,1); } else { imasetFilt.pop(); //removes the last filt imasetFiltN.pop(); } imasetUpdateImg(); } function imasetReset() { imasetFilt = new Array(); imasetFiltN = new Array(); imasetFLUpdate(); } //Sidebar functions function imasetMsg(m) { if(ima$et("Msg") && imasetLLF!=2) ima$et("Msg").innerHTML = m; } function imasetSidebarHideAll() { var i,ty,ctd; ty = document.getElementsByTagName('h4'); ctd = ty.length; for(i=0;i<ctd;i++) { document.getElementById(ty[i].id+'L').style.display = 'none'; } } function imasetSidebarShow(id) { var l = document.getElementById(id+'L'); if(l.style.display == 'block') { imasetSidebarHideAll(); } else { imasetSidebarHideAll(); l.style.display = 'block'; } } function imasetFLUpdate() // update applied filters list { var o = ima$et('FiltersL'); o.innerHTML = ''; if(imasetFilt.length > 0) { if(o) { for(var i=0;i<imasetFilt.length;i++) { l = document.createElement("li"); x = document.createElement("a"); x.href = '#'; x.innerHTML = 'x'; x.setAttribute('class','imasetX'); x.setAttribute('onClick','imasetUndo('+i+')'); l.appendChild(x); l.innerHTML += ' '+imasetFiltN[i]; o.appendChild(l); } } imasetSaved = false; } else { imasetSaved = true; } } //Image manage functions function imasetFilters() { return imasetFilt.join(';'); } function imasetToogleImg(src,s,f) { ima$et("Img").setAttribute('class','proceso'); ima$et("BackLoad").setAttribute('class','proceso'); imasetMsg("<?php echo $i->i('loading_image')?>"); imasetCursor('progress'); if(s){ imasetSrc = src; imasetReset();} //reinicio var filt = f ? imasetFilters() : '' ; //filtros ima$et("Img").src = '../wp-content/plugins/imaset/prev.php?img='+imasetSrc+'&filt='+filt+'&dim=400x300&save='+s+'&r='+Math.floor(Math.random()*100); } function imasetUpdateImg() { imasetToogleImg(imasetSrc,0,1); imasetFLUpdate(); } function imasetAddImg() { return imasetAjax('alt:'+imasetSrc); } function imasetAddToEd(alt) { var url = imasetBUrl+'/wp-content/'+imasetSrc; image = new Image(); image.src = url+'?r='+Math.random(); h = "<img src='" + url + "' alt='"+alt+"' />"; var win = window.opener ? window.opener : window.dialogArguments; if ( !win ) win = top; tinyMCE = win.tinyMCE; if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) { tinyMCE.selectedInstance.getWin().focus(); tinyMCE.execCommand('mceInsertContent', false, h); } else win.edInsertContent(win.edCanvas, h); } function imasetImgLoaded() { ima$et("Img").setAttribute('class',''); ima$et("BackLoad").setAttribute('class',''); imasetMsg("<?php echo $i->i('choose_filter')?>"); imasetCursor('default'); } //Load displaying function imasetLoading() { imasetCursor('progress'); if(ima$et("Loading")) ima$et("Loading").style.display = 'block'; imasetMsg("<?php echo $i->i('loading')?>"); } function imasetLoaded() { if(ima$et("Loading")) ima$et("Loading").style.display = 'none'; imasetCursor('default'); imasetMsg("<?php echo $i->i('choose_filter')?>"); } //Ajax function imasetAjax(q) { var mysack = new sack(imasetBUrl+"/wp-admin/admin-ajax.php" ); mysack.execute = 1; mysack.method = 'POST'; mysack.setVar( "action", "imasetAjax" ); mysack.setVar( "q", q ); mysack.encVar( "cookie", document.cookie, false ); mysack.onLoading = imasetLoading; mysack.onLoaded = imasetLoaded; mysack.onError = function() { alert('AJAX Failed' )}; mysack.runAJAX(); return true; }
<filter>
<name>brillo</name>
<category>decoration</category>
<function>
$w = imagesx($im);
$h = imagesy($im);
$nh = $h*2; $nw = $w*2; //amplio, para ganar calidad
$imblanc = imagecreatetruecolor(1,$nh);
$color = imagecolorallocate($imblanc, 255,255,255); //Blanco
imagefilledrectangle($imblanc, 0, 0, 1, $nh, $color); //Relleno el fondo
$im2 = imagecreatetruecolor($nw,$nh);
imagefilledrectangle($im2, 0, 0, $nw, $nh, $color); //Relleno el fondo
imagecopyresampled ($im2,$im,0,0,0,0,$nw,$nh,$w, $h);
for($i=0; $i<$nw; $i++)
{
imagecopymerge($im2, $imblanc, $i, 0, 0, 0, 1, ($nh/2+($nh/25)*sin(6.3/$nw*$i)), 25);
}
imagecopyresampled ($im,$im2,0,0,0,0,$w, $h,$nw,$nh);
imagedestroy($im2);
return $im;
</function>
</filter>
<filter>
<name>wave</name>
<category>decoration</category>
<parameters>
<pa>$amplitude=5</pa>
<pa>$period=30</pa>
</parameters>
<function>
//dimensions
$width = imagesx($im);
$height = imagesy($im);
//make sure parameters have a default value
if(!$amplitude) $amplitude = 5;
if(!$period) $period = 30;
$img2 = imagecreatetruecolor($width * 2, $height * 2);
imagecopyresampled ($img2,$im,0,0,$x,$y,$width * 2,$height * 2,$width, $height); //double size
// Wave it
for ($i = 0;$i < ($width * 2);$i += 2)
{
imagecopy($img2,$img2,
$x + $i - 2,$y + sin($i / $period) * $amplitude, // dest
$x + $i,$y, // src
2,($height * 2));
}
// Resample it down again
imagecopyresampled ($im,$img2,$x,$y,0,0,$width, $height,$width * 2,$height * 2);
imagedestroy($img2);
return $im;
</function>
</filter>
<filter> <name>bordes</name> <category>effect</category> <function> return $imaset->convolution($im,array(array(-16,0,0),array(0,16,0),array(0,0,0))); // find edges </function> </filter>
<filter> <name>sepia</name> <category>color</category> <function> return $imaset->mono($im,'F1D5A4'); </function> </filter>
<filter> <name>bn</name> <category>color</category> <function> return $imaset->mono($im); //monochrome </function> </filter>
<?php /* Translation of "imaset" wordpress plugin Imaset by Alex Barros 2007 < http://boozox.net > < zumbenet@gmail.com > If you want to translate this plugin to any other language, feel free to send me the translated file to zumbenet@gmail.com it will become avaliable for everyone. */ $imaset_lang = array( //Panel 'use'=>'Usar Imaset', 'filters'=>'Filtros', 'undo'=>'Deshacer', 'choose_filter'=>'Elije un filtro para aplicar', 'save'=>'Guardar Cambios', 'import'=>'Enviar al editor', 'exit'=>'Salir del editor', 'apply'=>'Aplicar', //Mensajes 'wait'=>'Por favor, <strong>espera</strong>...', 'saved_YES'=>'Imagen guardada satisfactoriamente', 'saved_NO'=>'Ha ocurrido algun problema', 'error'=>'Ha ocurrido algun error', 'inserted'=>'Imagen insertada en el editor', 'loading'=>'Cargando...', 'loading_image'=>'Cargando imagen ...', 'alert_not_saved'=>'La imagen no ha sido guardada.\n\nSeguro que quieres salir de Imaset?', 'no_changes'=>'No ha habido ninguna modificación', //Categorias 'decoration'=>'Decoración', 'color'=>'Color', 'effect'=>'Efectos', 'custom'=>'Personalizado', //Filtros 'shadow'=>'Sombra', 'frame'=>'Marco', 'reflekt'=>'Reflejo', 'brillo'=>'Brillo', 'perspectiva'=>'Perspectiva', 'wave'=>'Ondular', 'invertir'=>'Invertir colores', 'bn'=>'Escala de grises', 'sepia'=>'Sepia', 'colorizar'=>'Colorizar', 'softblur'=>'Desenfoque suave', 'hardblur'=>'Desenfoque fuerte', 'bordes'=>'Encontrar bordes', 'marca'=>'Marca de agua', 'resize'=>'Redimensionar', //Filtros extendido 'shadow_param_col'=>'Color hexadecimal', 'shadow_param_t'=>'Grosor en píxeles', 'frame_param_col'=>'Color hexadecimal del marco', 'frame_param_t'=>'Grosor en píxeles del marco', 'frame_param_sha_col'=>'Color hexadecimal de la sombra', 'frame_param_sha_t'=>'Grosor en píxeles de la sombra', 'wave_param_amplitude'=>'Amplitud', 'wave_param_period'=>'Periodo', 'marca_param_file'=>'Archivo de imagen', 'marca_param_x'=>'Posición horizontal', 'marca_param_y'=>'Posición vertical', 'marca_opt_left'=>'Izquierda', 'marca_opt_center'=>'Centro', 'marca_opt_right'=>'Derecha', 'marca_opt_top'=>'Arriba', 'marca_opt_bottom'=>'Abajo', 'resize_param_w'=>'Nuevo ancho <br>(porcentaje, número de pixeles, o vacio para mantener proporcion)', 'resize_param_h'=>'Nuevo alto <br>(porcentaje, número de pixeles, o vacio para mantener proporcion)', 'reflekt_param_s'=>'Tamaño del reflejo en píxeles.', 'reflekt_param_oi'=>'Opacidad inicial del degradado', 'perspectiva_param_lado'=>'Dirección de la perspectiva', 'perspectiva_opt_izq'=>'Izquierda', 'perspectiva_opt_der'=>'Derecha', 'colorizar_param_color'=>'Color hexadecimal para colorar' ); ?>
<?php /* Translation of "imaset" wordpress plugin Imaset by Alex Barros 2007 < http://boozox.net > < zumbenet@gmail.com > If you want to translate this plugin to any other language, feel free to send me the translated file to zumbenet@gmail.com it will become avaliable for anyone. */ $imaset_lang = array( //Panel 'use'=>'使用Imaset', 'filters'=>'滤镜', 'undo'=>'撤销', 'choose_filter'=>'对此图片选择滤镜效果', 'save'=>'保存', 'import'=>'导入图片', 'exit'=>'关闭', 'apply'=>'应用', //Messages 'wait'=>'请<strong>等待</strong>...', 'saved_YES'=>'图片已经保存', 'saved_NO'=>'图片无法保存', 'error'=>'出错', 'inserted'=>'图片现在可以编辑', 'loading'=>'加载...', 'loading_image'=>'加载图片 ...', 'alert_not_saved'=>'图片无法保存。\n保存更改,请按_取消_并保存它。\n\n关闭Imaset?', 'no_changes'=>'没有修改', //Categorias 'decoration'=>'装饰', 'color'=>'颜色', 'effect'=>'效果', 'custom'=>'定制', //Filtros 'shadow'=>'阴影', 'frame'=>'边框', 'reflekt'=>'倒影', 'brillo'=>'加亮', 'perspectiva'=>'立体远景', 'wave'=>'波浪', 'invertir'=>'反色', 'bn'=>'灰度', 'sepia'=>'褐色', 'colorizar'=>'定制', 'softblur'=>'轻度模糊', 'hardblur'=>'加强模糊', 'bordes'=>'底片效果', 'marca'=>'水印', 'resize'=>'改变大小', //Filtros extendido 'shadow_param_col'=>'颜色(十六进制颜色代码)', 'shadow_param_t'=>'宽度(像素)', 'frame_param_col'=>'边框颜色(十六进制颜色代码)', 'frame_param_t'=>'边框宽度(像素)', 'frame_param_sha_col'=>'阴影颜色(十六进制颜色代码)', 'frame_param_sha_t'=>'阴影宽度(像素)', 'wave_param_amplitude'=>'振幅', 'wave_param_period'=>'周期', 'marca_param_file'=>'图片文件', 'marca_param_x'=>'水平位置X', 'marca_param_y'=>'竖起位置Y', 'marca_opt_left'=>'左部', 'marca_opt_center'=>'中', 'marca_opt_right'=>'右部', 'marca_opt_top'=>'顶部', 'marca_opt_bottom'=>'底部', 'resize_param_w'=>'新的宽度(百分比,像素,或者留空保持比例)', 'resize_param_h'=>'新的高度(百分比,像素,或者留空保持比例)', 'reflekt_param_s'=>'尺寸(像素)', 'reflekt_param_oi'=>'起始透明效果的百分比', 'perspectiva_param_lado'=>'远景方向', 'perspectiva_opt_izq'=>'左', 'perspectiva_opt_der'=>'右', 'colorizar_param_color'=>'16进制颜色代码' ); ?>
Translate the following phrases. Explanation introduced by # symbol lang is the lang you're translating to. eng is the english phrase Once translated send this file to zumbenet (at) gmail (dot) com # Button to press and run the plugin eng : "Use Imaset" lang: "" # Title of the filters menu eng: "Filters" lang: "" # Undo any filter, go back in history eng: "Undo" lang: "" # Message telling to choose any filter eng: "Choose any filter for the image" lang: "" # Button for saving changes eng: "Save changes" lang: "" # Button for bring the image to the text editor eng: "Import image" lang: "" # Button for closing the program eng: "Close" lang: "" # Button for appling any filter eng: "Apply" lang: "" # Please, wait eng: "Please, <strong>wait</strong>..." lang: "" # Message: Correctly saved image eng: "The image was correctly saved" lang: "" # Problem saving the image eng: "The image could not be saved" lang: "" # Oops, error eng: "Something went wrong" lang: "" # Message: the image is now in the editor eng: "Now the image is in the editor" lang: "" # Loading ... eng: "Loading..." lang: "" # Loading an image eng: "Loading image ..." lang: "" # Make sure you want to close imaset. The image is not saved! eng: "The image is not saved.\n\nAre you sure you want to close Imaset?" lang: "" # Category of filters eng: "Decoration" lang: "" # Category of filters eng: "Color" lang: "" # Category of filters eng: "Effects" lang: "" # Category of filters eng: "Custom" lang: "" # Filter name eng: "Shadow" lang: "" # Filter name eng: "Nice frame" lang: "" # Filter name eng: "Reflection" lang: "" # Filter name eng: "Shine" lang: "" # Filter name eng: "Perspective" lang: "" # Filter name eng: "Wave" lang: "" # Filter name eng: "Invert" lang: "" # Filter name eng: "Greyscale" lang: "" # Filter name eng: "Sepia" lang: "" # Filter name eng: "Colorize" lang: "" # Filter name eng: "Soft Blur" lang: "" # Filter name eng: "Stronger Blur" lang: "" # Filter name eng: "Find edges" lang: "" # Filter name eng: "Watermark" lang: "" # Filter parameter eng: "Size in pixels" lang: "" # Filter parameter eng: "Initial opacity percentage" lang: "" # Filter parameter eng: "Perspective direction" lang: "" # Filter parameter eng: "Left" lang: "" # Filter parameter eng: "Right" lang: "" # Filter parameter eng: "Hexadecimal colour for colorize" lang: ""
<?php /* Translation of "imaset" wordpress plugin Imaset by Alex Barros 2007 < http://boozox.net > < zumbenet@gmail.com > If you want to translate this plugin to any other language, feel free to send me the translated file to zumbenet@gmail.com it will become avaliable for anyone. */ $imaset_lang = array( //Panel 'use'=>'Usa Imaset', 'filters'=>'Filtri', 'undo'=>'Annulla Modifica', 'choose_filter'=>'Scegli il filtro', 'save'=>'Salva', 'import'=>'Importa', 'exit'=>'Esci', 'apply'=>'Applica', //Mensajes 'wait'=>'Per favore, <strong>aspetta</strong>...', 'saved_YES'=>'Immagine salvata correttamente', 'saved_NO'=>'C\'è stato un problema', 'error'=>'C\ stato qualche errore', 'inserted'=>'Immagine inserita nell\'editor', 'loading'=>'Sto caricando...', 'loading_image'=>'Sto caricando l\'immagine...', 'alert_not_saved'=>'L\'immagine non è stata salvata.\nSe vuoi vedere i cambiamenti premi cancella e guarda l\'immagine.\n\nVuoi chiudere Imaset adesso?', 'no_changes'=>'Nessun Cambiamento', //Categorias 'decoration'=>'Decorazioni', 'color'=>'Colori', 'effect'=>'Effetti', 'custom'=>'Personalizzati', //Filtros 'shadow'=>'Ombra', 'frame'=>'Cornice', 'reflekt'=>'Riflesso', 'brillo'=>'Brillantezza', 'perspectiva'=>'Prospettiva', 'wave'=>'Onda', 'invertir'=>'Inverti colori', 'bn'=>'Scala di grigi', 'sepia'=>'Seppia', 'colorizar'=>'Ricolora (colorize)', 'softblur'=>'Sfocatura leggera', 'hardblur'=>'Sfocatura forte', 'bordes'=>'Evidenzia bordi', 'marca'=>'Marchia', 'resize'=>'Ridimensiona', //Filtros extendido 'shadow_param_col'=>'Codice Colore', 'shadow_param_t'=>'Ampiezza in pixel', 'frame_param_col'=>'Codice Colore per il riquadro', 'frame_param_t'=>'Ampiezza del riquadro in pixel', 'frame_param_sha_col'=>'Codice Colore per l\'ombra', 'frame_param_sha_t'=>'Ampiezza dell\'ombra in pixel', 'wave_param_amplitude'=>'Ampiezza', 'wave_param_period'=>'Periodo', 'marca_param_file'=>'File Immagine', 'marca_param_x'=>'Posizione Orizzontale', 'marca_param_y'=>'Posizione Verticale', 'marca_opt_left'=>'Sinistra', 'marca_opt_center'=>'Al Centro', 'marca_opt_right'=>'Destra', 'marca_opt_top'=>'In Alto', 'marca_opt_bottom'=>'In Basso', 'resize_param_w'=>'Nuova Ampiezza <br>(percentuale, numero di pixel o vuoto per mantenere le proporzioni)', 'resize_param_h'=>'Nuova Altezza <br>(percentuale, numero di pixel o vuoto per mantenere le proporzioni)', 'reflekt_param_s'=>'Ampiezza del riflesso in pixel', 'reflekt_param_oi'=>'Opacità iniziale del riflesso', 'perspectiva_param_lado'=>'Direzione della prospettiva', 'perspectiva_opt_izq'=>'Sinistra', 'perspectiva_opt_der'=>'Destra', 'colorizar_param_color'=>'Codice esadecimale colore per la colorazione' ); ?>
<?php /* Translation of "imaset" wordpress plugin Imaset by Alex Barros 2007 < http://boozox.net > < zumbenet@gmail.com > If you want to translate this plugin to any other language, feel free to send me the translated file to zumbenet@gmail.com it will become avaliable for anyone. */ $imaset_lang = array( //Panel 'use'=>'Use Imaset', 'filters'=>'Filters', 'undo'=>'Undo', 'choose_filter'=>'Choose any filter for the image', 'save'=>'Save changes', 'import'=>'Import image', 'exit'=>'Close', 'apply'=>'Apply', //Messages 'wait'=>'Please, <strong>wait</strong>...', 'saved_YES'=>'The image was correctly saved', 'saved_NO'=>'The image could not be saved', 'error'=>'Something went wrong', 'inserted'=>'Now the image is in the editor', 'loading'=>'Loading...', 'loading_image'=>'Loading image ...', 'alert_not_saved'=>'The image is not saved.\n\nAre you sure you want to close Imaset?', 'no_changes'=>'No changes have been applied', //Categories 'decoration'=>'Decoration', 'color'=>'Color', 'effect'=>'Effects', 'custom'=>'Custom', //Filters 'shadow'=>'Shadow', 'frame'=>'Nice frame', 'reflekt'=>'Reflection', 'brillo'=>'Shine', 'perspectiva'=>'Perspective', 'wave'=>'Wave', 'invertir'=>'Invert', 'bn'=>'Greyscale', 'sepia'=>'Sepia', 'colorizar'=>'Colorize', 'softblur'=>'Soft Blur', 'hardblur'=>'Stronger Blur', 'bordes'=>'Find edges', 'marca'=>'Watermark', 'resize'=>'Resize', //Filters extended 'shadow_param_col'=>'Hexadecimal colour', 'shadow_param_t'=>'Width in pixels', 'frame_param_col'=>'Hexadecimal colour of the frame', 'frame_param_t'=>'Width of the frame in pixels', 'frame_param_sha_col'=>'Hexadecimal colour of the shadow', 'frame_param_sha_t'=>'Width in pixels of the shadow', 'wave_param_amplitude'=>'Amplitude', 'wave_param_period'=>'Period', 'marca_param_file'=>'Image File', 'marca_param_x'=>'Horizontal position', 'marca_param_y'=>'Vertical position', 'marca_opt_left'=>'Left', 'marca_opt_center'=>'Center', 'marca_opt_right'=>'Right', 'marca_opt_top'=>'Top', 'marca_opt_bottom'=>'Bottom', 'resize_param_w'=>'New Width <br>(percentage, number of pixels, or empty to keep proportion)', 'resize_param_h'=>'New Height <br>(percentage, number of pixels, or empty to keep proportion)', 'reflekt_param_s'=>'Size in pixels', 'reflekt_param_oi'=>'Initial opacity percentage', 'perspectiva_param_lado'=>'Perspective direction', 'perspectiva_opt_izq'=>'Left', 'perspectiva_opt_der'=>'Right', 'colorizar_param_color'=>'Hexadecimal colour for colorize' ); ?>