Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Auto thumbnails

    Hi,

    [crossposted]

    I'm putting together a website for a local estate agent.

    One of the things they want to do is upload property
    descriptions/prices/etc. plus a picture of the property which is for
    sale.

    I'd like to generate thumbnails of the pictures automatically either
    once the data is uploaded (preferred) or when the relevant page is
    delivered to the browser. Server-side scripting will most likely be
    done in PHP.

    Is this possible?

    Lemming
    --
    Curiosity *may* have killed Schrodinger's cat.
    [url]http://goldcrossdata.co.uk/[/url] ICQ: 8647501
    Lemming Guest

  2. Similar Questions and Discussions

    1. Thumbnails
      What a helpful person cheesefood is.......prat!!! Ifv your thumbnails were saved in an earlier version of PS they may not open so you will need to...
    2. Help deleting thumbnails
      Hi Folks, I'm trying to delete 2 files using fso. The mail file name is stored in an access db. using the code below I can delete the main file...
    3. Illustrator thumbnails Win YES and illustrator thumbnails Mac NO? thumbnails thumbnails Illustr
      Y have 2 different version Adobe Creative Suite one for windows, and one for MacOS X. The probem is: and Illustrator CS Mac the illustrator file...
    4. thumbnails with php
      hy all, i am complety new to GD and i must have a code within 2 days that does the following for me - Upload an image (jpg / png / gif) and...
    5. Auto Levels and Auto color stopped working right
      When I have an image opened in Photoshop 7 and I hit either Auto Levels or Auto color, the image always brightens now to an unattractive looking...
  3. #2

    Default Re: Auto thumbnails

    On Mon, 20 Oct 2003 16:26:05 +0100, Lemming wrote:
    > Hi,
    >
    > [crossposted]
    >
    > I'm putting together a website for a local estate agent.
    >
    > One of the things they want to do is upload property
    > descriptions/prices/etc. plus a picture of the property which is for sale.
    >
    > I'd like to generate thumbnails of the pictures automatically either once
    > the data is uploaded (preferred) or when the relevant page is delivered to
    > the browser. Server-side scripting will most likely be done in PHP.
    >
    > Is this possible?
    Yes.

    For more info, look at
    GD functions -- can be built into PHP directly.
    ImageMagick
    NetPBM


    Both IM and NetPBM must be accessed using passtrhu(), exec(), system()
    or similar. NetPBM does the best job of manipulating images, IMO.
    --
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
    Johns Hopkins University | Baltimore, MD
    Website | [url]http://www.wse.jhu.edu/newtnotes/[/url]

    Jeffrey Silverman Guest

  4. #3

    Default Re: Auto thumbnails

    "Jeffrey Silverman" <jeffrey@jhu.edu> wrote:
    >On Mon, 20 Oct 2003 16:26:05 +0100, Lemming wrote:
    >
    >> I'd like to generate thumbnails of the pictures automatically either once
    >> the data is uploaded (preferred) or when the relevant page is delivered to
    >> the browser. Server-side scripting will most likely be done in PHP.
    >>
    >> Is this possible?
    >
    >Yes.
    >
    >For more info, look at
    > GD functions -- can be built into PHP directly.
    > ImageMagick
    > NetPBM
    >
    >
    >Both IM and NetPBM must be accessed using passtrhu(), exec(), system()
    >or similar. NetPBM does the best job of manipulating images, IMO.
    Excellent - many thanks.

    Lemming
    --
    Curiosity *may* have killed Schrodinger's cat.
    [url]http://goldcrossdata.co.uk/[/url] ICQ: 8647501
    Lemming Guest

  5. #4

    Default Re: Auto thumbnails

    Lemming wrote:
    > Hi,
    >
    > [crossposted]
    >
    > I'm putting together a website for a local estate agent.
    >
    > One of the things they want to do is upload property
    > descriptions/prices/etc. plus a picture of the property which is for
    > sale.
    >
    > I'd like to generate thumbnails of the pictures automatically either
    > once the data is uploaded (preferred) or when the relevant page is
    > delivered to the browser. Server-side scripting will most likely be
    > done in PHP.
    >
    > Is this possible?
    >
    > Lemming
    There's a tutorial on creating thumbnails using GD linked to the front
    page of phpfreaks.com.

    --
    --
    Lynn Wallace [url]http://www.xmission.com/~lawall[/url]
    "I'm not proud. We really haven't done everything we could to protect
    our customers. Our products just aren't engineered for security."
    --Microsoft VP in charge of Windows OS Development, Brian Valentine.

    Raptor Guest

  6. #5

    Default Re: Auto thumbnails

    Raptor <me@attbi.com> wrote in message news:<3F941CFC.1090303@attbi.com>...
    > Lemming wrote:
    > > Hi,
    > >
    > > [crossposted]
    > >
    > > I'm putting together a website for a local estate agent.
    > >
    > > One of the things they want to do is upload property
    > > descriptions/prices/etc. plus a picture of the property which is for
    > > sale.
    > >
    > > I'd like to generate thumbnails of the pictures automatically either
    > > once the data is uploaded (preferred) or when the relevant page is
    > > delivered to the browser. Server-side scripting will most likely be
    > > done in PHP.
    > >
    > > Is this possible?
    > >
    > > Lemming
    >
    > There's a tutorial on creating thumbnails using GD linked to the front
    > page of phpfreaks.com.
    >
    > --
    I made this one on my own.

    <?php
    function CheckUpload($filename)
    {
    $checkjpg = explode('.', $filename);
    if($checkjpg[1] == 'jpg' || $checkjpg[1] == 'JPG' || $checkjpg[1] ==
    'jpeg' || $checkjpg[1] == 'JPEG')
    {
    $size = getimagesize("/var/www/domains/factory8.com/r6/pics/uploaded/temp/$filename");
    if($size[0] <= '540' && $size[1] <= '600')
    {
    $size = filesize("/var/www/domains/factory8.com/r6/pics/uploaded/temp/$filename");
    if($size <= '102400')
    {
    if (!file_exists("/var/www/domains/factory8.com/r6/pics/uploaded/$filename"))
    {
    return TRUE;
    }
    else
    {
    die('Filename already exists.');
    return FALSE;
    }
    }
    else
    {
    die('File is greater than 100k');
    return FALSE;
    }
    }
    else
    {
    die('File resolution is to large');
    return FALSE;
    }
    }
    die('File must be a jpg, sorry.');
    return FALSE;
    }

    function createThumb($filename,$uid, $extension)
    {
    $x = '150';
    $y = '150';
    $location = 'pics/uploaded/thumbnails/'.$uid.'.'.$extension;
    $proportain = 1; //0 for no, 1 for yes
    if (!$image=getimagesize($filename))
    {
    return FALSE; //return false if there is no image to create from
    or it is not a image
    }
    else
    {
    if ($image['2'] == '1')
    {
    $im = imagecreatefromgif ($filename);
    }
    else if ($image['2'] == '2')
    {
    $im = imagecreatefromjpeg ($filename);
    }
    else
    {
    return FALSE; // return false if filetype is not of gif or
    jpeg
    }
    if ($proportain == 1)
    {
    if ($image[0]<$image[1])
    {
    $x = $y * ($image[0]/$image[1]);
    }
    else
    {
    $y = $x / ($image[0]/$image[1]);
    }
    }
    $newim = imagecreatetruecolor($x, $y);
    ImageCopyResampled($newim, $im, 0, 0, 0, 0, $x, $y, $image[0],
    $image[1]);
    imagejpeg($newim, $location);
    imagedestroy ($im);
    imagedestroy ($newim);
    return TRUE;
    }
    }
    ?>


    --


    Uploading file...<br>
    <?php
    if($file_name !="")
    {
    copy ("$file", "pics/uploaded/temp/$file_name")
    or die("Could not copy file.");
    }
    else {die("No file specified.");}
    ?>
    Checking file...<br>
    <?php
    $checkfile = CheckUpload($file_name);
    ?>
    Putting in permanent place...<br>
    <?php
    copy("$file", "/var/www/domains/factory8.com/r6/pics/uploaded/$file_name");
    ?>
    Creating thumbnail file...<br>
    <?php
    $fileinfo = explode('.', "$file_name");
    $thumbcreated = createThumb("pics/uploaded/$file_name","$fileinfo[0]","$fileinfo[1]");
    ?>
    Adding to the random picture list...<br>
    <?php
    $dbconn = mysql_connect("localhost", "username", "password");
    mysql_select_db("factory8_com");
    $addtodb = mysql_query("INSERT INTO bikepics (filename, comment,
    owner, ipaddy) VALUES('$file_name', '$comment', '$owner',
    '$REMOTE_ADDR')");
    mysql_close($dbconn);
    ?>
    <b>Done!</b><br>
    <?php
    print("
    <img src='pics/uploaded/$file_name'><br><img
    src='pics/uploaded/thumbnails/$file_name'>
    ");
    ?>

    --

    only bad part, is i forgot to delete the pictures in the temp
    directory. :-P
    Nathan Guest

  7. #6

    Default Re: Auto thumbnails

    Raptor <me@attbi.com> wrote in message news:<3F941CFC.1090303@attbi.com>...
    > Lemming wrote:
    > > Hi,
    > >
    > > [crossposted]
    > >
    > > I'm putting together a website for a local estate agent.
    > >
    > > One of the things they want to do is upload property
    > > descriptions/prices/etc. plus a picture of the property which is for
    > > sale.
    > >
    > > I'd like to generate thumbnails of the pictures automatically either
    > > once the data is uploaded (preferred) or when the relevant page is
    > > delivered to the browser. Server-side scripting will most likely be
    > > done in PHP.
    > >
    > > Is this possible?
    > >
    > > Lemming
    >
    > There's a tutorial on creating thumbnails using GD linked to the front
    > page of phpfreaks.com.
    >
    > --
    Oh, you can see a working example here.
    [url]http://www.factory8.com/r6/[/url]
    Nathan Guest

  8. #7

    Default Auto Thumbnails

    Ok, I'm building a lot of galleries on my website and I like to make my own
    thumbnails in my own gallery layouts (rather than using automated gallery
    creation programs) And i was wondering if there was a way of auto linking a
    thumbnail to the full size image. This would basically mean auto linking the
    thumbnail image to the same filename without *tn before the file extension.

    So for example Dogtn.gif would auto-link to Dog.gif.

    Is there any way that could happen just by dragging the Dogtn.gif image from
    the files section onto the page?

    Thanks for reading.

    fxtra Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139