Page 1 of 1

Broken Thumbnails

PostPosted: Wed Jul 02, 2008 9:00 am
by Broughton
Hello,
In http://www.brisbanebrass.com/gallery.php I tried resizing the thumbnails directly with Rapid PHP and am left with broken pictures which when clicked still show the big pic in a separate window. I have tried to put everything back as it was and can not find anything different in the gallery.php or imageresize.php files.

Asked support guys at our host for advice and received the following reply.

Hi Broughton

When I go to the following link:

http://www.brisbanebrass.com/imageresiz ... &width=200

I get the following errors:

<br />
<b>Warning</b>: imagecolorallocate(): supplied argument is not a valid Image resource in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>6</b><br />
<br />
<b>Warning</b>: imagesx(): supplied argument is not a valid Image resource in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>7</b><br />
<br />
<b>Warning</b>: imagesx(): supplied argument is not a valid Image resource in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>9</b><br />
<br />
<b>Warning</b>: imagesy(): supplied argument is not a valid Image resource in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>10</b><br />
<br />
<b>Warning</b>: Division by zero in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>17</b><br />
<br />
<b>Warning</b>: imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>32</b><br />
<br />
<b>Warning</b>: imagecopyresized(): supplied argument is not a valid Image resource in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>33</b><br />
<br />
<b>Warning</b>: imagejpeg(): supplied argument is not a valid Image resource in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>35</b><br />
<br />
<b>Warning</b>: imagedestroy(): supplied argument is not a valid Image resource in <b>/home/brisbane/public_html/imageresize.php</b> on line <b>36</b><br />

I suggest using the following forum and displaying this problem

viewforum.php?f=4

Can anyone advise on how to deal with this. I am rather new to PHP but can follow directions.

Broughton ( Brisbane Brass webmaster )

Re: Broken Thumbnails

PostPosted: Wed Jul 02, 2008 9:39 am
by MikeyB
Hi,

I don't really see how that can be a RapidPHP problem.

That is a PHP error message, meaning something is wrong with the code in your imageresize.php script.

Also, I would suggest resizing the images one time only in your favourite image editor to create the thumbnails, would save a lot of server resources and time compared to resizing them every time.

Cheers,
Mike

Re: Broken Thumbnails

PostPosted: Wed Jul 02, 2008 12:51 pm
by chrisjlocke
Where did you get imageresize.php from? Is this your code?
This isn't a RapidPHP issue, but a PHP coding issue.

Moving to 'self help' forum instead.

Re: Broken Thumbnails

PostPosted: Thu Jul 03, 2008 4:43 am
by Broughton
Not my code, I suppose it was done by the guy who built the site. Was working fine.

Re: Broken Thumbnails

PostPosted: Thu Jul 03, 2008 6:58 am
by chrisjlocke
Was? What else has changed? Its unusual for code to 'suddenly' break...

Re: Broken Thumbnails

PostPosted: Thu Jul 03, 2008 7:14 am
by Broughton
I tried resizing the thumbnails directly with Rapid PHP on the www.brisbanebrass.com/gallery.php page to make them smaller and fit more in and load faster. Tried returning all back to original values but still broken. Didn't do anytjhing with the PHP, not game as don't know what I'm doing. Can work with HTML and CSS but only just; I'm really a garden designer but am the only person in Brisbane Brass who knows anything about web sites at all. The guy who built it is an emergency dept doctor and has sort of moved on. Ive been to Essex to visit a cousin in Danbury and a guy in our No. 3 band is from Chelmsford. Do appreciate attempts to help me as it's embarrassing to admit to a damaged web site at committee meetings.

Re: Broken Thumbnails

PostPosted: Thu Jul 03, 2008 8:35 am
by chrisjlocke
The quickest (temporary) way around this is to create the thumbnails manually. Dead easy. I'll sort out some instructions.
I know a little bit about php and have (well, had...) my own image resizing code. If you want to email me the imageresize.php file, I could take a look.

Yup, know Danbury and Chelmsford well! Lovely area. Still quite rural in places.

Re: Broken Thumbnails

PostPosted: Thu Jul 03, 2008 8:56 am
by Broughton
I'm trying to send you the file but don't see how to attach things to messages on here and the contact link on your website doesn't seem to bring anything up, will keep trying. If you email me at bwgardens@ecn.net.au I can reply with the file.

Re: Broken Thumbnails

PostPosted: Fri Jul 04, 2008 2:23 pm
by chrisjlocke
Aah, I had 'users can contact me by email' turned off in my profile. Oops. Have changed that. Will also sort out that contact page - didn't know that was broken!!
Feel free to email me at blumentals at chrisjlocke dot co dot uk.