Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43261
Total Topics: 7519
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 284
Total: 285

Author Topic: watermark ?  (Read 10766 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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
9924 Views
Last post June 29, 2008, 12:42:36 pm
by SMFHacks
1 Replies
4511 Views
Last post August 31, 2013, 12:59:02 pm
by SMFHacks
2 Replies
4184 Views
Last post March 16, 2014, 08:36:56 am
by Cmely
8 Replies
5677 Views
Last post August 17, 2015, 09:49:09 am
by micklad
17 Replies
5973 Views
Last post May 30, 2019, 05:25:39 pm
by ajac63

+- Recent Topics

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
Today at 08:27:36 am

No thumbnails on new uploads by Tonyvic
Today at 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Powered by EzPortal