Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Lemming #1
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
-
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... -
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... -
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... -
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... -
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... -
Jeffrey Silverman #2
Re: Auto thumbnails
On Mon, 20 Oct 2003 16:26:05 +0100, Lemming wrote:
Yes.> 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?
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
-
Lemming #3
Re: Auto thumbnails
"Jeffrey Silverman" <jeffrey@jhu.edu> wrote:
Excellent - many thanks.>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.
Lemming
--
Curiosity *may* have killed Schrodinger's cat.
[url]http://goldcrossdata.co.uk/[/url] ICQ: 8647501
Lemming Guest
-
Raptor #4
Re: Auto thumbnails
Lemming wrote:
There's a tutorial on creating thumbnails using GD linked to the front> 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
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
-
Nathan #5
Re: Auto thumbnails
Raptor <me@attbi.com> wrote in message news:<3F941CFC.1090303@attbi.com>...
I made this one on my own.> 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.
>
> --
<?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
-
Nathan #6
Re: Auto thumbnails
Raptor <me@attbi.com> wrote in message news:<3F941CFC.1090303@attbi.com>...
Oh, you can see a working example here.> 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.
>
> --
[url]http://www.factory8.com/r6/[/url]
Nathan Guest
-
fxtra #7
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



Reply With Quote

