image upload

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hannes

    image upload

    I have a problem with uploading images and creating thumbs from it.

    Not all the time, but sometimes, the full size image is completely
    uploaded and correct, while the thumbnail only builds a vertical part
    of the real image... the rest is grey..

    How is that possible? Uploading is not the problem, but resizing
    somehow is i guess.

    Please help me,

    Hannes

  • Erwin Moller

    #2
    Re: image upload

    hannes wrote:
    I have a problem with uploading images and creating thumbs from it.
    >
    Not all the time, but sometimes, the full size image is completely
    uploaded and correct, while the thumbnail only builds a vertical part
    of the real image... the rest is grey..
    >
    How is that possible? Uploading is not the problem, but resizing
    somehow is i guess.
    >
    Please help me,
    >
    Hannes
    Hi Hannes,

    Check line 134 in your sourcecode of the script that handles the
    resizing....

    How do you expect us to answer such a question based on the information we
    receive?

    Regards,
    Erwin Moller

    Comment

    • hannes

      #3
      Re: image upload

      On 27 mrt, 11:50, Erwin Moller
      <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
      hannes wrote:
      I have a problem with uploading images and creating thumbs from it.
      >
      Not all the time, but sometimes, the full size image is completely
      uploaded and correct, while the thumbnail only builds a vertical part
      of the real image... the rest is grey..
      >
      How is that possible? Uploading is not the problem, but resizing
      somehow is i guess.
      >
      Please help me,
      >
      Hannes
      >
      Hi Hannes,
      >
      Check line 134 in your sourcecode of the script that handles the
      resizing....
      >
      How do you expect us to answer such a question based on the information we
      receive?
      >
      Regards,
      Erwin Moller
      Haha.. sorry..
      well, i thought maybe someone recognises this problem. Why can this
      image be grey at the bottom? Maybe you've seen this before and you can
      tell me what i should be thinking about?




      Comment

      • Evil Otto

        #4
        Re: image upload

        On Mar 27, 11:32 am, "hannes" <hann...@gmail. comwrote:
        On 27 mrt, 11:50, Erwin Moller
        >
        >
        >
        <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
        hannes wrote:
        I have a problem with uploading images and creating thumbs from it.
        >
        Not all the time, but sometimes, the full size image is completely
        uploaded and correct, while the thumbnail only builds a vertical part
        of the real image... the rest is grey..
        >
        How is that possible? Uploading is not the problem, but resizing
        somehow is i guess.
        >
        Please help me,
        >
        Hannes
        >
        Hi Hannes,
        >
        Check line 134 in your sourcecode of the script that handles the
        resizing....
        >
        How do you expect us to answer such a question based on the information we
        receive?
        >
        Regards,
        Erwin Moller
        >
        Haha.. sorry..
        well, i thought maybe someone recognises this problem. Why can this
        image be grey at the bottom? Maybe you've seen this before and you can
        tell me what i should be thinking about?
        IMHO you should be thinking about providing more information :)

        The code would be a good place to start, as well as your PHP version,
        what web server you have, what file formats you're allowing, how much
        memory you have in your server AND have allocated to PHP..

        Basically ANY information would be helpful.

        Comment

        • hannes

          #5
          Re: image upload

          On 27 mrt, 21:27, "Evil Otto" <zburn...@gmail .comwrote:
          On Mar 27, 11:32 am, "hannes" <hann...@gmail. comwrote:
          >
          >
          >
          >
          >
          On 27 mrt, 11:50, Erwin Moller
          >
          <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
          hannes wrote:
          I have a problem with uploading images and creating thumbs from it.
          >
          Not all the time, but sometimes, the full size image is completely
          uploaded and correct, while the thumbnail only builds a vertical part
          of the real image... the rest is grey..
          >
          How is that possible? Uploading is not the problem, but resizing
          somehow is i guess.
          >
          Please help me,
          >
          Hannes
          >
          Hi Hannes,
          >
          Check line 134 in your sourcecode of the script that handles the
          resizing....
          >
          How do you expect us to answer such a question based on the information we
          receive?
          >
          Regards,
          Erwin Moller
          >
          Haha.. sorry..
          well, i thought maybe someone recognises this problem. Why can this
          image be grey at the bottom? Maybe you've seen this before and you can
          tell me what i should be thinking about?
          >
          IMHO you should be thinking about providing more information :)
          >
          The code would be a good place to start, as well as your PHP version,
          what web server you have, what file formats you're allowing, how much
          memory you have in your server AND have allocated to PHP..
          >
          Basically ANY information would be helpful.- Tekst uit oorspronkelijk bericht niet weergeven -
          >
          - Tekst uit oorspronkelijk bericht weergeven -
          this is my code where something goes wrong:
          $handle = fopen($tmpHolde r, "rb"); // opent 'temp/tmp.img'
          echo $handle;
          $contents = fread($handle, filesize($tmpHo lder));

          if($original = imagecreatefrom string($content s)){
          }
          else{
          // nog een keer
          if($original = imagecreatefrom string($content s)){
          }
          else{
          exit("mislukt, probeer het opnieuw<BR>");
          }
          }
          $source = imagecreatefrom string($content s);
          $original_width = imagesx($origin al);
          $original_heigh t = imagesy($origin al);

          if($original_wi dth < $formaatSmall){
          $newwidth = $original_width ;
          $newheight = $original_heigh t;
          }else{


          $percent = ($original_heig ht/$original_width );
          if($original_wi dth>$original_h eight){
          //horizontaal
          //percent < 1
          $newwidth = $formaatSmall;
          $newheight = $formaatSmall*$ percent;
          }
          else if($original_wi dth<$original_h eight){
          //verticaal
          //percent 1
          $newwidth = $formaatSmall/$percent;
          $newheight = $formaatSmall;
          }
          else if($original_wi dth=$original_h eight){
          //vierkant
          //percent = 1
          $newwidth = $formaatSmall;
          $newheight = $formaatSmall;

          }
          }
          $thumb = imagecreatetrue color($newwidth , $newheight);

          if (!imagecopyresi zed($thumb, $source, 0, 0, 0, 0, $newwidth,
          $newheight, $original_width , $original_heigh t)){
          exit("aanmaken van thumbnail mislukt<BR>");
          }

          $thumbnail = $folder_small."/".$form_bestand snaam;

          if(!is_file($th umbnail)){
          $handle2 = fopen($thumbnai l,'x');
          chmod($thumbnai l, 0777);
          fclose($handle2 );
          }
          imagejpeg ($thumb, $thumbnail, 60);

          fclose($handle) ;

          Comment

          Working...