Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-18 00:33:04

Sak
Member
From: Seattle, WA
Registered: 2006-10-18
Posts: 30
Website

Create thumbnail issues.

Hey everyone,

I’m running into a little issue with the “Create thumbnail” option.

I uploaded an image, and deciding to try out the option I entered some values into the fields. The thumbnail was created for my test image, but I wasn’t happy with it, so I just recreated a new thumbnail locally (via Gimp) and uploaded that.

However, now, whenever I upload a new image, it’s always stuck with the default thumbnail dimensions and creates a new one every time. The only thing I could find in the forums on this matter was this discussion:

http://forum.textpattern.com/viewtopic.php?id=13280

I tried looking in the preferences, under the Admin tab for some related setting but wasn’t able to find anything as was suggested in the forum thread, above. If I try to empty out the fields, and hit the “Create” button again, I get a string of error messages. I tried entering zeroes into the fields, hit “Create” and now those values are set as the defaults, which now generates error messages for every image that I try to upload.

Here’s the error output:

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 211

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 212

Warning: imagesx(): supplied argument is not a valid Image resource in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 359

Warning: imagesy(): supplied argument is not a valid Image resource in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 359

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 362

Warning: imagecopy(): supplied argument is not a valid Image resource in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 373

Warning: imagecopymerge(): supplied argument is not a valid Image resource in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 374

Warning: imagejpeg(): supplied argument is not a valid Image resource in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 248

Warning: imagedestroy(): supplied argument is not a valid Image resource in /users/home/sakeel/web/public/sak/textpattern/lib/class.thumb.php on line 256

Is this a bug, or am I doing something wrong? I’d like to get it back to the default of empty fields for the “Create thumbnail” option.


Thanks,
Sak.

Offline

#2 2006-12-15 15:50:46

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Create thumbnail issues.

Was the thumbnail you uploaded of the same file extension?

Offline

#3 2006-12-15 17:19:21

Sak
Member
From: Seattle, WA
Registered: 2006-10-18
Posts: 30
Website

Re: Create thumbnail issues.

Hi Mary,

Thanks for taking a look into this for me. To be honest I don’t really remember. I do know that early on I discovered that the thumbnail needs to have the same extension as the primary image or TXP doesn’t really agree with it, so I’m fairly certain that the thumbnail that I created after my attempt at using the “Create Thumbnail” option did have the same extension.

Unfortunatley it was almost a month ago, so I can’t be 100% certain. Sorry. I don’t mind going in and fixing the setting back to the default in TXP’s PHP if you can suggest where to make the change. I don’t know PHP so when I looked at the code on the lines mentioned in the error I succumbed to the “deer in headlights” effect. I wouldn’t even mind testing your theory for you to see if I could reproduce it again and get it stuck again.


Thanks,
Sak.

Offline

#4 2006-12-16 19:24:13

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Create thumbnail issues.

Well, if it is not a problem at present, don’t worry about it. If/when it happens again, update this thread with the relevant information. :)

Offline

#5 2006-12-16 20:05:18

Sak
Member
From: Seattle, WA
Registered: 2006-10-18
Posts: 30
Website

Re: Create thumbnail issues.

But it still happens, every time I upload an image. I get the same error messages, and the “Create Thumbnails” dimensions fields are filled in with zeroes.

What I want to be able to do is reset TXP’s “Create Thumbnail” dimensions to it’s default values (empty?). Is that possible, or will I forever be stuck with a stream of error messages whenever I upload an image?


Thanks,
Sak.

Offline

#6 2006-12-16 21:16:36

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Create thumbnail issues.

Okay, after re-reading your original post…

  • The fields always have to have a number to actually work. You should receive a “Invalid width or height” message if you entering nothing in those fields, but there’s no checking for zeros that is done.
  • They will also always carry the last number successfully used.
  • If the field has any number it will always create a thubmnail for any images uploaded.
  • I only get yucky error messages, like you mentioned, for the one image that ships with Textpattern. I think there muct be something actually wrong with the file itself. I’ll check into it.

So, you’ve encountered two bugs:

  • If you empty both fields out it should respect the fact that you don’t want thumbnail created at all.
  • If you enter zeros it shouldn’t try and use those either.

Edit: ou should be able to correct the errors for now by entering a real number in one of the fields, and leave the other blank.

Last edited by Mary (2006-12-16 21:17:38)

Offline

#7 2006-12-16 21:49:12

Sak
Member
From: Seattle, WA
Registered: 2006-10-18
Posts: 30
Website

Re: Create thumbnail issues.

Ah, I think I see.

Unfortunately I still get undesireable results. Here’s what I just tried:

I uploaded an image, got the error messages because the defaults were still set at zeroes. I cleared both fields and clicked “Create” the errors went away, but got the “Invalid width or height ()/()” at the top. This is how I normally have to upload images since I started having this problem.

Per your suggestion, I deleted the image and tried again. I got the error messages to start with again, but this time I entered just 10 into the width field, emptied the height field, and hit “Create.” It created a thumbnail and set that as the new default values. Now when I upload images they all get the 10px width and blank height values as default.

p.s. I’m happy to continue testing, since I’m still stuck in the situation, if you come up with some code that you’d like for me to try out, etc.

Last edited by Sak (2006-12-16 21:51:24)


Thanks,
Sak.

Offline

#8 2006-12-16 22:03:14

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Create thumbnail issues.

Yeah, it still doesn’t do what you want, but at least you don’t have hideous errors anymore. I’m currently working on fixing this behaviour. :)

Offline

#9 2006-12-17 22:42:15

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Create thumbnail issues.

r2159 does better checking of the thumbnail dimensions – doesn’t allow you to try and use zero anymore.

In crockery I will work on allowing you to reset the preferences completely, and remove the thumbnail.

Offline

#10 2006-12-17 23:22:18

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Create thumbnail issues.

Crockery: r2160

Offline

#11 2006-12-17 23:38:59

Sak
Member
From: Seattle, WA
Registered: 2006-10-18
Posts: 30
Website

Re: Create thumbnail issues.

Hey Mary,

I tried out r2159 so I thought I should report my results.

I downloaded the file and uploaded it to my server, overwiring the previous txp_image.php file (after making a backup of course).

The first test image that I uploaded was still set at 0 and null for height and width, so I got the stream of error messages up top. The difference now is, likely what you had intended, that I cannot enter zeros or null into the fields. TXP won’t accept either, and reverts to the default 0 and null that I had previously.

Putting in a height value, and leaving a null width fixes the error messages, and now sets it as the default. The reverse is also true – putting in a null value for height and a numeric value for width.

I think these are the results you were after, and make perfect sense. No zeroes, and no null values for both fields. Let me know when you have the next revision that allows for the preference change, and removal of the thumbnail altogether and I’ll be happy to test it out for you.

Thanks again for tackling this.

Mary == Hero :D


Thanks,
Sak.

Offline

#12 2006-12-17 23:45:09

Sak
Member
From: Seattle, WA
Registered: 2006-10-18
Posts: 30
Website

Re: Create thumbnail issues.

Mary,

I just saw r2160 posted here.

Unfortunately it doesn’t work for me:

When I load the images tab I get these errors at the top:

Warning: include_once(/users/home/sakeel/web/public/sak/textpattern/lib/txplib_image.php) [function.include-once]: failed to open stream: No such file or directory in /users/home/sakeel/web/public/sak/textpattern/include/txp_image.php on line 22

Warning: include_once() [function.include]: Failed opening ‘/users/home/sakeel/web/public/sak/textpattern/lib/txplib_image.php’ for inclusion (include_path=’.:/usr/local/share/smarty:/usr/local/share/pear’) in /users/home/sakeel/web/public/sak/textpattern/include/txp_image.php on line 22

and when I try to upload an image I just get:

Warning: include_once(/users/home/sakeel/web/public/sak/textpattern/lib/txplib_image.php) [function.include-once]: failed to open stream: No such file or directory in /users/home/sakeel/web/public/sak/textpattern/include/txp_image.php on line 22

Warning: include_once() [function.include]: Failed opening ‘/users/home/sakeel/web/public/sak/textpattern/lib/txplib_image.php’ for inclusion (include_path=’.:/usr/local/share/smarty:/usr/local/share/pear’) in /users/home/sakeel/web/public/sak/textpattern/include/txp_image.php on line 22

Fatal error: Call to undefined function: img_makethumb() in /users/home/sakeel/web/public/sak/textpattern/include/txp_image.php on line 669

I’ll drop back to r2159 in the meantime.


Thanks,
Sak.

Offline

Board footer

Powered by FluxBB