Sponsored links

Go Back   MP3Car.com > General > Off Topic


Reply
 
Share Thread Tools Display Modes
Old 07-03-2004, 04:55 PM   #1
Constant Bitrate
 
chewiee's Avatar
 
Join Date: Apr 2004
Location: Kent, UK
Posts: 127
chewiee is on a distinguished road
OT: Need a PHP Guru who's good with images

I hope one of you guys here can help me, I'd be most grateful.

I've got a bit of code that I've written/stripped from somewhere and I need it to do the following:

Upload jpg to server
check orientaiton (landscape or portrait)
if portrait resize to 240 x 320
if landscape resize to 320 x 240
upate table

ATM it uploads ok, resizes anything to 320 x whatever ratio, consequently portrait images are deeper than landscape ones.
it then updates the table.

So the only problem I have is this portrait/landscape resize depending on code.

Anyone help me out? I really need someone to point me out the error of my ways! So please either PM me or mail me at chewiee 2004 | my4x4,co,uk


Thanks

Chewiee
__________________
www.my4x4.co.uk

[---------0] (99% complete)

Vauxhall Frontera Sport RS:
Kenwood KDC-W6527 HU
Silver Travla C134, Slot Loading DVD/CDRW,
256MB, VIA Epia MII 12000, Carnetix 60W, Xenarc VGA/Composite TS and a GPS Mouse
chewiee is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 07-04-2004, 12:14 AM   #2
FLAC
 
Gutter's Avatar
 
Join Date: Dec 1999
Location: Casina, Italy
Posts: 900
Gutter is on a distinguished road
So you don't know how to determine orientation or your code isn't working? If it's the former, have you tried using the ImageSX and ImageSY functions?

Code:
$img_path = "images/picture.jpg"; $extension = strtolower(substr($img_path, -3)); if ($extension = "gif") { $src_img = ImageCreateFromGIF("$img_path") } else { $src_img = ImageCreateFromJPEG("$img_path") } If (ImageSX($src_img) > ImageSY($src_img)) { //Image is wider than it is tall } else { //Image is taller than it is wide (or the sides are of equal length) }

If it's something in the code that's not working, you're going to have to post the relevant parts before anyone can help you.
__________________
Don't Click

Last edited by Gutter; 07-04-2004 at 12:27 AM.
Gutter is offline   Reply With Quote
Old 07-04-2004, 01:43 AM   #3
Top Ramen
 
lgbr's Avatar
 
Join Date: Feb 2004
Location: Spokane, WA, US
Posts: 973
lgbr has a little shameless behaviour in the past
Man, I am out of practice with PHP. I'd help you, but I forgot all the image stuff.

I can remember a half life script I wrote to get the locations of all players on a server and then map them all out on a jpeg, live.
__________________
Audio Rockford Fosgate: 900 Watt 4-channel amp, 501bd Mono amp
Computer AMD 2400+ XP, 1 GB DDR RAM, Orbit Micro 250W DC-DC PSU

Head units are for cheaters!
Quote:
sure some girls fake orgasms.....but it's guys like me who fake the whole relationship

lgbr is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Good Quality Button Images emayers04 MediaCar 0 06-01-2004 06:24 PM
Coyote, launch images more mods MediaCar 5 03-21-2004 01:48 AM



All times are GMT -5. The time now is 10:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics