PHP image gallery problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Harley
Forum Newbie
Posts: 7
Joined: Sat Feb 01, 2003 3:59 am

PHP image gallery problem

Post by Harley »

I am looking for a solution to the following setup:

I have a folder that accepts uploads. People upload image files to that folder via the website interface. I then have another PHP page that outputs what is in the folder. This works fine but I would like to use all the code has to offer. To do that I need a script or something that would take the uploaded files and make a thumbnail file for each image. I would also need it to name the new file with a TN_ at the begining of the name. Does anyone make this script? Please help! To use or view the current page I am talking about go here... http://www.frankwatsonsworld.com/MENU/U ... pload.html

Thanks in advance! :D
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

take a look at the (more or less) built-in image functions of php, esp. http://www.php.net/manual/en/function.i ... esized.php (quality is not best, but mostly sufficient)

There are also some tutorial and free scripts available for thumbnails, e.g. http://www.hotscripts.com/PHP/Scripts_a ... ipulation/
User avatar
bznutz
Forum Commoner
Posts: 58
Joined: Mon Dec 09, 2002 9:52 pm
Location: Here
Contact:

Post by bznutz »

However, the GD library no longer will allow editing of gif formatted images.
How should one deal with this?
User avatar
redcircle
Forum Commoner
Posts: 43
Joined: Fri Jan 31, 2003 8:47 pm
Location: michigan, usa

Post by redcircle »

http://squitosoft.angrymosquito.com I just put up a pre-release version of my gallery script. Look at my sloppy code to see if it gives you any ideas.
Harley
Forum Newbie
Posts: 7
Joined: Sat Feb 01, 2003 3:59 am

Post by Harley »

I just need something that will create thumbnails for images that are uploaded. I want to keep the upload system that is already there. I thought I had seen one of these a while back.
User avatar
bznutz
Forum Commoner
Posts: 58
Joined: Mon Dec 09, 2002 9:52 pm
Location: Here
Contact:

Post by bznutz »

My script may be more of what you're looking for:
http://userpages.umbc.edu/~bsimmo1/?l=/ ... raphix.txt
Harley
Forum Newbie
Posts: 7
Joined: Sat Feb 01, 2003 3:59 am

Post by Harley »

PERFECT!!!!!! That is exactly what I am looking for. Although I must say I am not positive on how to use it. Here is what I did, then maybe you can tell me what I have done wrong or left out...

I took that code and put it in a new file called thumb_make.php. I then put that new file in the image folder that my system uploads to. Then I went to that new page http://www.frankwatsonsworld.com/MENU/U ... b_make.php and from what I can tell, it's trying to work but I am missing something. Can you let me know what is missing or wrong? Thanks alot for this awesome script!
User avatar
bznutz
Forum Commoner
Posts: 58
Joined: Mon Dec 09, 2002 9:52 pm
Location: Here
Contact:

Post by bznutz »

Well, first problem is that the current version of the script uses the latest GD library, so no gif support (it won't thumbnail gifs yet). I'm working on this in the next version.
Second problem is hard to tell unless I can see both the directory and the script. I know that the script was written such that you can drop it into any directory and it will allow you to browse dynamic thumbs of all pics.
Perhaps the problem is that you don't have GD installed.
At the top of the script type this: php_info();
Then run the script. It will tell you if you have GD at all.
Also, what is the OS/php version on your server?
Harley
Forum Newbie
Posts: 7
Joined: Sat Feb 01, 2003 3:59 am

Post by Harley »

GD Support enabled
GD Version 2.0 or higher


That's what I see about GD in the PHP info... Is this the new version?
Harley
Forum Newbie
Posts: 7
Joined: Sat Feb 01, 2003 3:59 am

Post by Harley »

-=Disabled URL=-
Last edited by Harley on Mon Feb 03, 2003 2:29 am, edited 1 time in total.
User avatar
bznutz
Forum Commoner
Posts: 58
Joined: Mon Dec 09, 2002 9:52 pm
Location: Here
Contact:

Post by bznutz »

next time just email that link.
You don't want the whole world to see your config.

Let me rework the code on my side to see what may trip you up.
I wrote it on an XP box but didn't really have OS in mind.
However, there is extraneous crap in it that I can get rid of.
Come to my site and sign up, then email me so I know it's you.
Then you can get into my web dev forum and we can work on this together a bit easier.
Post Reply