SitePoint Sponsor

User Tag List

Page 6 of 6 FirstFirst ... 23456
Results 126 to 138 of 138
  1. #126
    Dennis
    SitePoint Community Guest
    hi,

    how do you call the watermarked image inside a html file?

    let's say i have a "/folder/image.jpg" image and i want to display it in my page.html

    please help.thanks

  2. #127
    Jason
    SitePoint Community Guest
    From what's been described here, this is no better (in fact, it might be worse) than just opening the image in Photoshop, dropping the watermark PNG on top, and resaving the image.

    How is it dynamic if you have to hard-code the SRC? And if you can build the SRC into the code, how do you call this PHP file from another file? Since it obviously has to be its own PHP file, based on the need for HEADER at the top of the file?

    Sorry, I'm just not sure how you use this script at all.

  3. #128
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gilles View Post
    @ Dez: this is a vague question, you have software and other development language, in PHP there isn't 100 ways of doing it.
    @ Gilles - Not vague at all - it's always good to get ideas of what others use.

  4. #129
    SitePoint Enthusiast
    Join Date
    May 2004
    Location
    Ontario, Canada
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jason View Post
    From what's been described here, this is no better (in fact, it might be worse) than just opening the image in Photoshop, dropping the watermark PNG on top, and resaving the image.

    How is it dynamic if you have to hard-code the SRC? And if you can build the SRC into the code, how do you call this PHP file from another file? Since it obviously has to be its own PHP file, based on the need for HEADER at the top of the file?

    Sorry, I'm just not sure how you use this script at all.
    Hi Jason,

    Images are dynamically generated/altered with PHP all of the time. You call them as image files directly like you would reference any image in a PHP page:

    Code:
    <img src="/path/to/php/file.php" alt="dynamic image" />
    You can pass the source (or, to be safer, some database row ID that will reference the source) to the PHP script just like any other script with either a query string or a file string that mod_rewrite will break down into a query string.

    I know you are obviously very new to PHP programming but, maybe show a bit more modesty when asking questions seeing as your own understanding is clearly at a very modest level.

    P.S. This script is very old and, if I were to rewrite, there would be many changes to it such as image caching, image resizing, multiple filetypes, etc.

    Welcome to PHP and web development!
    Brock Ferguson
    Lead Developer, Caribou CMS
    A Subscription/Membership CMS and Ecommerce Platform - FREE Trial

  5. #130
    Mr Helper
    SitePoint Community Guest
    $image = imagecreatetruecolor($watermark_width, $watermark_height);
    $image = imagecreatefromjpeg($_GET['src']);

    Not sure I understand this bit--you grab the result from imagecreatetruecolor, but before you do anything with it you stomp over it with the very next call. Mistake, or something subtle going on there?

  6. #131
    David
    SitePoint Community Guest
    Fantastic and very sleek!

    Note for minor correction:
    In "Merging the Image and the Watermark" this line needs a semicolon at the end or you'll get a syntax error unexpected T_STRING

    Thank you!

  7. #132
    Dave
    SitePoint Community Guest
    Why wouldn't the watermark's alpha channel be dropped? It replaces it with white over the image... Thank you...

  8. #133
    hikingbike
    SitePoint Community Guest
    how do i suppose to use it lets say for SMF forum? :-/

  9. #134
    Oleg
    SitePoint Community Guest
    You can add digital watermark by the watermark software picmarkrpro.com .
    If yoh have an flickr account you can replace your Flickr photos with their watermarked copies.

  10. #135
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, I' am using your script and it works fine, but......
    How do I create a png-8 file with transparency?

    Hope to hear from you soon.....

  11. #136
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very helpful article. Help a lot. Thanks.

  12. #137
    Hibernator YuriKolovsky's Avatar
    Join Date
    Nov 2007
    Location
    Malaga, Spain
    Posts
    1,072
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    thanks for guiding through
    but
    this method destroys the watermark image alpha transparency on the final image

    imagealphablending($d_img, false);
    $color = imagecolorallocatealpha($d_img, 0, 0, 0, 127);
    imagefill($d_img, 0, 0, $color);
    imagesavealpha($d_img, true);
    imagecopyresampled($d_img,$s_img,0,0,0,0,$dst_w,$dst_h,$src_w,$src_h);

    will preserve the watermark image transparency in the gd memory.

  13. #138
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for a great article. It was just what I needed.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •