Page 1 of 1

Uploading an image AND creating a thumb

Posted: Wed Apr 23, 2003 12:45 am
by reverend_ink
OK having an issue I cant find an aswer to online or in a book.

I am trying to upload a single image, log it in a database as well as create thumbnail of a certain size at the same time without having to upload twice, and log both pics to the same mysql table.

Is this possible?

Thanks

Re: Uploading an image AND creating a thumb

Posted: Wed Apr 23, 2003 2:40 am
by herod1
reverend_ink wrote:OK having an issue I cant find an aswer to online or in a book.

I am trying to upload a single image, log it in a database as well as create thumbnail of a certain size at the same time without having to upload twice, and log both pics to the same mysql table.

Is this possible?

Thanks
I don't think that you could do it in one statement. But if you upload the file then you will know the local name and then you can create your thumb. You will need to have the GD libraries available to you in your PHP installation to make thumbnails and be aware that this no longer handles GIF image formats.

Posted: Wed Apr 23, 2003 6:49 am
by pootergeist
as herod said, having access to either GD (my favourite), imageMagick or Gimp on the server will be the best way of creating the thumbnails - if you let us know which module and build / version you have, we can help further.

personally I would reccommend using an auto_increment (INT) id field in the database and use that value to name both the large image and the thumbnail (with a prefix or suffix) as that assures you never accidentally overwrite an already uploaded file.

more help once first question answered - best reply would be 'umm GD2+' ;)