SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 24, 2012, 11:55:30 pm

Login with username, password and session length
Members
Total Members: 10071
Latest: cdavidson012
Stats
Total Posts: 28687
Total Topics: 4977
Online Today: 94
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 52
Total: 52
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
| | | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: watermark ?  (Read 5772 times)
bluedevil
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 120



View Profile
« on: February 16, 2007, 11:53:43 pm »

I have gallery pro 1.1.2 but i dont have the watermark feature.  Where do i upgrade? or how?
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #1 on: February 17, 2007, 07:57:54 am »

Try the upgrade package found in this post
http://www.smfhacks.com/index.php/topic,151.0.html
And the watermark part is found under Settings.
Logged
bluedevil
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 120



View Profile
« Reply #2 on: February 17, 2007, 08:35:03 am »

thanx Hacks. I got it.
Logged

bluedevil
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 120



View Profile
« Reply #3 on: December 18, 2008, 07:54:27 pm »

You know?   I have the latest version version of PRO.

Im trying to use the watermark with an image.   I placed the path to the image and erased the entries for text watermark.

Well,when i upload a new image, the watermark image is not showing up.
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #4 on: December 18, 2008, 08:19:12 pm »

What settings do you have set for watermarks?

Any errors in your forum's error log?
Logged
bluedevil
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 120



View Profile
« Reply #5 on: December 18, 2008, 08:38:18 pm »

What settings do you have set for watermarks?

Any errors in your forum's error log?


Watermark Enabled -checked
Watermark Image path  -My URL   
Watermark Image Percent   -100
Watermark Text   - blank
Watermark Text Color   -blank
Watermark Font (gallery/fonts)   -blank
Watermark Text Size (Pixels)    -blank
Watermark Vertical Alignment   -bottom
Watermark Horizontal Alignment   -center


Quote
2: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not read font
File: /home/midwes15/public_html/Sources/Gallery.php

Quote
2: imageftbbox() [<a href='function.imageftbbox'>function.imageftbbox</a>]: Could not read font
File: /home/midwes15/public_html/Sources/Gallery.php

Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #6 on: December 18, 2008, 08:40:28 pm »

It is probably choking on the lack of font choice. Try putting in Forgottb.ttf
Logged
bluedevil
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 120



View Profile
« Reply #7 on: December 18, 2008, 08:46:37 pm »

It is probably choking on the lack of font choice. Try putting in Forgottb.ttf

Tried.  No go.

Im looking in the sources now.
Logged

bluedevil
SMF Gallery Pro Customer
Full Member
*****
Offline Offline

Posts: 120



View Profile
« Reply #8 on: December 18, 2008, 08:53:22 pm »

Does this look right to you?   This is part of the gallery.php

Code:
// Draw Text on the image
  if ($modSettings['gallery_set_water_text'] != '')
  {
 
  $xpos = 5;
  $ypos = 5;
 
$color = eregi_replace("#","", $modSettings['gallery_set_water_textcolor']);
 
// Split the colors up into RGB
  $text_color = imagecolorallocate ($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2)));

 
  //imageftbbox to get font size for the font file
 
  if (function_exists('imageftbbox'))
  {
    $bbox= imageftbbox ($modSettings['gallery_set_water_textsize'], 0, $modSettings['gallery_path'] . 'fonts/' . $modSettings['gallery_set_water_textfont'], $modSettings['gallery_set_water_text']);
    $text_width = abs($bbox[4] - $bbox[0]);
    $text_height = abs($bbox[1] - $bbox[5]);
  }
  else
  {
  $text_height = imagefontheight(3);
  $text_width = strlen ($modSettings['gallery_set_water_text']) * imagefontwidth(3);
  }
 
if ($modSettings['gallery_set_water_valign'] == 'bottom')
   $ypos = $image_height - $text_height - 5;
elseif ($modSettings['gallery_set_water_valign'] == 'center')
   $ypos = (int)($image_height / 2 - $text_height / 2);


if ($modSettings['gallery_set_water_halign'] == 'right')
   $xpos = $image_width - $text_width - 5;
elseif ($modSettings['gallery_set_water_halign'] == 'center')
   $xpos = (int)($image_width / 2- $text_width / 2);

// Write the text on the picuture
  //imagestring($image, 3, $xpos, $ypos, $modSettings['gallery_set_water_text'], $text_color);
if (function_exists('imageftbbox'))
  imagettftext($image, $text_height,0,$xpos,$ypos,$text_color,$modSettings['gallery_path'] . 'fonts/' . $modSettings['gallery_set_water_textfont'],$modSettings['gallery_set_water_text']);
  else
  imagestring($image, 3, $xpos, $ypos, $modSettings['gallery_set_water_text'], $text_color);
  }
 
 
  // Picture watermark
  if ($modSettings['gallery_set_water_image'] != '')
  {
 
  // If the image exists
  if (file_exists($modSettings['gallery_set_water_image']))
  {
 
  $xpos = 5;
  $ypos = 5;
 
$sizes2 = getimagesize($modSettings['gallery_set_water_image']);
$water_width = $sizes2[0];
$water_height =$sizes2[1];

if($extensions[$sizes2[2]] == 'gif' && !function_exists('imagecreatefromgif') && function_exists('imagecreatefrompng'))
{
//Use SMF functions by Yamasoft for loading gif
$img = gif_loadFile($modSettings['gallery_set_water_image']);
// and converting to a png
gif_outputAsPng($img, $modSettings['gallery_set_water_image']);

$wm_image = imagecreatefrompng($modSettings['gallery_set_water_image']);

}
else
{

// Use GD's built image create functions for this image.
if(function_exists('imagecreatefrom' . $extensions[$sizes2[2]]))
{
$imagecreatefrom = 'imagecreatefrom' . $extensions[$sizes2[2]];
$wm_image = $imagecreatefrom($modSettings['gallery_set_water_image']);

}
}


// Resize the watermark depending on the image size

         if ($water_width > $image_width *1.05 ||  $water_height> $image_height *1.05)
         {
             $wdiff= $water_width - $image_width;
             $hdiff= $water_height - $image_height;
             if ($wdiff > $hdiff)
             {
               $sizer=($wdiff/$water_width)-0.05;
             }
             else
             {
               $sizer=($hdiff/$water_height)-0.05;
             }
             $water_width-= $water_width * $sizer;
             $water_height-= $water_height * $sizer;
        }
       
        /*
        else
        {


            $wdiff=$image_width -  $water_width;
            $hdiff=$image_height -  $water_height;
            if ($wdiff > $hdiff)
            {
 
               $sizer=($wdiff/ $water_width)+0.05;
            }else
            {
              $sizer=($hdiff/ $water_height)+0.05;
            }
              $water_width+= $water_width * $sizer;
              $water_height+= $water_height * $sizer;
        }
        */
       
       // die("Watermark w:"  . $water_width . " h:" . $water_height);
     
        // Now resize the watermark
if ($gd2)
        {
$dst_img = imagecreatetruecolor($water_width, $water_height);
}
else
$dst_img = imagecreate( $water_width, $water_height);

if ($gd2)
imagecopyresampled($dst_img, $wm_image, 0, 0, 0, 0, $water_width, $water_height, $sizes2[0], $sizes2[1]);
else
imagecopyresamplebicubic($dst_img, $wm_image, 0, 0, 0, 0, $water_width, $water_height, $sizes2[0], $sizes2[1]);


$wm_image = $dst_img;

// End watermark resize


  if ($wm_image)
  {

   if ($modSettings['gallery_set_water_valign'] == 'bottom')
    $ypos = $image_height - $water_height - 5;
   elseif ($modSettings['gallery_set_water_valign'] == 'center')
    $ypos = (int)($image_height / 2 - $water_height / 2);


if ($modSettings['gallery_set_water_halign'] == 'right')
    $xpos = $image_width - $water_width - 5;
    elseif ($modSettings['gallery_set_water_halign'] == 'center')
    $xpos = (int)($image_width / 2 - $water_width / 2);

// Transparent Watermark
$temp = imagecreatetruecolor( $water_width,  $water_height);
//$background = imagecolorallocate($wm_image, 0, 0, 0);
$background = imagecolorat($wm_image,1,1);
ImageColorTransparent($wm_image,$background);
imagealphablending($temp, false);

   

   imagecopymerge($image, $wm_image, $xpos, $ypos, 0, 0, $water_width, $water_height, $modSettings['gallery_set_water_percent']);
  }
 
  }
 
 
 
  }
 
 
 if ($sizes[1] == 2)
  if (function_exists('imagegif'))
{
imagegif($image, $filename);
}
else
{
imagepng($image, $filename);
}
 
 if ($sizes[2] == 2)
  imagejpeg($image, $filename);
 if ($sizes[2] == 3)
  imagepng($image, $filename);

 
}
function BulkActions()
{
isAllowedTo('smfgallery_manage');

if (isset($_REQUEST['pics']))
{

$baction = $_REQUEST['doaction'];

foreach ($_REQUEST['pics'] as $value)
{

if ($baction == 'approve')
ApprovePictureByID($value);
if ($baction == 'delete')
DeletePictureByID($value);

}
}
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #9 on: December 18, 2008, 09:55:07 pm »

Looks fine if you didn't modify it.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 08:02:50 am]

[Today at 04:11:41 am]

[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 4.787 seconds with 22 queries.