Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
image thumbnails error
i’m building a new version of a site. i made a fresh install, and then i imported some key tables like textpattern, and the images. i thought this would give me a cleaner site.
in the images tab of my new site, i get this error:
Notice: Undefined variable: thumb_w in C:\xampp\htdocs\mysite\textpattern\include\txp_image.php on line 191
then below it the list of images appears, many have thumbnails. uploading a new image and trying to create a thumbnail is unsuccessful.
line 191 says: ($thumb_w ? “width=’$thumb_w’ height=’$thumb_h’” : ‘’). ‘ />’;
Last edited by mrtunes (2009-12-29 01:52:48)
Offline
Re: image thumbnails error
Did you import the table from a Txp 4.2.0 site? thumb_w was introduced in that version.
Code is topiary
Offline
Re: image thumbnails error
jsoo wrote:
Did you import the table from a Txp 4.2.0 site?
thumb_wwas introduced in that version.
no, it was a 4.0.8 on a live site. should i upgrade on the live domain and then re-export the tables?
Offline
Re: image thumbnails error
mrtunes wrote:
no, it was a 4.0.8 on a live site. should i upgrade on the live domain and then re-export the tables?
I expect that would fix the issue.
Code is topiary
Offline
Re: image thumbnails error
ok i upgraded the main site to 4.2.0 – re-exported the txp_image table, and imported it to localhost. nothing changed unfortunately
Offline
Re: image thumbnails error
Does the txp_image table indeed have image_w and image_h sorry, thumb_w and thumb_h columns after import?
Any errors showing in Diagnostics?
Last edited by jsoo (2010-01-07 15:58:32)
Code is topiary
Offline
Re: image thumbnails error
jsoo wrote:
ok i took better note of these specific columns, and it looks like i didn’t import it well last time. now it’s all resolved. thank you.Does the txp_image table indeed have image_w and image_h columns after import?
Any errors showing in Diagnostics?
something i noticed along the way of this redesign i’m doing – the new 4.2.0 gives some fairly scary looking errors after you upgrade your site. for someone not expecting it, it looks like they’ve corrupted the entire system, but it goes away after the second refresh.
Last edited by mrtunes (2009-12-29 20:37:59)
Offline
#8 2010-01-07 00:31:44
- korpulente
- Member
- Registered: 2009-01-29
- Posts: 36
Re: image thumbnails error
I get the exact same PHP error, after exporting my txp_image table from one 4.2.0 install into another.
The txp_image table doesn’t have any image_w or image_h columns. However there are a thumb_w and thumb_h column in txp_prefs…
How did you manage to fix it, mrtunes?
Offline
Re: image thumbnails error
well i don’t really know much about how 4.2.0 works, but if it’s properly upgraded those tables should be there. can you check the bottom of your admin panel to confirm you are indeed 4.2.0?
Offline
#10 2010-01-07 00:58:19
- korpulente
- Member
- Registered: 2009-01-29
- Posts: 36
Re: image thumbnails error
Yes, this is indeed Textpattern 4.2.0. And no updates available. :-/
Offline
Re: image thumbnails error
can you go into phpmyadmin, click on the txp_images table, scroll to the far right and take a screenshot?
actually, don’t bother doing that.
but here’s what mine looks like:

Last edited by mrtunes (2010-01-07 01:04:47)
Offline
#12 2010-01-07 01:11:58
- korpulente
- Member
- Registered: 2009-01-29
- Posts: 36
Re: image thumbnails error
That’s weird. I don’t seem to have those columns, thumb_w and thumb_h, in txp_image.

Offline
#13 2010-01-07 01:24:59
- korpulente
- Member
- Registered: 2009-01-29
- Posts: 36
Re: image thumbnails error
I tried dropping the table, and recreating it like this:
CREATE TABLE `txp_image` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`category` varchar(255) NOT NULL default '',
`ext` varchar(20) NOT NULL default '',
`w` int(8) NOT NULL default '0',
`h` int(8) NOT NULL default '0',
`alt` varchar(255) NOT NULL default '',
`caption` text NOT NULL,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`author` varchar(255) NOT NULL default '',
`thumbnail` int(2) NOT NULL default '0',
`thumb_w` int(8) NOT NULL default '0',
`thumb_h` int(8) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `author_idx` (`author`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=3 ;
So far so good. Then I tried inserting the image values, like this:
INSERT INTO `txp_image` VALUES (1, 'divider.gif', 'site-design', '.gif', 400, 1, '', '', '2005-07-22 16:37:11', 'yourmom', 0);
This fails however. I get the following error: #1136 – Column count doesn’t match value count at row 1
What am I doing wrong?
Last edited by korpulente (2010-01-07 01:25:26)
Offline
#14 2010-01-07 01:30:18
- korpulente
- Member
- Registered: 2009-01-29
- Posts: 36
Re: image thumbnails error
Darn it! Looks like all my insert values are corrupt, as they lack dimensions for the thumbnails.
They’re exported recently from a live site, so something is obviously wrong on that one, but how can I fix it? Can I give them “default” values (width and height), without making a mess?
Edit:
Something like this works fine — it matches all columns — but will it mess up the site?
INSERT INTO `txp_image` VALUES (1, 'divider.gif', 'site-design', '.gif', 400, 1, '', '', '2005-07-22 16:37:11', 'yourmom', 0, '', '');
Last edited by korpulente (2010-01-07 01:33:07)
Offline
Re: image thumbnails error
when i export my tables i check off the box that says something like “create drop table”. it’s always unchecked. then when i import the table, i uncheck the box that says “allow interuptions”. then when it’s done writing i just get a green check mark. when i see messages like what you’ve posted above i feel like i’ve done it wrong.
however in the image above, you don’t even have these tables present. i’m stumped.
Last edited by mrtunes (2010-01-07 01:45:17)
Offline