image quality

Discussion in 'PHP' started by promotingspace.net, Jun 10, 2010.

  1. #1
    Hi
    I upload a jpg file, also create a thumbnail from it and store both
    I want to set quality to 80 for both
    for thumbnail, I think if I add a 80 at the end of thumbnail creation code, it'll work
    
    $sourceImage = imagecreatefromjpeg("$sourcePath/$sourceName");
    $sourceWidth = imagesx($sourceImage);
    $sourceHeight = imagesy($sourceImage);
    
    $targetImage = imagecreate($thumbWidth,$thumbHeight);
    imagecopyresized($targetImage,$sourceImage,0,0,0,0,$thumbWidth,
    $thumbWidth,imagesx($sourceImage),imagesy($sourceImage));
    imagejpeg($targetImage, "$thumbPath/$thumbName",80);
    PHP:
    in the manual it said the input for this function comes from another function so for uploading the original file, I cannot set quality directly?
    I have to create a thumbnail but the size with original size of the image? to set quality
    Thanks
     
    promotingspace.net, Jun 10, 2010 IP
  2. flexdex

    flexdex Peon

    Messages:
    104
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's very hard to figure out what your question is about. What is your issue with creating these thumbnails?

    There was another thread and its just a week (or so) ago, where i helped another guy with creating thumbnails.
     
    flexdex, Jun 11, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    roopajyothi, Jun 12, 2010 IP