Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12358
Latest: KekoWorld
New This Month: 1
New This Week: 2
New Today: 0
Stats
Total Posts: 40089
Total Topics: 7059
Most Online Today: 67
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 30
Total: 30

Author Topic: watermark ?  (Read 9445 times)

0 Members and 1 Guest are viewing this topic.

Offline bluedevil

  • Full Member
  • ***
  • Posts: 120
    • View Profile
watermark ?
« 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?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15048
    • View Profile
Re: watermark ?
« 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.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline bluedevil

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: watermark ?
« Reply #2 on: February 17, 2007, 08:35:03 am »
thanx Hacks. I got it.

Offline bluedevil

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: watermark ?
« 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.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15048
    • View Profile
Re: watermark ?
« 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?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline bluedevil

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: watermark ?
« 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


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15048
    • View Profile
Re: watermark ?
« 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
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline bluedevil

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: watermark ?
« 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.

Offline bluedevil

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: watermark ?
« Reply #8 on: December 18, 2008, 08:53:22 pm »
Does this look right to you?   This is part of the gallery.php

Code: [Select]
// 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);

}
}

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15048
    • View Profile
Re: watermark ?
« Reply #9 on: December 18, 2008, 09:55:07 pm »
Looks fine if you didn't modify it.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
12 Replies
7928 Views
Last post June 29, 2008, 12:42:36 pm
by SMFHacks
1 Replies
2846 Views
Last post August 31, 2013, 12:59:02 pm
by SMFHacks
2 Replies
3179 Views
Last post March 16, 2014, 08:36:56 am
by Cmely
8 Replies
3414 Views
Last post August 17, 2015, 09:49:09 am
by micklad
17 Replies
2428 Views
Last post May 30, 2019, 05:25:39 pm
by ajac63

+- Recent Topics

MOVED: BUG Message Editor Pro1.0.5 by SMFHacks
Today at 07:54:07 pm

BUG Message Editor Pro1.0.5 by SMFHacks
Today at 07:53:34 pm

[Mod]SMF2WPBridge - Wordpress Login Bridge by SMFHacks
Today at 01:41:05 pm

Only variables should be passed by reference by Zaphod
April 02, 2020, 11:19:11 am

Cannot install Gallery Pro on SMF 2.1 RC2 by Hatshepsut
March 19, 2020, 12:55:00 am

Newbie questions by SMFHacks
March 08, 2020, 09:28:17 am

Update detect mobile mode PHP5 to PHP7 by Plus
March 05, 2020, 11:19:05 am

Just a hello by Plus
March 05, 2020, 11:05:56 am

Enotify Copyright Problem by SMFHacks
March 04, 2020, 09:21:09 pm

Cannot import by shawnb
March 02, 2020, 12:17:00 pm

Powered by EzPortal