Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 186
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 174
Total: 174

Author Topic: Watermark Font on Pro  (Read 16099 times)

0 Members and 1 Guest are viewing this topic.

Offline lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Watermark Font on Pro
« on: September 06, 2007, 10:05:32 pm »
How do you edit the font size and color on Pro I just bought this version so I do bulk uploads and watermark all my pics, but the font is super small.  Not really any point to protecting.  Also tried to use a image and it won't attach it.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Watermark Font on Pro
« Reply #1 on: September 06, 2007, 10:24:34 pm »
No current built in setting to control the watermark font size
It is controlled by the following code in Sources/Gallery.php
Code: [Select]
  $text_height = imagefontheight(3);
  $text_width = strlen ($modSettings['gallery_set_water_text']) * imagefontwidth(3);

The water mark image path needs to be a file path
Such as /home/public_html/yourimage.png or c:/inetpub/wwwroot/yourimage.png
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 lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Re: Watermark Font on Pro
« Reply #2 on: September 06, 2007, 10:39:45 pm »
No current built in setting to control the watermark font size
It is controlled by the following code in Sources/Gallery.php
Code: [Select]
  $text_height = imagefontheight(3);
  $text_width = strlen ($modSettings['gallery_set_water_text']) * imagefontwidth(3);

The water mark image path needs to be a file path
Such as /home/public_html/yourimage.png or c:/inetpub/wwwroot/yourimage.png

Where do I find the code or do I have to enter the code.  I'm new to writing code so bear with me when I ask stupid questions.  If I have to add it where do I add it?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Watermark Font on Pro
« Reply #3 on: September 06, 2007, 10:58:24 pm »
The main gallery source file is found at Sources/Gallery.php inside your forum and this file can be downloaded to the computer and opened in a text editor such as notepad to edit.


The font size for the built image fonts range from 1 to 5.
The default font size is set to 3.
The higher the number the bigger the font (up to five).


Parts of the file to edit
Under the DoWaterMark function

Around line 4763
Code: [Select]
  $text_height = imagefontheight(3);
  $text_width = strlen ($modSettings['gallery_set_water_text']) * imagefontwidth(3);
The 3 in both of those lines is the font size which can be from 1 to 5


Around line 4778
Code: [Select]
// Write the text on the picuture
  imagestring($image, 3, $xpos, $ypos, $modSettings['gallery_set_water_text'], $text_color);
The 3 in that function controls the image size and can be from 1 to 5


Going to be looking at using a different text watermarking system for Gallery Pro 1.3 seems you can use the imagettftext function to set the size of the text with pixels using truetype fonts.
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 lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Re: Watermark Font on Pro
« Reply #4 on: September 06, 2007, 11:19:45 pm »
Well I'm having trouble finding the code to edit it, but once I do and edit it in notepad how do I incorporate it into your code for the font to take place?

Again excuse my ignorance as I'm new to code writing.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Watermark Font on Pro
« Reply #5 on: September 06, 2007, 11:29:37 pm »
A quick way would be to use the find function in the text editor to find the piece code. After you have the file edited you would just upload Gallery.php back to the Sources folder on your website and the size settings will take affect for all newly uploaded images.
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 lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Re: Watermark Font on Pro
« Reply #6 on: September 06, 2007, 11:38:24 pm »
A quick way would be to use the find function in the text editor to find the piece code. After you have the file edited you would just upload Gallery.php back to the Sources folder on your website and the size settings will take affect for all newly uploaded images.

Changed it to (5), but still is small font.  I guess I don't know what I'm doing here?
« Last Edit: September 06, 2007, 11:44:19 pm by lakestclair »

Offline lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Re: Watermark Font on Pro
« Reply #7 on: September 06, 2007, 11:53:13 pm »
Here's what it looks like in code, but still won't enlarge it on the pictures.

Quote

  // 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)));

     $text_height = imagefontheight(5);
     $text_width = strlen ($modSettings['gallery_set_water_text']) * imagefontwidth(5);

    
    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 / 5);


    if ($modSettings['gallery_set_water_halign'] == 'right')
      $xpos = $image_width - $text_width - 2;
    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);

 

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Watermark Font on Pro
« Reply #8 on: September 07, 2007, 07:16:17 am »
One more todo
Code: [Select]
   // Write the text on the picuture
     imagestring($image, 3, $xpos, $ypos, $modSettings['gallery_set_water_text'], $text_color);
Change the 3 to a five
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 lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Re: Watermark Font on Pro
« Reply #9 on: September 08, 2007, 06:13:48 pm »
Thanks.  I got the font fixed, but would like to implement a image as a watermark.  This is how I have it written, but for some reason it won't implement it into the picture when it posts.

Quote
/home/public_html/lakestclair.PNG

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Watermark Font on Pro
« Reply #10 on: September 09, 2007, 09:33:23 pm »
That appears correct from first glance and should work if watermarking is enabled. Anything 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 lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Re: Watermark Font on Pro
« Reply #11 on: September 10, 2007, 03:59:49 pm »
No errors affiliated to the gallery other than pics that have been deleted. ???

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Watermark Font on Pro
« Reply #12 on: September 11, 2007, 07:40:54 am »
If you go to Admin -> Server Settings
Under SMF Directory copy that path and then add the the image filename to that path if the image is located in the forum's path.
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 lakestclair

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • Lake St. Clair Run
Re: Watermark Font on Pro
« Reply #13 on: September 14, 2007, 06:36:13 pm »
If you go to Admin -> Server Settings
Under SMF Directory copy that path and then add the the image filename to that path if the image is located in the forum's path.

Nope that didn't correct it either.  I'll get the path of the file maybe that will help to diagnose

 

Related Topics

  Subject / Started by Replies Last post
13 Replies
12064 Views
Last post December 26, 2010, 11:11:23 am
by CWVRV
4 Replies
4568 Views
Last post November 01, 2008, 08:19:30 pm
by surelaris
9 Replies
8339 Views
Last post April 01, 2013, 12:06:30 pm
by b0mbardo
1 Replies
3093 Views
Last post May 21, 2013, 12:20:41 am
by SMFHacks
4 Replies
4121 Views
Last post June 03, 2015, 01:42:05 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 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

Powered by EzPortal