Broken Thumbnails

Discuss general web development questions. Help others and get help from others.

Moderator: kfury77

Broken Thumbnails

Postby Broughton » Wed Jul 02, 2008 9:00 am

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 )
Broughton
 
Posts: 4
Joined: Wed Jul 02, 2008 8:52 am
Location: Brisbane Australia

Re: Broken Thumbnails

Postby MikeyB » Wed Jul 02, 2008 9:39 am

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
User avatar
MikeyB
Top Contributor
 
Posts: 511
Joined: Fri Jun 09, 2006 10:38 am
Location: UK

Re: Broken Thumbnails

Postby chrisjlocke » Wed Jul 02, 2008 12:51 pm

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.
User avatar
chrisjlocke
Top Contributor
 
Posts: 966
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK

Re: Broken Thumbnails

Postby Broughton » Thu Jul 03, 2008 4:43 am

Not my code, I suppose it was done by the guy who built the site. Was working fine.
Broughton
 
Posts: 4
Joined: Wed Jul 02, 2008 8:52 am
Location: Brisbane Australia

Re: Broken Thumbnails

Postby chrisjlocke » Thu Jul 03, 2008 6:58 am

Was? What else has changed? Its unusual for code to 'suddenly' break...
User avatar
chrisjlocke
Top Contributor
 
Posts: 966
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK

Re: Broken Thumbnails

Postby Broughton » Thu Jul 03, 2008 7:14 am

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.
Broughton
 
Posts: 4
Joined: Wed Jul 02, 2008 8:52 am
Location: Brisbane Australia

Re: Broken Thumbnails

Postby chrisjlocke » Thu Jul 03, 2008 8:35 am

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.
User avatar
chrisjlocke
Top Contributor
 
Posts: 966
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK

Re: Broken Thumbnails

Postby Broughton » Thu Jul 03, 2008 8:56 am

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.
Broughton
 
Posts: 4
Joined: Wed Jul 02, 2008 8:52 am
Location: Brisbane Australia

Re: Broken Thumbnails

Postby chrisjlocke » Fri Jul 04, 2008 2:23 pm

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.
User avatar
chrisjlocke
Top Contributor
 
Posts: 966
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK


Return to Web Developer Talk

Who is online

Users browsing this forum: No registered users and 1 guest

cron