This is a discussion on "PHP Image Resize problem" within the PHP Forum section. This forum, and the thread "PHP Image Resize problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP Image Resize problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
PHP Image Resize problem
I am trying to retrieve some images from a mySQL DB, resize them in PHP, in proportion, with the following function. This is working fine when testing on my local machine. However, when I load it to the web I get the default width($mw) but no height (IE draws a 1m image height). Check it out at
http://www.freewaymedical.co.uk/prot...dex.php?cat=ch Thinking it must be differing PHP versions on local machine and web hosts. Is there anything I can edit in my code for a fix?
|
|
|
|
|||
|
You need to try to debug this - where does the height value dissapear? Is it at the very beginning when you call getimagesize($n);, or later on in one of the maths bits?
|
|
|||
|
I am more than happy to get stuck in to the debugging-it just threw me that it works locally but not on host. Thought that someone may have noticed something obvious.
I will try debugging on the host. Any more suggestions in the meantime would be appreciated. Cheers |
|
|||
|
I took your tip and did some debugging-For some reason I needed to give an absolute path (http://...) rather than relative (../images/)
This has done the trick. Cheers |
|
|||
|
Aaah, that makes sense if the file is accessed via HTTP...?
|
|
|||
|
Yeah that's right. Can you explain why HTTP needs an absolute path?
|
![]() |
| Tags |
| php, image, resize, problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Resize dynamically loaded image | nate2099 | Flash & Multimedia Forum | 2 | Aug 31st, 2007 22:36 |
| word resize problem in frameset | jacobds | Web Page Design | 4 | Feb 13th, 2007 22:21 |
| Resize image-how to get lenght of image | nicetomeetu | PHP Forum | 9 | Sep 19th, 2006 22:39 |
| Resize image-how to get lenght of image | nicetomeetu | Introduce Yourself | 5 | Sep 18th, 2006 14:08 |
| resize problem | somsahi | Web Page Design | 5 | Aug 22nd, 2006 20:34 |