Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: GD problem. php

  1. #11

    Default Re: GD problem. php


    e print daw kung true ang $watermark

  2. #12

    Default Re: GD problem. php

    tangtanga gani ng header bro,pra gawas ang error

  3. #13
    Elite Member
    Join Date
    May 2011
    Gender
    Male
    Posts
    1,465

    Default Re: GD problem. php

    Quote Originally Posted by ondoy View Post
    tangtanga gani ng header bro,pra gawas ang error
    wa mai error japon boss
    Quote Originally Posted by ondoy View Post
    e print daw kung true ang $watermark
    mao ni ang display bro.

    then mao ni ang img nga naai watermark
    Last edited by jairoh_; 11-27-2012 at 03:47 PM.

  4. #14

    Default Re: GD problem. php

    <?php
    //watermarking images
    header( 'Content-type: image/jpeg' );

    if( isset( $_GET[ 'source' ] ) ){
    $source = $_GET[ 'source' ];

    $watermark = imagecreatefrompng( 'watermark.png' );
    $watermark_width = imagesx( $watermark );
    $watermark_height = imagesy( $watermark );


    $image = imagecreatetruecolor( $watermark_width, $watermark_height );
    $image = imagecreatefromjpeg( $source );

    $image_size = getimagesize( $source );
    $x = $image_size [ 0 ] - $watermark_width - 10;
    $y = $image_size [ 1 ] - $watermark_height - 10;

    imagecopymerge( $image, $watermark, $x, $y, 0, 0, $watermark_width, $watermark_height, 20 );

    //put the image into the page
    //imagejpeg( $image );

    //
    imagejpeg( $image, $source.'.watermarked.jpg' );

    }

    ?>
    kani kuno bai?

  5. #15

    Default Re: GD problem. php

    kung imo e comment ang header('Content.......) din e load nimo ni:
    http://localhost/GD/generate.php?source=gd.jpg
    diha mo gawas ang error

  6. #16
    Elite Member
    Join Date
    May 2011
    Gender
    Male
    Posts
    1,465

    Default Re: GD problem. php

    Quote Originally Posted by anonymousprogrammer2012 View Post
    <?php
    //watermarking images
    header( 'Content-type: image/jpeg' );

    if( isset( $_GET[ 'source' ] ) ){
    $source = $_GET[ 'source' ];

    $watermark = imagecreatefrompng( 'watermark.png' );
    $watermark_width = imagesx( $watermark );
    $watermark_height = imagesy( $watermark );


    $image = imagecreatetruecolor( $watermark_width, $watermark_height );
    $image = imagecreatefromjpeg( $source );

    $image_size = getimagesize( $source );
    $x = $image_size [ 0 ] - $watermark_width - 10;
    $y = $image_size [ 1 ] - $watermark_height - 10;

    imagecopymerge( $image, $watermark, $x, $y, 0, 0, $watermark_width, $watermark_height, 20 );

    //put the image into the page
    //imagejpeg( $image );

    //
    imagejpeg( $image, $source.'.watermarked.jpg' );

    }

    ?>
    kani kuno bai?
    same ra boss
    Quote Originally Posted by ondoy View Post
    kung imo e comment ang header('Content.......) din e load nimo ni:
    http://localhost/GD/generate.php?source=gd.jpg
    diha mo gawas ang error
    wa japon error boss. tsk

  7. #17

    Default Re: GD problem. php

    hehe naa bro.
    - kini nga lines:
    $watermark_width = imagesx( $watermark );
    $watermark_height = imagesy( $watermark );

    error ani ky ang e accept sa imagesx() ky resource,ang imo gi pasa ky boolean.

    - pwede mnka sugod lngsa ginagmay lngsa ayaw e dungan.try ni sa php manual nko ni gi kuha:
    <?php
    function LoadJpeg($imgname)
    {
    /* Attempt to open */
    $im = @imagecreatefromjpeg($imgname);

    /* See if it failed */
    if(!$im)
    {
    /* Create a black image */
    $im = imagecreatetruecolor(150, 30);
    $bgc = imagecolorallocate($im, 255, 255, 255);
    $tc = imagecolorallocate($im, 0, 0, 0);

    imagefilledrectangle($im, 0, 0, 150, 30, $bgc);

    /* Output an error message */
    imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
    }

    return $im;
    }

    header('Content-Type: image/jpeg');

    $img = LoadJpeg('bogus.image');

    imagejpeg($img);
    imagedestroy($img);
    ?>

  8. #18

    Default Re: GD problem. php

    sir ondoy... ako amigo ni ask if naa ka mga tutorials sa php para mastudy2x..

  9. #19

    Default Re: GD problem. php

    Quote Originally Posted by gwenharold View Post
    sir ondoy... ako amigo ni ask if naa ka mga tutorials sa php para mastudy2x..
    naa daghan,aria lngko sko cubicle

  10. #20
    Elite Member
    Join Date
    May 2011
    Gender
    Male
    Posts
    1,465

    Default Re: GD problem. php

    Quote Originally Posted by ondoy View Post
    naa daghan,aria lngko sko cubicle
    check nako ni ugma boss. panghatag tuts b. hehehe

  11.    Advertisement

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

 
  1. For Sale: defective nikon coolpix s210 (Lens error problem)php 500.00w/pic
    By johnjob in forum Other Electronic Devices
    Replies: 1
    Last Post: 10-16-2012, 07:25 AM
  2. Got Java, PHP, C, MySQL problem?
    By abstracted in forum Programming
    Replies: 11
    Last Post: 06-25-2010, 09:36 PM
  3. php problem
    By jerx d great in forum Programming
    Replies: 9
    Last Post: 10-27-2009, 05:48 PM
  4. Problem with PHP MD5 Encryption
    By personalmgt in forum Programming
    Replies: 9
    Last Post: 10-25-2009, 09:53 PM
  5. Counter problem in PHP
    By rusbel in forum Programming
    Replies: 0
    Last Post: 04-08-2007, 11:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top