Image Resize does not work

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

    Image Resize does not work

    I am trying to change the size of a drawing so they are all 3x3.

    the script below is what i was trying to use to cut it in half ... I
    get errors.

    I can display the normal picture but not the results of the picture
    half the size. The PHP I have installed support 1.62 or higher. And
    all I would like to do is take and image and make it fit a 3x3.

    Any suggestions to where I should read or look would be appreciated.

    TIA

    ############### code ############### ############### ######
    <?
    $i = "$image.jpg ";
    echo "<br>my working file is $i";

    $src = ImageCreateFrom JPEG($i);
    $width = ImageSx($src);
    $height = ImageSy($src);
    $x = $width/2;
    $y = $height/2;
    $dst = ImageCreateTrue Color($x,$y);
    ImageCopyResamp led($dst, $src, 0,0,0,0,$x,$y,$ width,$height);
    ImagePNG($dst);
    ?>

    ############### ##### error ############### ############### ###########
    Warning: imagecreatefrom jpeg: Unable to open '13727.jpg' for reading
    in /var/www/html/viewer.php on line 75

    Warning: imagesx(): supplied argument is not a valid Image resource in
    /var/www/html/viewer.php on line 76

    Warning: imagesy(): supplied argument is not a valid Image resource in
    /var/www/html/viewer.php on line 77

    Warning: imagecreatetrue color(): requires GD 2.0 or later in
    /var/www/html/viewer.php on line 80

    Warning: imagecopyresamp led(): requires GD 2.0 or later in
    /var/www/html/viewer.php on line 81

    Warning: imagepng(): supplied argument is not a valid Image resource
    in /var/www/html/viewer.php on line 82


    // Larry
  • Joshua Ghiloni

    #2
    Re: Image Resize does not work

    Sandwick wrote:[color=blue]
    >
    > ############### ##### error ############### ############### ###########
    > Warning: imagecreatefrom jpeg: Unable to open '13727.jpg' for reading
    > in /var/www/html/viewer.php on line 75
    >[/color]

    Error messages can be your greatest friend. Is the file 13727.jpg in
    /var/www/html? That's where it's probably looking, since that's where
    the PHP script is and you didn't provide an absolute path in the file
    name. You should probably do that, something like:

    $IMG_BASE = "/var/www/html";
    $FullImgName = "$IMG_BASE/$image.jpg";

    Comment

    • Sandwick

      #3
      Re: Image Resize does not work

      Joshua Ghiloni <jdg11@SPAM.ME. AND.DIE.cwru.ed u> wrote in message news:<bdfjun$q0 d$1@eeyore.INS. cwru.edu>...[color=blue]
      > Sandwick wrote:[color=green]
      > >
      > > ############### ##### error ############### ############### ###########
      > > Warning: imagecreatefrom jpeg: Unable to open '13727.jpg' for reading
      > > in /var/www/html/viewer.php on line 75
      > >[/color]
      >
      > Error messages can be your greatest friend. Is the file 13727.jpg in
      > /var/www/html? That's where it's probably looking, since that's where
      > the PHP script is and you didn't provide an absolute path in the file
      > name. You should probably do that, something like:
      >
      > $IMG_BASE = "/var/www/html";
      > $FullImgName = "$IMG_BASE/$image.jpg";[/color]

      thanks for the input that eliminated 3 of the errors !

      I now have the file identified, but it will still not display the
      picture in half. It now complains about the following?

      It looks like I do not have the right version, but my phpinfo() tells
      me I have 1.62 or higher support.

      See error below.
      ############### ######## Error ############### ###############
      Warning: imagecreatetrue color(): requires GD 2.0 or later in
      /var/www/html/viewer.php on line 83

      Warning: imagecopyresamp led(): requires GD 2.0 or later in
      /var/www/html/viewer.php on line 84

      Warning: imagepng(): supplied argument is not a valid Image resource
      in /var/www/html/viewer.php on line 85


      // Larry

      Comment

      • Shawn Wilson

        #4
        Re: Image Resize does not work

        Sandwick wrote:
        [color=blue]
        > Joshua Ghiloni <jdg11@SPAM.ME. AND.DIE.cwru.ed u> wrote in message news:<bdfjun$q0 d$1@eeyore.INS. cwru.edu>...[color=green]
        > > Sandwick wrote:[color=darkred]
        > > >
        > > > ############### ##### error ############### ############### ###########
        > > > Warning: imagecreatefrom jpeg: Unable to open '13727.jpg' for reading
        > > > in /var/www/html/viewer.php on line 75
        > > >[/color]
        > >
        > > Error messages can be your greatest friend. Is the file 13727.jpg in
        > > /var/www/html? That's where it's probably looking, since that's where
        > > the PHP script is and you didn't provide an absolute path in the file
        > > name. You should probably do that, something like:
        > >
        > > $IMG_BASE = "/var/www/html";
        > > $FullImgName = "$IMG_BASE/$image.jpg";[/color]
        >
        > thanks for the input that eliminated 3 of the errors !
        >
        > I now have the file identified, but it will still not display the
        > picture in half. It now complains about the following?
        >
        > It looks like I do not have the right version, but my phpinfo() tells
        > me I have 1.62 or higher support.
        >
        > See error below.
        > ############### ######## Error ############### ###############
        > Warning: imagecreatetrue color(): requires GD 2.0 or later in
        > /var/www/html/viewer.php on line 83
        >[/color]

        Am I missing something? You have 1.62 or higher. The error message says you need 2.0. Presumably, you have
        something between 1.62 and 2.0. You'll need to upgrade.

        Shawn
        --
        Shawn Wilson
        shawn@glassgian t.com



        Comment

        Working...