No announcement yet.

image resizing

  • Filter
  • Time
  • Show
Clear All
new posts

  • image resizing

    i havent been able to make this work-- all the commands are good, i think, but when i attempt it, the scritp gives me an "invalid image pointer" error
    but i cant figure out what form variable i need to use.... all the ones that i would expect to work ...dont

  • #2
    Post the code that you used and we can look at it and tell you whats wrong, if anything is.


    • #3
      PHP Code:
      $imgsize getimagesize($form_data);
      $imgwidth $imgsize['0'];
      $imgheight $imgsize['1'];
      $imgtype $imgsize['2'];
      $size filesize($form_data);
      $image substr($form_data_type,0,5);
      $image strtolower($image);
      $image_out ImageCreate($bannerwidth,$bannerheight);
      $image_in ImageCreateFromJpeg($form_data);
      $data imagecopyresized($image_out,$image_in,0,0,0,0,$bannerwidth,$bannerheight,$imgwidth,$imgheight);
      $data addslashes(fread(fopen($image_out,"r"), filesize($data))); 
      assume that all the variables come from a form with a browse field, with a name of form_data
      this is valid code, modified, that i used to read in an image and place it into the database
      all i want to do is resize that image before i place it in the database
      after hours of reading through the and other sites' help, im still stuck.


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.