Jump to content

convert image type


jonniejoejonson

Recommended Posts

Thanks guys.. this is what i've come up with...

 

$image = open_image($uploadFile);

 

imagejpeg($image,'convertedImage.jpg',100);

 

function open_image ($uploadFile) {

    # JPEG:

    $im = @imagecreatefromjpeg($uploadFile);

    if ($im !== false) { return $im;

 

}

    # GIF:

    $im = @imagecreatefromgif($uploadFile);

    if ($im !== false) { return $im; }

 

}

 

 

Link to comment
https://forums.phpfreaks.com/topic/90958-convert-image-type/#findComment-466219
Share on other sites

  • 2 months later...

Thanks guys.. this is what i've come up with...

 

$image = open_image($uploadFile);

 

imagejpeg($image,'convertedImage.jpg',100);

 

function open_image ($uploadFile) {

    # JPEG:

    $im = @imagecreatefromjpeg($uploadFile);

    if ($im !== false) { return $im;

 

}

    # GIF:

    $im = @imagecreatefromgif($uploadFile);

    if ($im !== false) { return $im; }

 

}

 

 

 

did the code above work for you?

Link to comment
https://forums.phpfreaks.com/topic/90958-convert-image-type/#findComment-526227
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.