1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PNG to JPG script..

Discussion in 'Programming' started by elshazly, May 31, 2014.

  1. #1
    Hi, was curious in getting a png to jpg script.. either having someone from here create it and implement it, or if there is one out there I can implement into a site..

    Does anyone have any knowledge on png to jpg?
     
    elshazly, May 31, 2014 IP
  2. sincos

    sincos Member

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #2
    is it transparent png?
    if true, what is background you you want?
     
    sincos, Jun 3, 2014 IP
  3. Jigney

    Jigney Active Member

    Messages:
    168
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    68
    #3
    you can use below function to convert the image from png to jpg

    function png2jpg($originalFile, $outputFile, $quality) {
    $image = imagecreatefrompng($originalFile);
    imagejpeg($image, $outputFile, $quality);
    imagedestroy($image);
    }
    For more information check below link :
    http://www.php.net/manual/en/imagick.setimageformat.php
     
    Jigney, Jun 5, 2014 IP