BBS.PROGENIC.COM
Home      Members   Calendar   Who's On   SOTM
Welcome Guest ( Login | Register )
      

Home » Chat » Coding » Conditional Image resize script


Conditional Image resize scriptExpand / Collapse
Author
Message
Posted Thursday, April 03, 2008 9:06 AM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Yesterday @ 7:35 PM
Posts: 531, Visits: 1,366
I need some php pointers
If anyone has something like this please share
I need a script that when you add an image and it creates a thumb to it it will also resize images that are bigger then a given number of pixels
If anyone knows or has anything like this please share
Post #14230
Posted Thursday, April 03, 2008 4:41 PM


Progenic Family

Progenic Family

Group: Old Skool
Last Login: Today @ 3:45 PM
Posts: 1,073, Visits: 2,304
GD Library will allow you to do this. It will have to be installed on the server, if not already there...should be though.

I'm not at home to give you one of my resize scripts...will be home on Sat.
But I found the pointers online...this is what I recall.

To get the image size:
$im=imagecreatefromstring($fileContent) (I loaded it through BLOB)
$width=imagesx($im)
$heigh=imagesy($im)

And then to create the image resized would be:
$resize=ImageCreateTrueColor($imgw,$imgh)

// imgw is what you wanna resize the image to. So you'd set it earlier imgw=640, and imgh is the height. Duh.

And finally, the most important thing which took me forever to find. This is to resample the image, take out all the jagged lines upon resizing. Otherwise it looks crap-o-la.
ImageCopyResampled (I forget the parameters, there are a zillion )

Oh crap, also almost forgot. Clearing the memory.
imagedestroy ($im)
imagedestroy ($resize)

OK. I know this doesn't help. But with some g**gle power. You'll find some script to help you more than me...this is all I recall until I see the script on my computer.

-------------
Is Beezer gonna have to choke Google Adsense?
Post #14232
Posted Thursday, April 03, 2008 6:20 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Yesterday @ 7:35 PM
Posts: 531, Visits: 1,366
Thanks a lot

This helps a lot helping me learn some new php commands which I am always up for Please do share a ready made script to whenever you can ...sorry still not good enough to make my own ...thanks a whole lot bro
Post #14233
Posted Friday, April 04, 2008 9:27 AM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Today @ 9:25 AM
Posts: 335, Visits: 1,963
Learn it, make some effort.










I'll do it for 10 bucks.
Post #14238
Posted Friday, April 04, 2008 3:48 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Yesterday @ 7:35 PM
Posts: 531, Visits: 1,366
i'd pay if it were for my site


btw you got a real php tutorial site

not the crap you find in google and not quite php.org ..a bit to complicated ..
Post #14244
Posted Friday, April 04, 2008 6:44 PM


Progenic Family

Progenic Family

Group: Old Skool
Last Login: Today @ 3:45 PM
Posts: 1,073, Visits: 2,304
Two websites that helped me a lot when I forgot something were:

http://www.dbforums.com/
http://www.php-mysql-tutorial.com/

The 2nd one is good, but there are instructions missing so you'll have to figure out the problems on your own when stuff doesn't work out the way you want.

BTW, messaged you the code.

-------------
Is Beezer gonna have to choke Google Adsense?

Post #14250
Posted Friday, April 04, 2008 7:14 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Yesterday @ 7:35 PM
Posts: 531, Visits: 1,366
thanks a whole lot bro
Post #14251
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: proge, wax

All times are GMT -6:00, Time now is 10:28pm

Progenic BBS 2008
Execution: 0.141. 10 queries. Compression Enabled.