Bagheera Posted December 3, 2008 Share Posted December 3, 2008 intento colocarle una marca de agua a las imagenes. he revisado un topic en ingles pero no funciona uso la version 1.0 porke aun la1.3 esta en beta... Link to comment Share on other sites More sharing options...
junnecito Posted December 10, 2008 Share Posted December 10, 2008 Hola:No creo que te vaya a funcionar en la version 1.0, la marca de agua se creo para la 1.3.Saludos Link to comment Share on other sites More sharing options...
p1r4t0s Posted December 10, 2008 Share Posted December 10, 2008 una manera jodida pero efectiva es bajar la carpeta img y con un software de esos que lo hacen por batch es decir automaticamente y despues resubrila. Link to comment Share on other sites More sharing options...
p1r4t0s Posted December 10, 2008 Share Posted December 10, 2008 O tambien....Hi all,i’ve updated function for regenerating images to insert watermark. it’s necessary to create file img/p/watermark.gif with watermark – gif file with transparrent background.in classess/Tools.php add:function watermarkByImage($imagepath, $watermarkpath, $outputpath, $transparency = 80, $Xoffset = 0, $Yoffset = 0, $Xalign = "middle", $Yalign = "bottom" //could use "top, "middle", "bottom){ $image = imagecreatefromjpeg($imagepath);$imagew = imagecreatefromgif($watermarkpath); //zjistime jejich velikostlist($watermarkWidth, $watermarkHeight) = getimagesize($watermarkpath);list($imageWidth, $imageHeight) = getimagesize($imagepath);$xpos = 0;$ypos = 0; //podle parametru funkce upravime promene //xpos a yposif ($Xalign == "middle") { $xpos = $imageWidth/2 - $watermarkWidth/2 + $Xoffset; }if ($Xalign == "left") { $xpos = 0 + $Xoffset; }if ($Xalign == "right") { $xpos = $imageWidth - $watermarkWidth - $Xoffset; }if ($Yalign == "middle") { $ypos = $imageHeight/2 - $watermarkHeight/2 + $Yoffset; }if ($Yalign == "top") { $ypos = 0 + $Yoffset; }if ($Yalign == "bottom") { $ypos = $imageHeight - $watermarkHeight - $Yoffset; }imagecopymerge($image, //zdrojovy obrazek$imagew, $xpos, $ypos, 0, 0, $watermarkWidth, $watermarkHeight, $transparency);return imagejpeg($image, $outputpath, 100);} ----------------------------------------------------------------------------------------------------------------and then admin/tabs/AdminImages.php :/* Regenerate products images */$errors = false;foreach ($productsImages AS $k => $image){if (file_exists(_PS_PROD_IMG_DIR_.$image['id_product'].'-'.$image['id_image'].'.jpg'))$waterfile = _PS_PROD_IMG_DIR_.$image['id_product'].'-'.$image['id_image'].'-watermark.jpg';Tools::watermarkByImage(_PS_PROD_IMG_DIR_.$image['id_product'].'-'.$image['id_image'].'.jpg', _PS_PROD_IMG_DIR_.'watermark.gif', $waterfile, 23, 0, 0, 'right');foreach ($productsTypes AS $k => $imageType){$wm = ($imageType['name'] == 'thickbox' || $imageType['name'] == 'large') ? '-watermark' : '';$file['tmp_name'] = _PS_PROD_IMG_DIR_.$image['id_product'].'-'.$image['id_image'].$wm.'.jpg';$file['type'] = 'image/jpg';$newFile = _PS_PROD_IMG_DIR_.$image['id_product'].'-'.$image['id_image'].'-'.stripslashes($imageType['name']).'.jpg';if (!imageResize($file, $newFile, intval($imageType['width']), intval($imageType['height'])))$errors = true;}} -------------------------------------------------- Ondrej Svoboda Moto-Online.cz Link to comment Share on other sites More sharing options...
Recommended Posts